How to ‘clone’ select metabox options with a callback function? [closed]

Add a simple function in your functions.php file. function get_button_styles(){ return array( ‘button’ => ‘Button’, ‘button_red’ => ‘Button Red’, ‘button_yellow’ => ‘Button Yellow’, ); } Use it to get button styles in different metabox fields array( ‘id’ => ‘all_btns’, ‘name’ => ‘Button Select’, ‘type’ => ‘select’, ‘options’ => get_button_styles(), ‘callback’ => ‘metabox_clone_options’, ),

How using the Meta Box plugin, to filter posts by the value of a post type field?

I’m not familiar with the Meta Box plugin or it’s capabilities (and please note that third-party products are considered off-topic here!) – but regarding the question in the scope of core WordPress alone… For clarity’s sake, I envision the lessons_teacher meta-value to look similar to [[‘post_name’ => ‘john_smith’], [‘post_name’ => ‘jane_doe’]] SQL – and by … Read more

how to reset metabox excerpt to open

By default, WordPress saves the open/close state of these metaboxes each time you toggle it. This is done via javascript, requesting an ajax endpoint on the server. You need to find out if that request is still send or not. If it’s not send (e.g. javascript error, blocked by some plugin), then you found the … Read more

Post edit screen: How to check if meta_box is registered?

Check the metabox global directly? $wp_meta_boxes[‘YOURTYPE’] should hold data on metaboxes for a given type. Had a quick look in wp-admin/includes/template.php but i can’t see any convenience functions for extracting metabox information from the array so you’ll probably need to create your own code to loop over or extract the necessary info from it. Of … Read more