Fix activation warnings
This commit is contained in:
@@ -40,6 +40,12 @@ class SP_Settings_Config extends SP_Settings_Page {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function get_settings() {
|
public function get_settings() {
|
||||||
|
$sports = sp_get_sport_options();
|
||||||
|
$sport_options = array();
|
||||||
|
foreach ( $sports as $slug => $data ):
|
||||||
|
$sport_options[ $slug ] = $data['name'];
|
||||||
|
endforeach;
|
||||||
|
|
||||||
return apply_filters('sportspress_event_settings', array(
|
return apply_filters('sportspress_event_settings', array(
|
||||||
|
|
||||||
array( 'title' => __( 'Configure SportsPress', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'config_options' ),
|
array( 'title' => __( 'Configure SportsPress', 'sportspress' ), 'type' => 'title','desc' => '', 'id' => 'config_options' ),
|
||||||
@@ -49,7 +55,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
|||||||
'id' => 'sportspress_sport',
|
'id' => 'sportspress_sport',
|
||||||
'default' => 'soccer',
|
'default' => 'soccer',
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'options' => SP()->sports->options,
|
'options' => $sport_options,
|
||||||
),
|
),
|
||||||
|
|
||||||
array( 'type' => 'results' ),
|
array( 'type' => 'results' ),
|
||||||
@@ -73,12 +79,6 @@ class SP_Settings_Config extends SP_Settings_Page {
|
|||||||
* Save settings
|
* Save settings
|
||||||
*/
|
*/
|
||||||
public function save() {
|
public function save() {
|
||||||
$settings = $this->get_settings();
|
|
||||||
SP_Admin_Settings::save_fields( $settings );
|
|
||||||
|
|
||||||
if ( isset( $_POST['sportspress_primary_result'] ) )
|
|
||||||
update_option( 'sportspress_primary_result', $_POST['sportspress_primary_result'] );
|
|
||||||
|
|
||||||
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
if ( isset( $_POST['sportspress_sport'] ) && ! empty( $_POST['sportspress_sport'] ) && get_option( 'sportspress_sport', null ) != $_POST['sportspress_sport'] ):
|
||||||
|
|
||||||
$sport = SP()->sports->$_POST['sportspress_sport'];
|
$sport = SP()->sports->$_POST['sportspress_sport'];
|
||||||
@@ -162,7 +162,13 @@ class SP_Settings_Config extends SP_Settings_Page {
|
|||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
endforeach;
|
endforeach;
|
||||||
|
update_option( 'sportspress_primary_result', 0 );
|
||||||
|
elseif ( isset( $_POST['sportspress_primary_result'] ) ):
|
||||||
|
update_option( 'sportspress_primary_result', $_POST['sportspress_primary_result'] );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
$settings = $this->get_settings();
|
||||||
|
SP_Admin_Settings::save_fields( $settings );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -86,7 +86,9 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ( SP()->text->event as $key => $value ):
|
$strings = sp_get_text_options();
|
||||||
|
|
||||||
|
foreach ( sp_array_value( $strings, 'event', array() ) as $key => $value ):
|
||||||
$settings[] = array(
|
$settings[] = array(
|
||||||
'title' => $value,
|
'title' => $value,
|
||||||
'id' => 'sportspress_event_' . $key . '_text',
|
'id' => 'sportspress_event_' . $key . '_text',
|
||||||
|
|||||||
@@ -91,7 +91,9 @@ class SP_Settings_General extends SP_Settings_Page {
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ( SP()->text->general as $key => $value ):
|
$strings = sp_get_text_options();
|
||||||
|
|
||||||
|
foreach ( sp_array_value( $strings, 'general', array() ) as $key => $value ):
|
||||||
$settings[] = array(
|
$settings[] = array(
|
||||||
'title' => $value,
|
'title' => $value,
|
||||||
'id' => 'sportspress_' . $key . '_text',
|
'id' => 'sportspress_' . $key . '_text',
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ( SP()->text->player as $key => $value ):
|
$strings = sp_get_text_options();
|
||||||
|
|
||||||
|
foreach ( sp_array_value( $strings, 'player', array() ) as $key => $value ):
|
||||||
$settings[] = array(
|
$settings[] = array(
|
||||||
'title' => $value,
|
'title' => $value,
|
||||||
'id' => 'sportspress_player_' . $key . '_text',
|
'id' => 'sportspress_player_' . $key . '_text',
|
||||||
|
|||||||
@@ -63,7 +63,9 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach ( SP()->text->team as $key => $value ):
|
$strings = sp_get_text_options();
|
||||||
|
|
||||||
|
foreach ( sp_array_value( $strings, 'team', array() ) as $key => $value ):
|
||||||
$settings[] = array(
|
$settings[] = array(
|
||||||
'title' => $value,
|
'title' => $value,
|
||||||
'id' => 'sportspress_team_' . $key . '_text',
|
'id' => 'sportspress_team_' . $key . '_text',
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -22,48 +22,7 @@ class SP_Text {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct() {
|
public function __construct() {
|
||||||
$this->data = apply_filters( 'sportspress_text', array(
|
$this->data = sp_get_text_options();
|
||||||
'general' => array(
|
|
||||||
'league' => __( 'League', 'sportspress' ),
|
|
||||||
'season' => __( 'Season', 'sportspress' ),
|
|
||||||
),
|
|
||||||
'event' => array(
|
|
||||||
'event' => __( 'Event', 'sportspress' ),
|
|
||||||
'date' => __( 'Date', 'sportspress' ),
|
|
||||||
'time' => __( 'Time', 'sportspress' ),
|
|
||||||
'results' => __( 'Results', 'sportspress' ),
|
|
||||||
'team' => __( 'Team', 'sportspress' ),
|
|
||||||
'teams' => __( 'Teams', 'sportspress' ),
|
|
||||||
'details' => __( 'Details', 'sportspress' ),
|
|
||||||
'venue' => __( 'Venue', 'sportspress' ),
|
|
||||||
'player' => __( 'Player', 'sportspress' ),
|
|
||||||
'substitutes' => __( 'Substitutes', 'sportspress' ),
|
|
||||||
'total' => __( 'Total', 'sportspress' ),
|
|
||||||
'article' => __( 'Article', 'sportspress' ),
|
|
||||||
'preview' => __( 'Preview', 'sportspress' ),
|
|
||||||
'recap' => __( 'Recap', 'sportspress' ),
|
|
||||||
'view_all_events' => __( 'View all events', 'sportspress' ),
|
|
||||||
),
|
|
||||||
'team' => array(
|
|
||||||
'team' => __( 'Team', 'sportspress' ),
|
|
||||||
'teams' => __( 'Teams', 'sportspress' ),
|
|
||||||
'pos' => __( 'Pos', 'sportspress' ),
|
|
||||||
'view_full_table' => __( 'View full table', 'sportspress' ),
|
|
||||||
),
|
|
||||||
'player' => array(
|
|
||||||
'player' => __( 'Player', 'sportspress' ),
|
|
||||||
'position' => __( 'Position', 'sportspress' ),
|
|
||||||
'nationality' => __( 'Nationality', 'sportspress' ),
|
|
||||||
'current_team' => __( 'Current Team', 'sportspress' ),
|
|
||||||
'past_teams' => __( 'Past Teams', 'sportspress' ),
|
|
||||||
'rank' => __( 'Rank', 'sportspress' ),
|
|
||||||
'played' => __( 'Played', 'sportspress' ),
|
|
||||||
'view_all_players' => __( 'View all players', 'sportspress' ),
|
|
||||||
),
|
|
||||||
'staff' => array(
|
|
||||||
'staff' => __( 'Staff', 'sportspress' ),
|
|
||||||
),
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __get( $key ) {
|
public function __get( $key ) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user