Support

Account

Home Forums ACF PRO How to have a option sub page pointing to another URL (like CPT edit)

Solving

How to have a option sub page pointing to another URL (like CPT edit)

  • I created a option sub page that I would like link to

    edit.php?post_type=my-templates

    How can I do? I am using a code like that, that is not working…

    acf_add_options_sub_page(array(
     'page_title' 	=> 'My Templates',
     'menu_title'	=> 'Edit Templates',
     'menu_slug' 	=> 'edit.php?post_type=my-templates',
     'parent_slug'	=> 'myparentslug',
     'capability'	=> 'manage_options'));	
    
  • Adding an ACF options page will link to that options page and cannot be made to link to something else.

    What you are looking for is add_submenu_page() in the WP codex here https://codex.wordpress.org/Function_Reference/add_submenu_page. Omit the $function parameter if you want to link to some other existing admin page.

  • Hi thanks for your Answer

    What i should put as parent menĂ¹ slug considering the parent is an ACF option page (admin.php?pAge=myoptions Does not. Work)

    Angelo

  • Just you “myoptions”, the following creates a sub menu item than links to the page edit admin

    
    add_action('admin_menu', 'add_my_admin_subpage');
    function add_my_admin_subpage() {
      add_submenu_page('myoptions', // parent slug
                       'page title', // shouldn't matter 
                       'test link', // menu text
                       'manage_options', 
                       'edit.php?post_type=page');
    }
    
Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘How to have a option sub page pointing to another URL (like CPT edit)’ is closed to new replies.