Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.