0

I have two admin submenu items for my custom post type, but only the first one, "General Settings", hilights when either submenu page is being viewed.

    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'
    );

How do I get 'Form Settings' to be hilighted when the page is viewed?

0

Check:

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'
);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.