Viewing 5 reply threads
  • Author
    Posts
    • #7051
      cully
      Participant

      I have an admin page for some settings. The page has several tabs. The problem I’m having is that if there is a space in the tab name (e.g. General Test), then the tab name is output as General_test. I attached a screenshot of the result. I have the same issue on a number of different projects, but they all follow the same setup as below. Am I leaving something out, or is this a bug?

      My admin page setup looks like:

      
      add_filter('piklist_admin_pages', function ($pages) {
          $pages []= [
              'page_title' => 'Test Settings',
              'menu_title' => 'Test Settings',
              'capability' => 'manage_options',
              'menu_slug' => 'test_settings',
              'setting' => 'test_settings',
              'menu_icon' => WordPress::assetUrl("assets/images/icon-16x16.png"),
              'page_icon' => WordPress::assetUrl("assets/images/icon-32x32.png"),
              'single_line' => true,
              'default_tab' => 'General',
              'save_text' => 'Save Settings',
          ];
      
          return $pages;
      });
      

      I have a few tabs. The settings file headers look like:

      my_plugin/parts/settings/general.php:

      
      /*
      Title: General
      Tab: General Test
      Tab Order: 100
      Setting: test_settings
      Order: 20
      */
      

      my_plugin/parts/settings/sort.php:

      
      /*
      Title: Another
      Tab: Another Tab
      Tab Order: 300
      Setting: test_settings
      Order: 20
      */
      
      Attachments:
      You must be logged in to view attached files.
    • #7074
      Steve
      Keymaster

      @cully– This is odd. You’re the only one to report this. Can you please disable other plugins and see if any are interfering?

    • #7080
      cully
      Participant

      @Steve It happens when no other plugins are installed, and also with quite a few installed. The same thing happens in every project I’m using Piklist on. I don’t have a Workflow defined (I was under the impression I don’t need one for settings). Would that be a problem?

    • #7081
      Steve
      Keymaster

      @cully– If you want to use tabs, you need to setup a workflow.

    • #7099
      cully
      Participant

      Adding a Workflow fixed it. Seems strange that everything would basically work exactly the same before/after adding a Workflow, except for the tab names. Lots of extra overhead (creating all the workflow/tab files). Anyway, thanks for the great help!

    • #7117
      Steve
      Keymaster

      Glad you got it working!

Viewing 5 reply threads
  • The topic ‘Underscores in tab title, instead of spaces’ is closed to new replies.