CMB2 metabox conditional logic
The best way to do this is by using JavaScript and there is a couple of CMB2 plugins let you do that easily: CMB2 Conditional CMB2 Conditional Logic
The best way to do this is by using JavaScript and there is a couple of CMB2 plugins let you do that easily: CMB2 Conditional CMB2 Conditional Logic
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
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; }
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
Wrong Assumptions @Rarst or @Dan-Cameron answers may work, but assume that when you are viewing a post type editing page, the metaboxes for the other post type are all registered. There are different case in which that won’t happen: If metaboxes are registered using “add_meta_boxes_{$post_type}” hook, instead of the more common, generic “add_meta_boxes” they won’t … Read more
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; }
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
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
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
As suggested by sri, I will answer my own question 🙂 The drag and drop of the meta boxes is for remembering the order of the meta boxes for each user, so if user A like to have meta box 5 on top because he uses that feature more, he doesn’t have to do move … Read more