- This topic has 4 replies, 2 voices, and was last updated 6 years, 10 months ago by
Steve.
-
AuthorPosts
-
-
April 1, 2015 at 11:32 am #3554
adrianmMemberMy 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 createdI 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 iswp-admin/special-settings
c) The page is not accessible anymore at an address that worked previosly (likeedit.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_pagesfilter? -
April 2, 2015 at 10:14 am #3559
SteveKeymaster@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.
-
April 2, 2015 at 10:40 am #3561
adrianmMember@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.
-
April 2, 2015 at 11:19 am #3562
adrianmMemberThis reply has been marked as private. -
April 2, 2015 at 4:12 pm #3569
SteveKeymaster@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.
-
-
AuthorPosts
- You must be logged in to reply to this topic.