Using this code from codex:
function my_enqueue($hook) {
if( 'edit.php' != $hook )
return;
wp_enqueue_script( 'my_custom_script', plugins_url('/myscript.js', __FILE__) );
}
add_action( 'admin_enqueue_scripts', 'my_enqueue' );
this will add a custom stylesheet into wp-admin on the edit page, how can we change this so that we can use a slug from a custom admin options page which has submenus, is there a way we can use the parent menu item slug?
[b]EDIT[/b]:
This is how i have adapted the above code:
function auctionwp_custom_admin_style($hook) {
if( 'edit.php' != $hook )
return;
wp_enqueue_style( 'my_custom_script', get_bloginfo( 'stylesheet_directory' ) . '/css/custom_style.css', false, '1.0.0' );
}
add_action( 'admin_enqueue_scripts', 'auctionwp_custom_admin_style' );
what im now trying to do is change the if statement to use parent menu slug rather than edit.php
thanks