Viewing 4 reply threads
  • Author
    Posts
    • #3554
      adrianm
      Member

      My set-up is like this:
      1. I have 4 custom post types added using ‘piklist_post_types’
      2. I have configured a menu to group all the links to those custom types using WordPress built-in functionality (‘add_menu_page’ and ‘add_submenu_page’)
      3. I want to add a settings page under the menu I created

      I have tried the following scenarios
      1. Use the ‘piklist_admin_pages’ filter to add the page under the ‘edit.php’ (or ‘manage.php’ or ‘options.php’) menu

      
      $pages[] = array(
              'page_title' => 'My Options',
              'menu_title' => 'My Options',
              'sub_menu' => 'edit.php', // or 'admin.php' or 'options.php'
              'capability' => 'manage_options',
              'menu_slug' => 'special-settings',
              'setting' => 'special',
              'single_line' => true,
              'default_tab' => 'Basic',
              'save_text' => 'Save Settings'
          );
      

      This makes the settings page accesible an is placed in the menu (only for ‘edit.php’)

      2. If I try to put it under the menu ‘edit.php?post_type=my_custom_type’, where I want to put it 3 things happen:
      a) The link placed first in the menu (although defined last). In the previous scenario (submenu => ‘edit.php’) the link is placed at the bottom.
      b) The URL is wp-admin/special-settings
      c) The page is not accessible anymore at an address that worked previosly (like edit.php?page=special-settings)

      I hope this makes sense.

      Is there a way to tell Piklist that I want to handle a settings page without using the piklist_admin_pages filter?

    • #3559
      Steve
      Keymaster

      @adrianm– I don’t think I understand the issue 100%, but you don’t need to use piklist_admin_pages to add a settings page. You can do using standard WordPress functions. Would that help?

      If not, please zip up you code and email to [email protected] so we can take a look.

    • #3561
      adrianm
      Member

      @Steve. I know about making a settings page using the standard Wodpress functions. How can I make piklist render and handle the form for that page?

      I will upload a zip file soon as I suspect this is a bug due to filters/actions priorities.

    • #3562
      adrianm
      Member
      This reply has been marked as private.
    • #3569
      Steve
      Keymaster

      @adrianm– I took a look at your code. You may have to manipulate the WordPress $menu and $submenu globals directly. Here’s a tutorial that should help.

Viewing 4 reply threads
  • You must be logged in to reply to this topic.