Viewing 2 reply threads
  • Author
    Posts
    • #2382
      Jason
      Keymaster

      I’m dealing with a settings page that has multiple tabs. On one tab I’m verifying some credentials that the user’s provided. I only want to test the credentials (using piklist_pre_update_option) when I’m on that specific tab. I’m familiar with get_current_screen, but I don’t think it provides an id that includes the tab=? parameter.

      What’s the best way to check for this?

    • #2393
      Marcus
      Member

      I’ve experienced this one before, I had to use the GET variables for this, as the tabs are kept in the query string.
      &flow=edit_demo&flow_page=lists

      Then to get the flow type you could use:
      $flow = filter_input( INPUT_GET, 'flow', FILTER_SANITIZE_STRING );

      and the tab from:
      $tab = filter_input( INPUT_GET, 'flow_page', FILTER_SANITIZE_STRING );

      That should work.

      Marcus

    • #2396
      Jason
      Keymaster

      Nice! I ended up using an isset on the $new parameter to check if a specific field exists on the page, and return $settings if not, but that’s great to know!

      Thanks Marcus!

Viewing 2 reply threads
  • The topic ‘Determining the settings tab’ is closed to new replies.