Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 68fa5ae

Browse files
author
Ryan Kienstra
committed
Issue #17 : In enqueuing, verify that $hook argument is 'post.php'.
1 parent d1487c8 commit 68fa5ae

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

php/class-customize-snapshot-manager.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -751,11 +751,13 @@ public function enqueue_frontend_scripts() {
751751
*
752752
* These files control the behavior and styling of links to remove settings.
753753
* Published snapshots can't be edited, so these files are not needed on those pages.
754+
*
755+
* @param String $hook Current page in admin.
754756
*/
755-
public function enqueue_admin_scripts() {
757+
public function enqueue_admin_scripts( $hook ) {
756758
global $post;
757759
$handle = 'customize-snapshots-admin';
758-
if ( isset( $post->post_type ) && ( Post_Type::SLUG === $post->post_type ) && ( 'publish' !== $post->post_status ) ) {
760+
if ( ( 'post.php' === $hook ) && isset( $post->post_type ) && ( Post_Type::SLUG === $post->post_type ) && ( 'publish' !== $post->post_status ) ) {
759761
wp_enqueue_script( $handle );
760762
wp_enqueue_style( $handle );
761763
}

0 commit comments

Comments
 (0)