diff --git a/includes/admin/importers/class-sp-event-importer.php b/includes/admin/importers/class-sp-event-importer.php index 37a027c7..a08f772a 100644 --- a/includes/admin/importers/class-sp-event-importer.php +++ b/includes/admin/importers/class-sp-event-importer.php @@ -95,7 +95,7 @@ if ( class_exists( 'WP_Importer' ) ) { * @return void */ function import( $file ) { - global $wpdb, $sportspress_options; + global $wpdb; $this->imported = $this->skipped = 0; @@ -311,7 +311,7 @@ if ( class_exists( 'WP_Importer' ) ) { // Add delimiter if event name is set if ( $title ): - $title .= ' ' . sp_array_value( $sportspress_options, 'event_teams_delimiter', 'vs' ) . ' '; + $title .= ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' '; endif; // Append team name to event name diff --git a/includes/admin/post-types/class-sp-admin-cpt-event.php b/includes/admin/post-types/class-sp-admin-cpt-event.php index 3458cacb..4ccca680 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-event.php +++ b/includes/admin/post-types/class-sp-admin-cpt-event.php @@ -65,8 +65,6 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT { * @return array */ public function wp_insert_post_data( $data, $postarr ) { - global $sportspress_options; - if ( $data['post_type'] == 'sp_event' && $data['post_title'] == '' ): $teams = sp_array_value( $postarr, 'sp_team', array() ); @@ -76,7 +74,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT { $team_names[] = get_the_title( $team ); endforeach; - $data['post_title'] = implode( ' ' . sp_array_value( $sportspress_options, 'event_teams_delimiter', 'vs' ) . ' ', $team_names ); + $data['post_title'] = implode( ' ' . get_option( 'sportspress_event_teams_delimiter', 'vs' ) . ' ', $team_names ); endif; diff --git a/includes/admin/post-types/class-sp-admin-cpt-player.php b/includes/admin/post-types/class-sp-admin-cpt-player.php index 0e039ddf..0d89f8b8 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-player.php +++ b/includes/admin/post-types/class-sp-admin-cpt-player.php @@ -88,8 +88,7 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT { echo '—'; else: $results = get_post_meta( $post_id, 'sp_results', true ); - global $sportspress_options; - $main_result = sp_array_value( $sportspress_options, 'main_result', null ); + $main_result = get_option( 'sportspress_primary_result', null ); foreach( $teams as $team_id ): if ( ! $team_id ) continue; $team = get_post( $team_id ); diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 7d82f20d..b559a4f6 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -856,8 +856,7 @@ if ( !function_exists( 'sp_edit_calendar_table' ) ) { 0 ): - global $sportspress_options; - $main_result = sp_array_value( $sportspress_options, 'main_result', null ); + $main_result = get_option( 'sportspress_primary_result', null ); $i = 0; foreach ( $data as $event ): $teams = get_post_meta( $event->ID, 'sp_team' ); @@ -941,8 +940,7 @@ if ( !function_exists( 'sp_edit_league_table' ) ) { function sp_edit_league_table( $columns = array(), $usecolumns = null, $data = array(), $placeholders = array() ) { if ( is_array( $usecolumns ) ) $usecolumns = array_filter( $usecolumns ); - global $sportspress_options; - $show_team_logo = sp_array_value( $sportspress_options, 'league_table_show_team_logo', false ); + $show_team_logo = get_option( 'sportspress_table_show_logos', false ); ?>
diff --git a/includes/sp-template-hooks.php b/includes/sp-template-hooks.php index 6512189c..d0b2f1f4 100644 --- a/includes/sp-template-hooks.php +++ b/includes/sp-template-hooks.php @@ -129,7 +129,7 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) { if ( $domain != 'sportspress' ) return $translated_text; - global $typenow, $sportspress_options; + global $typenow; if ( is_admin() ): if ( in_array( $typenow, array( 'sp_event', 'sp_team', 'sp_player', 'sp_staff' ) ) ): @@ -155,13 +155,6 @@ function sportspress_gettext( $translated_text, $untranslated_text, $domain ) { $translated_text = $venue->name; endif; endif; - if ( isset( $sportspress_options['text'] ) ): - foreach( $sportspress_options['text'] as $key => $value ): - if ( $translated_text == $key ): - $translated_text = $value; - endif; - endforeach; - endif; endif; return $translated_text; diff --git a/templates/event-list.php b/templates/event-list.php index 0af0ba77..804a75ec 100644 --- a/templates/event-list.php +++ b/templates/event-list.php @@ -1,6 +1,5 @@ -1, diff --git a/templates/event-performance.php b/templates/event-performance.php index 1f69729f..2563d5c7 100644 --- a/templates/event-performance.php +++ b/templates/event-performance.php @@ -1,6 +1,4 @@ get_the_ID(), 'number' => -1, diff --git a/templates/player-gallery.php b/templates/player-gallery.php index 0abf995c..b1aa9923 100644 --- a/templates/player-gallery.php +++ b/templates/player-gallery.php @@ -1,6 +1,4 @@ get_the_ID(), 'number' => -1, diff --git a/templates/player-list.php b/templates/player-list.php index 00ef2240..12fbf0ab 100644 --- a/templates/player-list.php +++ b/templates/player-list.php @@ -1,6 +1,4 @@ get_the_ID(), 'number' => -1, diff --git a/templates/player-metrics.php b/templates/player-metrics.php index f8532ccc..8fc9ba6d 100644 --- a/templates/player-metrics.php +++ b/templates/player-metrics.php @@ -2,8 +2,6 @@ if ( ! isset( $id ) ) $id = get_the_ID(); -global $sportspress_options; - $defaults = array( 'show_nationality_flag' => get_option( 'sportspress_player_show_flag', 'yes' ) == 'yes' ? true : false, );