diff --git a/includes/admin/class-sp-admin-notices.php b/includes/admin/class-sp-admin-notices.php index 020a0ac3..826a2cc1 100644 --- a/includes/admin/class-sp-admin-notices.php +++ b/includes/admin/class-sp-admin-notices.php @@ -40,12 +40,14 @@ class SP_Admin_Notices { $screen = get_current_screen(); $notices = get_option( 'sportspress_admin_notices', array() ); - if ( ! get_option( 'sportspress_completed_setup' ) ) { + if ( ! is_object( $screen ) ) return; + + if ( ! get_option( 'sportspress_completed_setup' ) && ! in_array( $screen->id, array( 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) { wp_enqueue_style( 'sportspress-activation', plugins_url( '/assets/css/activation.css', SP_PLUGIN_FILE ) ); add_action( 'admin_notices', array( $this, 'setup_notice' ) ); } - if ( is_object( $screen ) && 'post' == $screen->base ) { + if ( 'post' == $screen->base ) { $post_id = get_the_ID(); if ( ! apply_filters( 'sportspress_user_can', current_user_can( 'edit_post', $post_id ), $post_id ) ) { add_action( 'admin_notices', array( $this, 'no_access_notice' ) ); @@ -62,7 +64,7 @@ class SP_Admin_Notices { update_option( 'sportspress_admin_notices', $notices ); } - if ( is_object( $screen ) && in_array( 'theme_support', $notices ) && ! current_theme_supports( 'sportspress' ) && ! in_array( $screen->id, array( 'toplevel_page_sportspress', 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) { + if ( in_array( 'theme_support', $notices ) && ! current_theme_supports( 'sportspress' ) && ! in_array( $screen->id, array( 'toplevel_page_sportspress', 'dashboard_page_sp-about', 'dashboard_page_sp-credits', 'dashboard_page_sp-translators' ) ) ) { $template = get_option( 'template' ); if ( ! in_array( $template, array( 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) { diff --git a/includes/admin/class-sp-admin-settings.php b/includes/admin/class-sp-admin-settings.php index 9263c446..6da7bfff 100644 --- a/includes/admin/class-sp-admin-settings.php +++ b/includes/admin/class-sp-admin-settings.php @@ -443,6 +443,8 @@ class SP_Admin_Settings { case 'sport' : $option_value = self::get_option( $value['id'], $value['default'] ); + if ( 'none' === $option_value ) $option_value = 'soccer'; + $categories = SP_Admin_Sports::sport_category_names(); ?>