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 ); ?>