Puedo desactivar el arrastre de metaboxes en todo el sitio con esta función:
function disable_drag_metabox() {
wp_deregister_script('postbox');
}
add_action( 'admin_init', 'disable_drag_metabox' );
Pero lo quiero solo en un tipo de publicación personalizada. Intenté lo habitual:
function disable_drag_metabox() {
global $current_screen;
if( 'event' == $current_screen->post_type ) wp_deregister_script('postbox');
}
add_action( 'admin_init', 'disable_drag_metabox' );
y también este:
function disable_drag_metabox() {
$screen = get_current_screen();
if( in_array( $screen->id, array( 'event' ) ) ) {
wp_deregister_script('postbox');
}
}
add_action( 'admin_init', 'disable_drag_metabox' );
Lamentablemente no funciona. ¿Qué estoy haciendo mal? el tipo de publicación personalizada se llama evento.