Last active
December 18, 2015 09:09
-
-
Save apatton-cnet/5759832 to your computer and use it in GitHub Desktop.
enqueue admin stylesheet on wordpress backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ebs_seo_cp_admin_init() { | |
wp_register_style('ebs_seo_cp_admin_stylesheet', plugins_url('admin-stylesheet.css', __FILE__)); | |
} | |
add_action( 'admin_init', 'ebs_seo_cp_admin_init' ); | |
function ebs_seo_cp_admin_enqueue($hook) { | |
$pages_array = array( | |
'ebs_seo_cp_menu', | |
'ebs_seo_cp_menu_view_options', | |
'ebs_seo_cp_menu_contact_options', | |
'ebs_seo_cp_menu_business_options', | |
'ebs_seo_cp_menu_google_maps_options', | |
'ebs_seo_cp_menu_social_media_options' | |
); | |
if (is_admin() && in_array($_GET['page'], $pages_array)) { | |
wp_enqueue_style('ebs_seo_cp_admin_stylesheet'); | |
} | |
} | |
add_action('admin_enqueue_scripts', 'ebs_seo_cp_admin_enqueue'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment