Add option to insert sample data during install

This commit is contained in:
Brian Miyaji
2014-10-19 01:06:30 +11:00
parent da2a778343
commit 779c84054f
6 changed files with 87 additions and 278 deletions

View File

@@ -49,7 +49,7 @@ class SP_Settings_General extends SP_Settings_Page {
'title' => __( 'Sport', 'sportspress' ),
'id' => 'sportspress_sport',
'default' => 'custom',
'type' => 'groupselect',
'type' => 'sport',
'options' => $presets,
),
@@ -184,6 +184,10 @@ class SP_Settings_General extends SP_Settings_Page {
update_option( '_sp_needs_welcome', 0 );
endif;
if ( isset( $_POST['add_sample_data'] ) ):
SP_Admin_Sample_Data::insert_posts();
endif;
$settings = $this->get_settings();
SP_Admin_Settings::save_fields( $settings );