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:
- Passing arguments to a admin menu page callback?
- 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?
- 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
- Overwriting Core WordPress Functions with Plugins
- How to iterate through custom posts and add the title to an array
- Naming Admin Menus and Submenus
- Current class on admin menu using add_submenu_page()
- product-attribute-slug-is-too-long-28-characters-max
- Add Admin Menu Inside Construct or Init
- get all products of one category
- Hook event for upload image in the menu
- 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?
- add_menu_page() with function inside a class [duplicate]
- 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
- Plugin with specific admin menu icon
- Add multiple shipping rates from add_rate function with custom ID
- set_sale_price in WooCommerce [closed]
- Woocommerce – Hide a Column in Cart Table
- Print value of an array or variable in a payment plugin
- How to get orders with used coupon in WooCommerce
- How to update total price of completed order in woocommerce? [closed]
- 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 change the initial quantity of a product in woocommerce?
- Order properties should not be accessed directly
- 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
- Show special field when correct shipping is chosen
- update woocommere total value on checkout based on selected payment method
- how to add custom functionality after woocommerce place order button
- WooCommerce Admin Reports : Get custom product report based on date range
- Global State During an Admin Post
- Adding a brand column to WooCommerce Products
- Woocommerce checkout update totals with datepicker
- Howto: Use Custom Post Types as Submenu Items in Admin
- 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
- 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?
- Show disclaimer with accept button before redirecting to the payment gateway website
- How do I apply a custom discount to individual product total prices depending on their categories on the cart and checkout pages of WooCommerce? [closed]
- 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
- Can’t get woocommerce_get_price_html to work [closed]
- is it recommended to use WP_List_Table?
- How to restrict access to image folder depending on whether product is purchased or not?
- Plugin sub-menu pages recommended structure and links
- How to extend WooCommerce API to show bookable product availability rules?
- Customize WooCommerce my account dashboard through plugin
- woocommerce_checkout_order_processed hook executing function twice
- Is there a way in which I can compare product id with the order id to display content on front end before placing the order? [closed]
- Woocommerce Composite Products – Add a composite product to cart programmatically via ajax [closed]
- Creating Admin Plugin – Content of a page is displayed at global scope as well
- Add a page in admin without adding menu item
- Change WooCommerce Email Header using custom plugin
- UWooCommerce – add cart discount programmatically?
- Silently register plugin pages
- Remove an action by extending class and replacing it
- Woocommerce order empty items array
- WordPress theme options Menu
- Print Dashboard submenu name and filename
- How to get all product in the woo-commerce? [closed]
- 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`
- 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
- Sticky bar with filter button and product count
- Create a menu and a submenu
- Woocommerce Reviews tab not showing on single product page
- WordPress Cron Job not importing products
- WP_List_Table sortable column with WC_Order_Query doesn’t work
- Resending woo-commerce order emails from frontend
- adding an options menu that allows saving multiple sets of said options
- how to execute a function only when i send an order to trash [closed]
- Are woocommerce_thankyou hook and is_order_received_page() redundant? [closed]
- Weekly cron is either missing the schedule or triggered too many times on Fridays