Disable dragging of meta boxes?

I had the same problem, and Google lead me here. Unfortunately none of these answers helped, but I ultimately figured out the answer, and it’s quite easy! First, enqueue a JavaScript file (I won’t rehash this process; there are many tutorials that can describe this process better than I). I hooked into admin_enqueue_scripts, and it … Read more

Remove Custom Taxonomy Metabox from Custom Post Type Screen

If you are manually registering your custom taxonomy via register_taxonomy then you can pass in arguments to control where the metabox appears. In the example below setting show_ui to false would completely remove the metabox from the edit screen, the quick edit screen, and the admin menu. But if you set show_ui to true you … Read more

Order by multiple meta key and meta value [closed]

meta_query is an array of meta clauses. For example: $q = new WP_Query( array( ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘state’, ‘value’ => ‘Wisconsin’, ), array( ‘key’ => ‘city’, ‘compare’ => ‘EXISTS’, ), ), ) ); You can use an associative array, with a key for each meta clause: $q = new … Read more

How to show a custom meta box on the “Quick Edit” screen?

There seems to be no easy way to do this, you must add all code yourself. inline_edit_row(), the function that draws the Quick Edit and Bulk Edit screens, seems to have only one action that you can hook into: quick_edit_custom_box or bulk_edit_custom_box. It gets called for all non-core columns that wp_manage_posts_columns() returns. There are some … Read more

How to set default screen options?

You are referring to the metaboxes on the admin post screen right? For that you don’t need a plugin, just drop the following into your functions.php file. // add_action(‘user_register’, ‘set_user_metaboxes’); add_action(‘admin_init’, ‘set_user_metaboxes’); function set_user_metaboxes($user_id=NULL) { // These are the metakeys we will need to update $meta_key[‘order’] = ‘meta-box-order_post’; $meta_key[‘hidden’] = ‘metaboxhidden_post’; // So this can … Read more