Home / Admin / Add custom page to the vendor dashboard
Duplicate Snippet

Embed Snippet on Your Site

Add custom page to the vendor dashboard

Code Preview
php
<?php
// Hook into the navigation 
add_filter( 'wcv_pro_dashboard_urls', 'add_test_page_nav', 9 );
function add_test_page_nav( $pages ){ 
	$pages[ 'test_page' ] = array(
		'slug'    => 'test_page',
		'id'      => 'test_page',
		'label'   => __( 'Test Page', 'wcvendors-pro' ),
		'actions' => array(
			'edit'      => __( 'New', 'wcvendors-pro' ),
		),
	);
	return $pages;
}
// Create the custom page 
add_action( 'wcv_pro_dashboard_custom_page', 'add_test_page', 10, 4 );
function add_test_page( $object, $object_id, $template, $custom ){ 
	if ( 'test_page' === $object ){ 
		echo "<h1>New Test Page</h1>";
	}
} 

Comments

Add a Comment