Created
June 18, 2014 11:55
-
-
Save cheh/4f426ca863e0f001b3c3 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
function custom_shortcode_scripts() { | |
global $post; | |
if( has_shortcode( $post->post_content, 'custom-shortcode') ) { | |
wp_enqueue_script( 'custom-script'); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'custom_shortcode_scripts'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment