Can i categorise my meta box?

The code you posted in your question is very very very incomplete, anyway I will try to give you an answer. You can define as many meta box as you need and put inside each meta box the fields you want. For example: add_action( ‘add_meta_boxes’, ‘my_meta_boxes’ ); function my_meta_boxes(){ //We define the two metaboxes I … Read more

add unique code required to register

Add a field on your registration form <label for=”secret_reg_code”>Secret Code: </label> <input type=”text” name=”secret_reg_code” id=”secret_reg_code” value=”” /> then in your plugin file or in function.php add define(‘MY_SECRET_REG_CODE’, ‘fdsfgadsfgdf’); function check_for_reg_secret_code($errors, $sanitized_user_login, $user_email) { if ( defined(‘MY_SECRET_REG_CODE’) && trim($_POST[‘secret_reg_code’]) != MY_SECRET_REG_CODE ) { $errors->add( ‘secret_code_error’, __(‘<strong>ERROR</strong>: Enter a valid code postal code.’, ‘your_text_domain’) ); } return … Read more

Assign certain editors to certain posts

If you used author, instead of editor, then WP default functionality would be such that they could only see those posts they are listed as author on. Editor might be then used for something like a supervisor who doesn’t need other admin roles. This solution means you don’t have to modify anything and can use … Read more

Rewrite category list as an if / else statement

See the comments in code for explaination // all the categories for the post $categories = get_the_category(); // extracts ids form post categories $categories_ids = wp_list_pluck( $categories, ‘term_id’ ); // all the categories id that are descendant of category 12 $children = get_terms(‘category’, array(‘child_of’=>12, ‘fields’=>’ids’) ); // all the categories id for the post that … Read more

Add Protocol to Custom Menus

You need to use the kses_allowed_protocols filter: function wpse_allow_sms_protocol( $protocols ) { $protocols[] = ‘sms’; return $protocols; } add_filter( ‘kses_allowed_protocols’, ‘wpse_allow_sms_protocol’ );