Viewing 4 reply threads
  • Author
    Posts
    • #246
      James Mc
      Member

      Hello Piklisters,

      Happy Friday! I believe I have found a bug in how the link URLs to settings tabs are generated. In my plugin, with a custom post type of ‘listing’, I have registered a settings page like so:


      function listing_setting_pages($pages) {
      $pages[] = array(
      'page_title' => 'Listing Settings' // Title of page
      ,'menu_title' => 'Listing Settings' // Title of menu link
      ,'sub_menu' => 'edit.php?post_type=listings' // Show this page under the post type: listings menu
      ,'capability' => 'manage_options' // Minimum capability to see this page
      ,'menu_slug' => 'listing-fields' // Menu slug
      ,'setting' => 'listing-settings' // The settings name
      ,'icon' => 'options-general' // Menu/Page Icon
      ,'default_tab'=> 'Basic' // Set a default tab
      );

      return $pages;
      }
      add_filter('piklist_admin_pages', 'listing_setting_pages');

      I have two settings tabs, defined like so:
      The ‘Basic’ Tab:

      /*
      Title: Real Estate Listing Settings
      Setting: listing-settings
      */

      The Realtor Tab:

      /*
      Title: Realtor Settings Section
      Setting: listing-settings
      Tab: Realtors
      */

      This is all working fine. The bug seems to be that the URLs for the tabs, they are generated missing the parameter ‘post_type’:
      What is generated:
      http://www.example.com/wp-admin/edit.php?page=listing-fields&tab=realtors
      What it should be:
      http://www.example.com/wp-admin/edit.php?post_type=listings&page=listing-fields&tab=realtors

      Without the “post_type=listings” bit, you get a “You do not have sufficient permissions to access this page.” message when clicking on the tab links at the top of your settings pages.

    • #258
      Jason Lane
      Member

      Have you had a chance to try my jQuery Tabs modification? You should find that your tabs will work fine after the mod (by pure accident).

    • #259
      Steve
      Keymaster

      @jmcphail– Definitely a bug. We are working on a bunch of changes to settings this week. Will add this to the list.

    • #260
      Steve
      Keymaster

      @jmcphail– Fixed in v0.6.6… now available on WP.org!

    • #269
      James Mc
      Member

      Yes, this fixed it! Thank you.


      @jason_lane
      : Thank you again for posting that information. I am always interested in examples of how people do things. I think thats because I lack much imagination…

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