Home / Admin / Add Custom Settings Tab to Vendor Dashboard
Duplicate Snippet

Embed Snippet on Your Site

Add Custom Settings Tab to Vendor Dashboard

Code Preview
php
<?php
//  Add the tab to the tab nav
add_filter( 'wcv_store_tabs', 'add_custom_tab_nav' );
function add_custom_tab_nav( $tabs ){ 
	// Target is the custom css id for the content tab in the code below this
	$tabs['custom_tab'] = array( 
		'label'  => __( 'Custom', 'wcvendors-pro' ),
		'target' => 'custom-tab',
		'class'  => array(),
	); 
	return $tabs;
}
/**
 * Add the tab contents after one of the store tabs choose the tab you want this after 
 * 
 * Available actions are : 
 * 
 * wcvendors_settings_after_store_tab
 * wcvendors_settings_after_payment_tab
 * wcvendors_settings_after_branding_tab
 * wcvendors_settings_after_shipping_tab
 * wcvendors_settings_after_social_tab
 * wcvendors_settings_after_policies_tab
 * wcvendors_settings_after_seo_tab
 *  
 */
add_action( 'wcvendors_settings_after_seo_tab', 'custom_tab_content_after_shipping' ); 
function custom_tab_content_after_shipping(){ 
?>
	<div class="tabs-content" id="custom-tab">
	<h1>My custom settings tab</h1>
	<p> form elements go here</p>
	</div>
<?php 
}

Comments

Add a Comment