Route existing users to welcome screen instead of setup

This commit is contained in:
Brian Miyaji
2017-03-13 12:48:13 +11:00
parent 681b784536
commit 332f2834d0
5 changed files with 123 additions and 194 deletions

View File

@@ -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' ) ) ) {