Custom “Publish” / “Update” button &

You can stimulate click to Update post button like this.. Adding submit or update button to custom metabox? <script> jQuery(‘.metabox_submit’).click(function(e) { e.preventDefault(); jQuery(‘#publish’).click(); }); </script> <input type=”submit” class=”metabox_submit” value=”Submit” />

Use meta box value in CPT as post title

<?php add_action( ‘save_post’, ‘post_updated’ ); function post_updated( $post_id ) { // verify post is not a revision & not an autosave if ( !wp_is_post_revision( $post_id ) && !(defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE) ) { // set the new post title $post[‘ID’] = $post_id; $post[‘post_title’] = get_post_meta($post_id, ‘ecpt_name’, true); // update the post, removing the action … Read more

Add filter ‘wpautop’ to meta box textarea

Add a function that grabs your meta data, applies wpautop and echoes it out, or otherwise run it through when you output it in your template. $my_meta = get_post_meta($post->ID,’_my_meta’,TRUE); echo $my_meta[‘name’]; echo wpautop( $my_meta[‘description’], 1 );

Removing custom meta box added in parent theme

Note: This is the merged version between my and @toscho answers. Explanation (by @toscho) Use add_meta_boxes_page as action hook. You can find the hook in wp-admin/edit-form-advanced.php and it displays as: do_action(‘add_meta_boxes_’ . $post_type, $post); Solution(s) Try the following action, which is inside register_post_type() as well. function wpse59607_remove_meta_box( $callback ) { remove_meta_box( ‘id-of-meta-box’ , ‘page’ , … Read more

Access the environment of an admin page from another admin page

Ok, this could be achieved this way, probably. add_action(‘add_meta_boxes_my_super_duper_post_type’, ‘get_metabox_global_ajax’, 9999 ); function get_metabox_global_ajax(){ if( isset($_GET[‘mgv’]) && $_GET[‘mgv’] == ‘1’ ){ global $wp_meta_boxes; @error_reporting( 0 ); header( ‘Content-type: application/json’ ); die( json_encode( $wp_meta_boxes )); } } Now, you send a request from your plugin page to post-new.php?post_type=my_super_duper_post_type&mgv=1 through ajax, and use the returned json response … Read more

Move excerpt to always be directly below post content in admin

The reason why your code doesn’t work is most likely that you’ve ordered your metaboxes before, and the that order has been saved into the meta-box-order_page meta value. This overrides the default setup. Here’s an example of the meta-box-order_post meta value: a:3:{ s:4:”side”; s:61:”submitdiv,formatdiv,categorydiv,tagsdiv-post_tag,postimagediv”; s:6:”normal”; s:96:”revisionsdiv,postexcerpt,trackbacksdiv,postcustom, commentstatusdiv,commentsdiv,slugdiv,authordiv”; s:8:”advanced”; s:0:””; } Here I’ve just reformatted the … Read more