I'm trying to remove meta boxes added to the WordPress menu editor page from a theme, but can't seem to figure out how to do it, I found this answer, but I must be doing something wrong as it isn't working.
Below is what I want to remove:
My code:
add_action( 'do_meta_boxes', 'blm_remove_plugin_metaboxes' );
function blm_remove_plugin_metaboxes() {
remove_meta_box('_menu_icon', 'nav-menus', 'side');
}
For the ID I have tried the following but none have worked:
- _menu_icon
- menu_icon
- add-_menu_icon
- add_menu_icon
Trying to find the code in the theme files that adds them, it appears they are utilising these hooks:
add_action( 'wp_nav_menu_item_custom_fields', array( __CLASS__, '_fields' ), 10, 4 );
add_action( 'wp_update_nav_menu_item', array( __CLASS__, '_save' ), 10, 3 );
add_filter( 'manage_nav-menus_columns', array( __CLASS__, '_columns' ), 99 );
The class method _fields
appears to then call the respective method for the type of field and then echos that data.
Am I missing something?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744939225a4602219.html
评论列表(0条)