From 1e3e4d7e1032eb09c73f50475171c9c348bd3b3a Mon Sep 17 00:00:00 2001 From: Filip Ilic Date: Wed, 17 Dec 2025 13:10:55 +0100 Subject: [PATCH] enqueue only on "page edit" screen and for editors and admins --- classes/admin/class-editor.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/classes/admin/class-editor.php b/classes/admin/class-editor.php index 449bd4a2ae..dbbd84bdeb 100644 --- a/classes/admin/class-editor.php +++ b/classes/admin/class-editor.php @@ -34,6 +34,11 @@ public function enqueue_editor_script() { return; } + // Only load on Page edit screen and if the user can edit others posts. + if ( 'page' !== \get_post_type() || ! \current_user_can( 'edit_others_posts' ) ) { + return; + } + $page_types = \progress_planner()->get_page_types()->get_page_types(); // Check if the page-type is set in the URL (user is coming from the Settings page).