Tagged: admin menu
- This topic has 5 replies, 2 voices, and was last updated 3 years, 10 months ago by
Steve.
-
AuthorPosts
-
-
March 6, 2018 at 6:49 pm #8775
normbrogdonjrParticipantI am having trouble getting changing the admin menu so that I can use custom admin pages.
I modified the function.php file in the websites theme directory with this added to the end:
add_filter(‘piklist_admin_pages’, ‘my_admin_pages’);
function my_admin_pages($pages) {
$pages[] = array(
‘page_title’ => ‘About this plugin’,
,’menu_title’ => ‘About’,
,’menu_slug’ => ‘about_my_plugin’
);return $pages;
}I created a test page to match the code. I refreshed the admin page and nothing changed. I’m sure it’s something simple, but I’m nor seeing it.
Thanks for any assistance.
-
March 12, 2018 at 5:01 pm #8781
SteveKeymaster@normbrogdonjr– Welcome to the Piklist community!
I’m surprised your page is rendering. You have commas at the beginning and end of each line. When I use one comma per line your code works.
-
March 24, 2018 at 4:11 pm #8802
normbrogdonjrParticipantThe confusion is mine. The code I copied to this post was from your documentation, and it did not render. I had removed the extra commas.
I have attached an image of the code that I actually added to the functions.php file. I also uploaded an image of the admin menu after adding the code.
I seem to be missing something from the instructions as I do not get the results that I expect.
Attachments:
You must be logged in to view attached files. -
March 24, 2018 at 4:20 pm #8805
normbrogdonjrParticipantThe Piklist Demos is currently activated, if that makes a difference.
-
April 1, 2018 at 5:37 pm #8814
normbrogdonjrParticipantYour documentation has been updated and the problem has been resolved.
Thanks
-
April 1, 2018 at 7:09 pm #8815
SteveKeymasterGreat. Closing ticket
-
-
AuthorPosts
- The topic ‘Changing Admin Menu for Custom Admin Pages’ is closed to new replies.