Skip to content

Instantly share code, notes, and snippets.

@kellenmace
Last active April 24, 2019 02:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kellenmace/d56c3ad5cdd2821331ec to your computer and use it in GitHub Desktop.
Save kellenmace/d56c3ad5cdd2821331ec to your computer and use it in GitHub Desktop.
<?php
// Load admin scripts & styles
function km_load_admin_scripts( $hook ) {
// If the post we're editing isn't a project_summary type, exit this function.
if ( 'project_summary' !== get_post_type() ) {
return;
}
// If we're creating/updating the post, exit this function.
if ( $hook == 'post-new.php' || $hook == 'post.php' ) {
return;
}
// Enqueue JS.
wp_enqueue_script( 'admin_scripts', get_template_directory_uri() . 'assets/js/km_dashboard_admin.js', array( 'jquery' ) );
}
add_action( 'admin_enqueue_scripts', 'km_load_admin_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment