i have an error message whe i tring to set the page in custom url
can anybody to tell that any action or hook to set the page or function. here is my code
<a href='<?php echo admin_url("admin.php?page=wp_crm_asign&user_id={$user_id}"); ?>'>Asign to Consultant</a>
add_action( 'admin_init', 'wp_crm_asign_admin_init' );
function wp_crm_asign_admin_init() {
if ($_GET['page'] == 'wp_crm_asign') {
echo "hello";
}
}
Can Anybody to tell the right way to do this.
thanks
You will have to create sub menu page with parent slug
null
, check hereadd_submenu_page(null,$page_title,$menu_title,8,'wp_crm_asign','wp_crm_asign_admin_init');
Remove the
admin_init
hook and the function will automatically be called through this menu.click Here to check the wordpress function.