Skip to content

Instantly share code, notes, and snippets.

@hayskytech
Created September 11, 2022 02:45
Show Gist options
  • Save hayskytech/8d9bfa423b9af8d6b9bc2a35fcdd5fac to your computer and use it in GitHub Desktop.
Save hayskytech/8d9bfa423b9af8d6b9bc2a35fcdd5fac to your computer and use it in GitHub Desktop.
<?php
add_action( 'wp_enqueue_scripts',function(){
global $post;
if( is_a( $post, 'WP_Post' ) && has_shortcode( $post->post_content, 'mathematics_exam') ) {
wp_enqueue_script( 'jquery');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment