Congratulations! You have completed our initial preliminary questionnaire. Now that we know a little bit about you, we want to a deeper dive into your WordPress programming skills. Please complete and submit your answer.
Please note that what we would like to see are:
- Adhere to the WordPress-Core coding standard (feel free to run it through wpcs codesniffer)
- Please make sure to add comprehensive comments
Hope you have fun while you complete this. Good luck!
Task
Please create a custom WP CLI job the does the following things
For all the product
content that has custom taxonomy product_cat
term early-access
remove the early-access
term if the post meta public_access_date
has past.
Templates
Below is the skeleton class template for the custom cli. Add your function in this class.
<?php
/**
* Product_cli class
*
* @package Ndevr
* @since 1.0.0
*/
if ( ! defined( 'WP_CLI' ) || ! WP_CLI ) {
return;
}
class Product_CLI extends \WP_CLI_Command {
/**
* Untag all early access classes when public access date is past.
*
* Your comments go here.
*/
// Your function goes here.
}
WP_CLI::add_command( 'product', 'Product_CLI' );
You can download the template form here
Submission
Create a gist on your github gist page (https://gist.github.com/) and submit the link address