Add a Custom Dashboard Page

You may want to add your own custom page and content to the agent dashboard. To do that, you can add the following PHP code snippet to your site:

add_action('salesking_extend_menu', function($menu){
	?>
	<li class="nk-menu-item">
		<a href="<?php echo esc_attr(trailingslashit(get_page_link(apply_filters( 'wpml_object_id', get_option( 'salesking_agents_page_setting', 'disabled' ), 'post' , true)))).'newpage';?>" class="nk-menu-link">
			<span class="nk-menu-icon"><em class="icon ni ni-navigate-fill"></em></span>
			<span class="nk-menu-text"><?php echo 'New Page!';?></span>
		</a>
	</li><!-- .nk-menu-item -->
	<?php
}, 10, 1);

add_action('salesking_extend_page', function($page){
	
	if ($page === 'newpage'){
		?>
		<div class="nk-content salesking_products_page">
			<div class="container-fluid">
				<div class="nk-content-inner">
					<div class="nk-content-body">
						<div class="nk-block-head nk-block-head-sm">
							<div class="nk-block-between">
								<div class="nk-block-head-content">
									<h3 class="nk-block-title page-title"><?php esc_html_e('New Page!','salesking'); ?></h3>
								</div><!-- .nk-block-head-content -->
							</div>
						</div>
						<div>
							New content here!
						</div>
					</div>
				</div>
			</div>
		</div>
		<?php
	}
});

In the code above, you can directly change the title and content of the page. To change the page icon, replace "ni-navigate-fill" with "ni-" followed by the name of your icon (choose an icon from this list).

This code can be added to the functions.php file of your child theme or by using any code snippets plugin.

The result will be a new page like the one shown below:

Powered by BetterDocs