Replace global options with individual option check
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -856,8 +856,7 @@ if ( !function_exists( 'sp_edit_calendar_table' ) ) {
|
||||
<tbody>
|
||||
<?php
|
||||
if ( is_array( $data ) && sizeof( $data ) > 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 );
|
||||
?>
|
||||
<div class="sp-data-table-container">
|
||||
<table class="widefat sp-data-table sp-league-table">
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<?php
|
||||
global $sportspress_options;
|
||||
$primary_result = sp_array_value( $sportspress_options, 'sportspress_primary_result', null );
|
||||
$primary_result = get_option( 'sportspress_primary_result', null );
|
||||
|
||||
$defaults = array(
|
||||
'number' => -1,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
global $sportspress_options;
|
||||
|
||||
if ( ! isset( $id ) )
|
||||
$id = get_the_ID();
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
global $sportspress_options;
|
||||
|
||||
$defaults = array(
|
||||
'id' => get_the_ID(),
|
||||
'number' => -1,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
global $sportspress_options;
|
||||
|
||||
$defaults = array(
|
||||
'id' => get_the_ID(),
|
||||
'number' => -1,
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
global $sportspress_options;
|
||||
|
||||
$defaults = array(
|
||||
'id' => get_the_ID(),
|
||||
'number' => -1,
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user