Last active
August 29, 2015 14:21
-
-
Save derekshirk/8206930479da994ca84a to your computer and use it in GitHub Desktop.
WP-Conditional_post_type_admin_screens
This file contains 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
<?php | |
add_action( 'admin_enqueue_scripts', 'load_admin_custom_script' ); | |
function load_admin_custom_script() { | |
$current_screen = get_current_screen(); | |
if ( $current_screen->post_type === 'custom_post_type_name' ) { | |
$ss_url = get_bloginfo('stylesheet_directory'); | |
wp_enqueue_script('jquery'); | |
wp_enqueue_script('custom_js', '{$ss_url}/path-to-file/filename.js', array('jquery')); | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment