Skip to content

Instantly share code, notes, and snippets.

@mfields
Created August 31, 2011 21:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mfields/1184759 to your computer and use it in GitHub Desktop.
Save mfields/1184759 to your computer and use it in GitHub Desktop.
Enqueue css for a custom post_type in edit.php
<?php
add_action( 'load-edit.php', 'myplugin_setup_edit_screen' );
function myplugin_setup_edit_screen() {
$screen = get_current_screen();
if ( 'my_post_type' != $screen->post_type ) {
return;
}
add_action( 'admin_print_styles', 'myplugin_edit_screen_css' );
}
function myplugin_edit_screen_css() {
wp_enqueue_style( 'myplugin_edit_screen' );
}
@milojennings
Copy link

Most excellent. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment