I’ve figured it out how to do it on my custom admin page.
You can use default wordpress classes and get variable trickery like so:
<?php
if( isset( $_GET[ 'tab' ] ) ) {
$active_tab = $_GET[ 'tab' ];
} // end if
?>
<h2 class="nav-tab-wrapper">
<a href="https://wordpress.stackexchange.com/questions/350785/?page=sandbox_theme_options&tab=display_options" class="nav-tab <?php echo $active_tab == 'display_options' ? 'nav-tab-active' : ''; ?>">Display Options</a>
<a href="?page=sandbox_theme_options&tab=social_options" class="nav-tab <?php echo $active_tab == 'social_options' ? 'nav-tab-active' : ''; ?>">Social Options</a>
</h2>
And then wrap everything else in if($active_tab == 'desired_option'){} statements.
Related Posts:
- Admin settings update updating every time home page is hit?
- What’s the best method for emptying an option created with the Settings API?
- What is the recommended way to create plugin administration forms?
- Is it possible to add an admin page using add_submenu_page() and pass a var in the query string?
- WooCommerce get Shipping Class of product from either the product id or the order after order is completed
- Naming Admin Menus and Submenus
- Add Admin Menu Inside Construct or Init
- get all products of one category
- Menu Error in Admin Console with Custom Plugin: You do not have sufficient permissions to access this page
- Woocommerce add custom button to backend order table
- Plugin vs Settings load order (woocommerce dependency)
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- How to add Font Awesome 5 icons in WP Admin dashboard menu?
- How to put placeholder text in the main post input area?
- Unified Approach for Placing Option Pages
- Print value of an array or variable in a payment plugin
- Plugin development: get_post_meta is not working [closed]
- OOP Plugin and Menu – Call to undefined function register_setting()
- $wpdb -> Batch insert from XML File?
- How do I add custom column to woocommerce cart?
- WooCommerce Conditional Tag inside plugin
- Custom attribute type not displaying terms in edit product – WooCommerce
- WooCommerce registration password field not displaying
- update woocommere total value on checkout based on selected payment method
- how to add custom functionality after woocommerce place order button
- Adding a brand column to WooCommerce Products
- Howto: Use Custom Post Types as Submenu Items in Admin
- Sub Menu content is being duplicated
- PHP – Extend WordPress Woocommerce Revenue Analytics with custom field
- Set different custom menu items for different user roles
- Show/Hide ‘add new user’ custom fields in wordpress admin panel by click another field
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- Woocommerce extend tax report with custom column
- How can we display product price $104 on the cart while the credit card payment method is checked?
- Bootstrap doesn’t work on admin menu page-How to override wp-admin style?
- is it recommended to use WP_List_Table?
- How to extend WooCommerce API to show bookable product availability rules?
- Customize WooCommerce my account dashboard through plugin
- Change WooCommerce Email Header using custom plugin
- UWooCommerce – add cart discount programmatically?
- Remove an action by extending class and replacing it
- WordPress theme options Menu
- Print Dashboard submenu name and filename
- I am trying to make a page in the admin section similar to the appearance of the Profile page for users
- Woocommerce inventory [closed]
- Unable to get a simple plugin admin page to work
- WooCommerce change Tax Class programmatically when Recalculating an existing Order [closed]
- How to change WooCommerce loop product title HTML output in single product page and archive page
- Set _regular_price 0 if empty in woocommerce product
- WooCommerce Endpoints content
- How remove trashed WooCommerce orders from wc_get_orders() result?
- Duplicate shipping method logic to another shipping method [closed]
- Custom Plugin Options Won’t Update
- Hide one specific woocoomerce product
- get_shipping_methods() return empty rate
- Disable Auto-Expanding Menu in WordPress Admin Menus
- in_array function Problem
- Restrict certain actions to plugin-specific admin menu pages only
- Proper way to create an administration page without adding it to the menu
- How to add text editor in plugin menu?
- How to make an admin plugin menu page go full screen?
- wp_schedule_single_event is set correctly but sometimes not fired
- Change reminder email date to 14 days before
- Make a php array load faster
- How to make every image title equal to alt text(wordpress/woocommerce)?
- Pass Values in URL on WooCommerce Product Page
- Woocommerce place order update shipping price
- product-attribute-slug-is-too-long-28-characters-max
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- How do I add filter with woocommerce categories?
- Getting products information, in woocommerce based on products ID
- PHPUnit Testing and woocommerce Constant
- Woocommerce Product finder feature on home page
- want to confirm popup with “Yes” and “No” button when user click on add to cart
- How to add admin.php to WP Admin Menu Link
- Woocommerce Single Product Tabs Got Duplicate
- Woocommerce product not appearing in category list page when created programatically [closed]
- Override WooCommerce files from plugin
- WordPress Reset password Strength set to medium
- external Integration with wordpress timeout error
- Handle changed Woocommerce function
- Making Woocommerce optimized for more than 500k products
- Convert each new line in the textfield as a new value in an array
- How put the correct URL to sub-menu plugin?
- Developing a plugin where users can edit entries saved in database
- WP: adding Javascript to specific woo commerce pages
- Link to a admin submenu item using a custom link
- Plugin admin list pages as submenu
- How to only Load scripts on variable products page
- how do I find out if a placed order was deleted or trashed? [closed]
- What is the meta_query key name for the woo product average rating? [closed]
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Show Admin Menu
- I want to redirect user to an amazon product page from my wordpress website when they add product to there cart [closed]
- Custom fields in the billing address section woocommerce
- how to works woocommerce cart hash
- Add File field in WooCommerce Box office plugin
- Woocommerce Payment Plugin with Mycred being the payment processor
- Resending woo-commerce order emails from frontend
- Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]