Unbind postbox click handler

You can just put the necessary javascript in a file and enqueue it on the necessary page:

add_action( 'admin_enqueue_scripts', 'add_admin_scripts', 10, 1 );
function add_admin_scripts( $hook ) {    
//You can globalise $post here and enqueue the script for only certain post-types.
    if ( $hook == 'post-new.php' || $hook == 'post.php') {
        wp_register_script( 'my_js_handle','/path/to/js/my-js-file.js',array('jquery'),1,true);
        wp_enqueue_script('my_js_handle');
   }
}

With the javascript file containing:

    jQuery(document).ready(function() {
       jQuery('.postbox h3, .postbox .handlediv').unbind('click.postboxes');
    });

(In, fact you could probably just ‘print’ it in the admin-footer).

Leave a Comment