Created
October 11, 2021 04:27
-
-
Save encoderit-arman/a29967c779caae7065f51b99a66498c3 to your computer and use it in GitHub Desktop.
Enqueue Scripts / Styles when shortcode is present
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
| global $post; | |
| if (is_a($post, 'WP_Post') && has_shortcode($post->post_content, 'd-calendar')) { | |
| wp_enqueue_script('jquery'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment