Display sport and timezone selector for first time users

This commit is contained in:
Brian Miyaji
2016-04-27 21:02:16 +10:00
parent 82472f78d1
commit 3befe925fc
2 changed files with 5 additions and 16 deletions

View File

@@ -161,7 +161,7 @@ class SP_Admin_Welcome {
$sport = $_POST['sportspress_sport'];
SP_Admin_Sports::apply_preset( $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">
<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();
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;">
<iframe width="990" height="557" src="https://www.youtube.com/embed/KQyga_C5a6M?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

View File

@@ -22,6 +22,9 @@ class SP_Install {
*/
public function __construct() {
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, 'check_version' ), 5 );
@@ -94,11 +97,6 @@ class SP_Install {
// Update 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_rewrite_rules();
@@ -134,15 +132,6 @@ class SP_Install {
add_option( 'sportspress_frontend_css_text', '#222222' );
add_option( 'sportspress_frontend_css_heading', '#ffffff' );
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 );
}
}
/**