Tagged: 

Viewing 5 reply threads
  • Author
    Posts
    • #8775
      normbrogdonjr
      Participant

      I 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.

    • #8781
      Steve
      Keymaster

      @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.

    • #8802
      normbrogdonjr
      Participant

      The 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.
    • #8805
      normbrogdonjr
      Participant

      The Piklist Demos is currently activated, if that makes a difference.

    • #8814
      normbrogdonjr
      Participant

      Your documentation has been updated and the problem has been resolved.

      Thanks

    • #8815
      Steve
      Keymaster

      Great. Closing ticket

Viewing 5 reply threads
  • The topic ‘Changing Admin Menu for Custom Admin Pages’ is closed to new replies.