add_meta_box showing blank screen in my page
add_meta_box showing blank screen in my page
add_meta_box showing blank screen in my page
Meta box not displaying on the plugin page
Save Edit button then disabled readonly metabox
REST API custom endpoints for metaboxes
Warning: Illegal string offset ‘post’ and ‘page’
This did the trick, in jQuery: //get page title var edit_title_page=$(“html head title”).text(); //Confirm if this is right Edit page if (edit_title_page.indexOf(“Edit Form”) >= 0) { $(‘#postbox-container-2’).removeClass(“postbox-container”); $(‘#postbox-container-2’).css(‘width’,’100%’); $(‘#postbox-container-2’).css(‘float’,’left’); $(‘#mymetaboxID’).show(); } It will first check for edit page title, if it’s on the right page, remove the post-box container containing the display none, then apply … Read more
as example of js code that will run on every new post page function admin_footer_se_119285(){ ?> jQuery(window).ready(function(){ if (jQuery(‘#metabox-id-div’).length == 1){ // put your code } }) <?php } ?> Take a look to usefull reference to admin_footer-(plugin_page) action hook
Simlified function, maybe will help someone: jQuery(document).ready(function($) { $(“#page_template”).change(function() { if($(‘#page_template’).val() != ‘page-contacts.php’) { // show the meta box $(‘#postdivrich’).show(); } else { // hide your meta box $(‘#postdivrich’).hide(); } }).change(); }); Of course it lacks controls what fields will be submitted, because jQuery just hides them. As I am coding it for one-admin user … Read more
The whole page/post/custom post type post screen is a big form. That means that whenever you hit “publish” on a post type edit screen, the whole form – and that means every content on the page – gets processed and WordPress executes everything. And that “everything” includes all kinds of hooks that you should use … Read more
Forgive me if I am misunderstanding the question but… So, when I get get_post_meta( $get_post_ID()); … you already have the post ID via $get_post_ID() (which is a BuddyPress function I believe) do you not? If so, you are making this far more complicated than it needs to be. get_post_meta() is only returning the metadata. Given … Read more