Display sport and timezone selector for first time users
This commit is contained in:
@@ -161,7 +161,7 @@ class SP_Admin_Welcome {
|
|||||||
$sport = $_POST['sportspress_sport'];
|
$sport = $_POST['sportspress_sport'];
|
||||||
SP_Admin_Sports::apply_preset( $sport );
|
SP_Admin_Sports::apply_preset( $sport );
|
||||||
update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
|
update_option( 'sportspress_sport', $_POST['sportspress_sport'] );
|
||||||
update_option( '_sportspress_needs_welcome', 1 );
|
update_option( 'sportspress_installed', 1 );
|
||||||
?>
|
?>
|
||||||
<div id="message" class="updated sportspress-message">
|
<div id="message" class="updated sportspress-message">
|
||||||
<p><strong><?php _e( 'Your settings have been saved.', 'sportspress' ); ?></strong></p>
|
<p><strong><?php _e( 'Your settings have been saved.', 'sportspress' ); ?></strong></p>
|
||||||
@@ -173,7 +173,7 @@ class SP_Admin_Welcome {
|
|||||||
SP_Admin_Sample_Data::insert_posts();
|
SP_Admin_Sample_Data::insert_posts();
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<?php if ( false !== get_option( 'sportspress_sport' ) ) { ?>
|
<?php if ( get_option( 'sportspress_installed' ) ) { ?>
|
||||||
|
|
||||||
<div class="headline-feature feature-video sp-fitvids" style="background-color:#191E23;">
|
<div class="headline-feature feature-video sp-fitvids" style="background-color:#191E23;">
|
||||||
<iframe width="990" height="557" src="https://www.youtube.com/embed/KQyga_C5a6M?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
|
<iframe width="990" height="557" src="https://www.youtube.com/embed/KQyga_C5a6M?rel=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ class SP_Install {
|
|||||||
public function __construct() {
|
public function __construct() {
|
||||||
register_activation_hook( SP_PLUGIN_FILE, array( $this, 'install' ) );
|
register_activation_hook( SP_PLUGIN_FILE, array( $this, 'install' ) );
|
||||||
|
|
||||||
|
if ( defined( 'SP_PRO_PLUGIN_FILE' ) )
|
||||||
|
register_activation_hook( SP_PRO_PLUGIN_FILE, array( $this, 'install' ) );
|
||||||
|
|
||||||
add_action( 'admin_init', array( $this, 'install_actions' ) );
|
add_action( 'admin_init', array( $this, 'install_actions' ) );
|
||||||
add_action( 'admin_init', array( $this, 'check_version' ), 5 );
|
add_action( 'admin_init', array( $this, 'check_version' ), 5 );
|
||||||
add_action( 'in_plugin_update_message-sportspress/sportspress.php', array( $this, 'in_plugin_update_message' ) );
|
add_action( 'in_plugin_update_message-sportspress/sportspress.php', array( $this, 'in_plugin_update_message' ) );
|
||||||
@@ -94,11 +97,6 @@ class SP_Install {
|
|||||||
// Update version
|
// Update version
|
||||||
update_option( 'sportspress_version', SP()->version );
|
update_option( 'sportspress_version', SP()->version );
|
||||||
|
|
||||||
// Check if pages are needed
|
|
||||||
if ( ! get_option( 'sportspress_sport' ) ) {
|
|
||||||
update_option( '_sp_needs_welcome', 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flush rules after install
|
// Flush rules after install
|
||||||
flush_rewrite_rules();
|
flush_rewrite_rules();
|
||||||
|
|
||||||
@@ -134,15 +132,6 @@ class SP_Install {
|
|||||||
add_option( 'sportspress_frontend_css_text', '#222222' );
|
add_option( 'sportspress_frontend_css_text', '#222222' );
|
||||||
add_option( 'sportspress_frontend_css_heading', '#ffffff' );
|
add_option( 'sportspress_frontend_css_heading', '#ffffff' );
|
||||||
add_option( 'sportspress_frontend_css_link', '#00a69c' );
|
add_option( 'sportspress_frontend_css_link', '#00a69c' );
|
||||||
|
|
||||||
if ( ! get_option( 'sportspress_installed' ) ) {
|
|
||||||
// Configure default sport
|
|
||||||
$sport = 'custom';
|
|
||||||
update_option( 'sportspress_sport', $sport );
|
|
||||||
|
|
||||||
// Flag as installed
|
|
||||||
update_option( 'sportspress_installed', 1 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user