diff --git a/code-snippets.php b/code-snippets.php index b8645f5a..4a07927e 100644 --- a/code-snippets.php +++ b/code-snippets.php @@ -661,7 +661,7 @@ function add_import_admin_menu() { */ function load_admin_icon_style() { - if ( get_user_option( 'admin_color' ) === 'mp6' ) { + if ( 'mp6' === get_user_option( 'admin_color' ) ) { wp_enqueue_style( 'icon-snippets', @@ -1277,7 +1277,10 @@ function load_admin_single() { * * @return void */ - function admin_single_enqueue_scripts() { + function admin_single_enqueue_scripts( $hook ) { + + if ( $hook !== $this->admin_single ) + return; /* CodeMirror package version */ $codemirror_version = '3.11'; diff --git a/includes/class-list-table.php b/includes/class-list-table.php index caafa80a..0f28c377 100644 --- a/includes/class-list-table.php +++ b/includes/class-list-table.php @@ -60,13 +60,13 @@ function __construct() { * * @return void */ - function load_table_style() { + function load_table_style( $hook ) { global $code_snippets; - if ( get_current_screen()->id != $code_snippets->admin_manage ) + if ( $hook !== $code_snippets->admin_manage ) return; - if ( get_user_option( 'admin_color' ) === 'mp6' ) { + if ( 'mp6' === get_user_option( 'admin_color' ) ) { wp_enqueue_style( 'snippets-table',