Add option to insert sample data during install
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user