I have this bit of code in my Meteor Slides plugin that loads a stylesheet on the admin pages of just the slides custom post type:
add_action('admin_head', 'meteorslides_admin_css');
function meteorslides_admin_css() {
global $post_type;
if (($_GET['post_type'] == 'slide') || ($post_type == 'slide')) :
echo "<link type='text/css' rel='stylesheet' href='" . plugins_url('/css/meteor-slides-admin.css', __FILE__) . "' />";
endif;
}
This code works fine and hasn't cause any issues, but in debug mode, it does cause this error that I'd like to resolve:
// Notice: Undefined index: post_type in C:\Program Files\xampp\htdocs\slides\wp-content\plugins\meteor-slides-1.3\meteor-slides-plugin.php on line 476
I haven't been able to fix this error, does anyone have any suggestions, or a different way to add a stylesheet to the admin pages of a certain post type?