Last active
May 19, 2019 18:30
-
-
Save Asikur22/3e1cd561b4aa97d4c2ace24a988e438e to your computer and use it in GitHub Desktop.
Enqueue Scripts/Styles on the post-new.php and post.php pages in admin #SpecificPage
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
| add_action( 'admin_print_scripts-post-new.php', 'your_prefix_enqueue_scripts' ); | |
| add_action( 'admin_print_scripts-post.php', 'your_prefix_enqueue_scripts' ); | |
| // OR | |
| function enqueue_my_scripts() { | |
| global $pagenow; | |
| if ( ! empty( $pagenow ) && ( 'post-new.php' === $pagenow || 'post.php' === $pagenow ) ) { | |
| wp_enqueue_script(); | |
| } | |
| } | |
| add_action( 'admin_enqueue_scripts', 'enqueue_my_scripts' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment