Attach Files Metabox

For the part of opening a lightbox, browse for something and then performing something on an action within: WordPress has this already build in. For what you ask is basically the thickbox that opens up like in the post editor when you browse for an image in the gallery. You find all the code you … Read more

Is there a filter/action to add content to WP admin metaboxes?

I couldn’t find a hook so I went with the JS option. add_action( “admin_head-post-new.php”, ‘meta_box_instruction’ ); //new post add_action( “admin_head-post.php”, ‘meta_box_instruction’ ); //edit post function meta_box_instruction($d) { global $post; if($post->post_type == ‘{YOUR POST TYPE}’ || $_GET[‘post_type’] == ‘{YOUR POST TYPE}’): ?> <script type=”text/javascript”> jQuery(document).ready(function(){ jQuery(‘<p>Some instruction</p>’).insertBefore(‘#taxonomy-{YOUR TAXONOMY NAME}’).parent(); }); </script> <?php endif; }

Remove metabox from specific page template in admin

Those are 2 different things: Hide only in one Page Hide only when Page uses a specific template Case 1 – in this example the Page ID is 3, but note that the removals are for page and post alike: add_action( ‘admin_menu’, ‘remove_post_meta_boxes’ ); function remove_post_meta_boxes() { if( isset( $_GET[‘post’] ) && $_GET[‘post’] == ‘3’ … Read more

Metabox date month number to word

The code you are using is specifically for the month abbreviation, (Oct). You should be using this: function eventposttype_get_the_month($month) { global $wp_locale; for ( $i = 1; $i < 13; $i = $i +1 ) { if ( $i == $month ) $month =$wp_locale->get_month( $i ) ; } return $monthabbr; }

Hiding a theme’s meta box

Remove WordPress Meta Boxes You have to make use of the function called remove meta box. Description: Removes a meta box or any other element from a particular post edit screen of a given post type. It can be also used to remove a widget from the dashboard screen. Steps to remove the meta box … Read more

Add Meta box Befoure Post Title

The only real chance you got is to hook into admin_notices, which is above the post-new.php page title & icon: function wpse27700_above_title_content() { ?> <style> /* You might need to attach some styles here, to not get into the admin notices styles */ </style> <h1>TEST</h1> <p>This is a test message</p> <?php } // This is … Read more

inside a metabox

It’s not the right approach, since you are in a post(cpt) edit page the metabox’s are simple grouped fields that get attached to the post form and in your case it’s actually the browser who is filtering your metabox’s form attributes and not WordPress since you are creating nested forms which is something that you … Read more

How to group meta boxes on the post edit page

Thanks for the hint Bainternet, indeed this is very easy to implement with jQuery. Example (the four meta boxes are closed for clarity) : Here’s what I did : var $j = jQuery.noConflict(); $j(document).ready(function() { $j(“#side-sortables”).append(‘<div id=”container_div” class=”postbox meta-box-sortables ui-sortable”><div class=”handlediv” title=”Click to toggle.”><br></div><h3 class=”hndle”><span>Container Meta Box</span></h3><div id=”container_inside” class=”inside”></div></div>’); $j(“#my_metabox_div”).appendTo(“#container_inside”); $j(“#my_other_metabox_div”).appendTo(“#container_inside”); etc… }); I added … Read more