php - Remove metabox from WordPress menu editor page?

I'm trying to remove meta boxes added to the WordPress menu editor page from a theme, but can't seem to figure

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

相关推荐

  • php - Remove metabox from WordPress menu editor page?

    I'm trying to remove meta boxes added to the WordPress menu editor page from a theme, but can't seem to figure

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信