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?
- How to add a new plugin page under desired Options page?
- 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
- product-attribute-slug-is-too-long-28-characters-max
- 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
- Add multiple shipping rates from add_rate function with custom ID
- 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 to check if Woocommerce Order number equals to post ID?
- How do I add custom column to woocommerce cart?
- How plugins_loaded works?
- 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
- Global State During an Admin Post
- Woocommerce checkout update totals with datepicker
- Sub Menu content is being duplicated
- Strange issue saving custom field data for a WooCommerce order
- PHP – Extend WordPress Woocommerce Revenue Analytics with custom field
- Woocommerce – Convert Delivery method into a custom field
- Set different custom menu items for different user roles
- 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?
- In woocommerce cart item we can add custom text but how can i add custom link? [closed]
- Updating Woocommerce Settings API when WordPress Settings API saved and vise versa
- 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
- Woocommerce Composite Products – Add a composite product to cart programmatically via ajax [closed]
- Add a page in admin without adding menu item
- Silently register plugin pages
- Woocommerce order empty items array
- WordPress theme options Menu
- How to get all product in the woo-commerce? [closed]
- Unable to get a simple plugin admin page to work
- Can woocommerse be used dynamically for billing from another plugin for payment processing?
- Sending an SMS on new order placed – WooCommerce
- Can we use a library under MIT license in a WooCommerce plugin?
- Set _regular_price 0 if empty in woocommerce product
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- Woocommerce – Provide Associated Category Link for Product List Plugin [closed]
- Disable Auto-Expanding Menu in WordPress Admin Menus
- Use options to control jQuery plugin
- Proper way to create an administration page without adding it to the menu
- Pause plugin option page until all data manipulation is complete
- Remove Products From Category
- want to show CMB2 metabox on woocommerce product data tab
- Dynamic page generation upon purchase of a product
- Customise Grouped Product display in Woocommerce with custom column
- Create Woocommerce product without creating api credentials
- Add custom product data using javascript when add to cart button is clicked
- Trying to run a Ajax request from a checkout form in woocommerce via a custom plugin
- Securing custom rest API endpoints with public access from PWA
- WooCommerce – Stop assigning order numbers
- Adding customs fields on each product on the cart
- Override woocommerce loop-start.php from theme using plugin?
- How to direct WordPress to load custom template for custom post type
- Redirect WooCommerce checkout to cart
- WC REST API Error Handling
- Pre-populated WooCommerce checkout fields: dropdown fields issue
- How to remove the WooCommerce Product->Category thumbnail from admin [closed]
- woocommerce wc_get_product is not fetching all the product of particular category
- Override WooCommerce files from plugin
- woocommerce add a new bulk action in the bulk actions dropdown in the orders list
- How to trigger WooCommerce user profile edit change?
- Override theme’s WooCommerce file
- WC_Geolocation not found inside plugin
- How to use functions from Woocommerce documentation?
- how to retrieve post_id under woocommerce_add_to_cart_validation hook?
- Woocommerce Custom Checkout
- How put the correct URL to sub-menu plugin?
- Woo-commerce: Adding additional page sections using a child theme
- Declaring a new woo commerce product type i get this error
- woocommerce single product page hook not working
- Add a description/hint field in the admin page of a plugin
- Forcing ALL plugin Admin menus into a separate menu
- Change Admin menu placement using hooks
- Menu_slug used for creating options page
- How to remove city field from order in dashboard?
- Woocommerce: block user removing cart item
- Return custom product in ajax call loop
- WooCommerce adds a newline symbol (\n) between email recipients
- Show Admin Menu
- Allow HTML in product attributes and variation for WooCommerce
- How do I add multiple custom menu Woo-commerce my account page?
- High-Performance Order Storage conflict action `manage_shop_order_posts_custom_column`