1

I'm trying to force a metabox open and not let the admin close it for a custom post type, is this possible? See below for the code that creates the box.

  function cwf_create_enquiry_metabox_html() // Create custom metabox HTML
  {
    $post_id = $_GET['post'];

    echo '<p class="sender_information">' . wpautop(esc_textarea(get_post_meta($post_id, 'message', true))) . '</p>';
    echo '<p class="sender_information">Received: <b>' . get_the_time('j F Y @ H:i', $post->ID) . '</b></p>';
  }

  function cwf_create_metabox() // Add custom metabox to "form-submission" post type
  {    
    add_meta_box('sender-information', 'Sender Information', 'cwf_create_sender_information_metabox_html', 'form-enquiry', 'side');
  }
  add_action('add_meta_boxes', 'cwf_create_metabox');

Thanks in advance!

  • Found this wordpress.stackexchange.com/questions/31941/… but it did not work for me on WP 4.6.1. – Dave Romsey Dec 9 '16 at 23:36
  • Sadly in WP 4.7 I had the same result. Nice idea though to loop through all the scripts and unset the one that's causing the toggle. Might look into trying to get that idea to work myself. – Chess Byte Dec 10 '16 at 0:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.