Replace global options with individual option check

This commit is contained in:
Brian Miyaji
2014-03-28 21:07:39 +11:00
parent 31ab02b3c1
commit cdab219f41
11 changed files with 8 additions and 31 deletions

View File

@@ -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

View File

@@ -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;

View File

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