Skip to content

Commit

Permalink
Make sure we load admin styling on the right pages
Browse files Browse the repository at this point in the history
Use Yoda conditions for MP6 testing
  • Loading branch information
sheabunge committed Mar 27, 2013
1 parent a3ed36a commit f1428da
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 5 additions & 2 deletions code-snippets.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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';
Expand Down
6 changes: 3 additions & 3 deletions includes/class-list-table.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit f1428da

Please sign in to comment.