Created
June 23, 2015 04:10
-
-
Save kellenmace/d87182e26ccc297c5968 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| * Enqueue jQuery when adding/editing a Project Summary | |
| */ | |
| function rpt_enqueue_jquery_for_custom_post_type( $hook ){ | |
| global $post; | |
| // if the current post is not a "project_summary" post type, exit this function | |
| if ( 'project_summary' != $post->post_type ) { | |
| return; | |
| } | |
| // if we're not creating or editing the post, exit this function | |
| if( 'post.php' != $hook && 'edit.php' != $hook && 'post-new.php' != $hook) | |
| return; | |
| // otherwise, load jquery | |
| wp_enqueue_script('jquery'); | |
| } | |
| add_action( 'admin_enqueue_scripts', 'rpt_enqueue_jquery_for_custom_post_type' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment