【问题标题】:WordPress admin menu hilighting wrong item for CPTWordPress 管理菜单突出显示 CPT 的错误项目
【发布时间】:2019-01-25 09:16:07
【问题描述】:

我的自定义帖子类型有两个管理子菜单项,但只有第一个“常规设置”在查看任一子菜单页面时突出显示。

    add_submenu_page(
        'edit.php?post_type=landingpage',
        "General Settings", 
        "General Settings", 
        'manage_options', 
        "wp_cpt_plugin_page", 
        'my_callback'
    );
    add_submenu_page(
        'edit.php?post_type=landingpage', 
        'Form Settings',
        'Form Settings',
        'manage_options', 
        'wp_cpt_plugin_page&tab=form-settings', 
        'my_callback'
    );

如何在查看页面时突出显示“表单设置”?

【问题讨论】:

    标签: php wordpress wp-admin


    【解决方案1】:

    检查:

    add_submenu_page(
        'edit.php?post_type=landingpage', 
        'Form Settings',
        'Form Settings',
        'manage_options', 
        // This is the menu slug, you can not pass the arguments,
        // if you want to pass arguments then add only one sub menu page and
        // links with arguments, also display content with conditions of passed arguments.
        'wp_cpt_plugin_page-form-settings',
        'my_callback'
    );
    

    【讨论】:

      猜你喜欢
      • 2011-01-19
      • 1970-01-01
      • 2012-09-15
      • 1970-01-01
      • 2016-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多