Replace deprecated functions
This commit is contained in:
@@ -38,7 +38,7 @@ class SP_Admin_Dashboard {
|
||||
* Show status widget
|
||||
*/
|
||||
public function status_widget() {
|
||||
$next_event = sportspress_get_next_event();
|
||||
$next_event = sp_get_next_event();
|
||||
$now = new DateTime( current_time( 'mysql', 0 ) );
|
||||
$date = new DateTime( $next_event->post_date );
|
||||
$interval = date_diff( $now, $date );
|
||||
|
||||
@@ -42,15 +42,15 @@ class SP_Admin_Menus {
|
||||
public function menu_highlight() {
|
||||
global $typenow;
|
||||
if ( in_array( $typenow, array( 'sp_result', 'sp_outcome', 'sp_column', 'sp_performance', 'sp_metric' ) ) )
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
elseif ( $typenow == 'sp_calendar' )
|
||||
sportspress_highlight_admin_menu( 'edit.php?post_type=sp_event', 'edit.php?post_type=sp_calendar' );
|
||||
sp_highlight_admin_menu( 'edit.php?post_type=sp_event', 'edit.php?post_type=sp_calendar' );
|
||||
elseif ( $typenow == 'sp_table' )
|
||||
sportspress_highlight_admin_menu( 'edit.php?post_type=sp_team', 'edit.php?post_type=sp_table' );
|
||||
sp_highlight_admin_menu( 'edit.php?post_type=sp_team', 'edit.php?post_type=sp_table' );
|
||||
elseif ( $typenow == 'sp_list' )
|
||||
sportspress_highlight_admin_menu( 'edit.php?post_type=sp_player', 'edit.php?post_type=sp_list' );
|
||||
sp_highlight_admin_menu( 'edit.php?post_type=sp_player', 'edit.php?post_type=sp_list' );
|
||||
elseif ( $typenow == 'sp_directory' )
|
||||
sportspress_highlight_admin_menu( 'edit.php?post_type=sp_staff', 'edit.php?post_type=sp_directory' );
|
||||
sp_highlight_admin_menu( 'edit.php?post_type=sp_staff', 'edit.php?post_type=sp_directory' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -93,7 +93,7 @@ class SP_Admin_Permalink_Settings {
|
||||
else
|
||||
update_option( $key, $value );
|
||||
endforeach;
|
||||
sportspress_flush_rewrite_rules();
|
||||
sp_flush_rewrite_rules();
|
||||
endif;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,8 +50,8 @@ class SP_Admin_Taxonomies {
|
||||
$term = reset( $terms );
|
||||
$t_id = $term->term_id;
|
||||
$term_meta = get_option( "taxonomy_$t_id" );
|
||||
$latitude = sportspress_array_value( $term_meta, 'sp_latitude', '40.7324319' );
|
||||
$longitude = sportspress_array_value( $term_meta, 'sp_longitude', '-73.82480799999996' );
|
||||
$latitude = sp_array_value( $term_meta, 'sp_latitude', '40.7324319' );
|
||||
$longitude = sp_array_value( $term_meta, 'sp_longitude', '-73.82480799999996' );
|
||||
else:
|
||||
$latitude = '40.7324319';
|
||||
$longitude = '-73.82480799999996';
|
||||
|
||||
@@ -120,8 +120,8 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
$season = ( empty( $_POST['sp_season'] ) ? false : $_POST['sp_season'] );
|
||||
|
||||
// Get labels from result and performance post types
|
||||
$result_labels = sportspress_get_var_labels( 'sp_result' );
|
||||
$performance_labels = sportspress_get_var_labels( 'sp_performance' );
|
||||
$result_labels = sp_get_var_labels( 'sp_result' );
|
||||
$performance_labels = sp_get_var_labels( 'sp_performance' );
|
||||
|
||||
while ( ( $row = fgetcsv( $handle, 0, $this->delimiter ) ) !== FALSE ):
|
||||
|
||||
@@ -311,7 +311,7 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
|
||||
// Add delimiter if event name is set
|
||||
if ( $title ):
|
||||
$title .= ' ' . sportspress_array_value( $sportspress_options, 'event_teams_delimiter', 'vs' ) . ' ';
|
||||
$title .= ' ' . sp_array_value( $sportspress_options, 'event_teams_delimiter', 'vs' ) . ' ';
|
||||
endif;
|
||||
|
||||
// Append team name to event name
|
||||
@@ -575,9 +575,9 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
'values' => 'slug',
|
||||
'show_option_none' => __( '-- Not set --', 'sportspress' ),
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
echo '<p>' . __( 'None', 'sportspress' ) . '</p>';
|
||||
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?></td>
|
||||
</tr>
|
||||
@@ -590,9 +590,9 @@ if ( class_exists( 'WP_Importer' ) ) {
|
||||
'values' => 'slug',
|
||||
'show_option_none' => __( '-- Not set --', 'sportspress' ),
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
echo '<p>' . __( 'None', 'sportspress' ) . '</p>';
|
||||
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?></td>
|
||||
</tr>
|
||||
|
||||
@@ -92,10 +92,10 @@ class SP_Admin_CPT_Calendar extends SP_Admin_CPT {
|
||||
endif;
|
||||
break;
|
||||
case 'sp_events':
|
||||
echo sizeof( sportspress_get_calendar_data( $post_id ) );
|
||||
echo sizeof( sp_get_calendar_data( $post_id ) );
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class SP_Admin_CPT_Calendar extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_calendar' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
|
||||
$args = array(
|
||||
@@ -134,7 +134,7 @@ class SP_Admin_CPT_Calendar extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -143,7 +143,7 @@ class SP_Admin_CPT_Calendar extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['team'] ) ? $_REQUEST['team'] : null;
|
||||
$args = array(
|
||||
|
||||
@@ -60,13 +60,13 @@ class SP_Admin_CPT_Column extends SP_Admin_CPT {
|
||||
echo $post->post_name;
|
||||
break;
|
||||
case 'sp_equation':
|
||||
echo sportspress_get_post_equation( $post_id );
|
||||
echo sp_get_post_equation( $post_id );
|
||||
break;
|
||||
case 'sp_precision':
|
||||
echo sportspress_get_post_precision( $post_id );
|
||||
echo sp_get_post_precision( $post_id );
|
||||
break;
|
||||
case 'sp_order':
|
||||
echo sportspress_get_post_order( $post_id );
|
||||
echo sp_get_post_order( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
|
||||
if ( $data['post_type'] == 'sp_event' && $data['post_title'] == '' ):
|
||||
|
||||
$teams = sportspress_array_value( $postarr, 'sp_team', array() );
|
||||
$teams = sp_array_value( $postarr, 'sp_team', array() );
|
||||
|
||||
$team_names = array();
|
||||
foreach( $teams as $team ):
|
||||
$team_names[] = get_the_title( $team );
|
||||
endforeach;
|
||||
|
||||
$data['post_title'] = implode( ' ' . sportspress_array_value( $sportspress_options, 'event_teams_delimiter', 'vs' ) . ' ', $team_names );
|
||||
$data['post_title'] = implode( ' ' . sp_array_value( $sportspress_options, 'event_teams_delimiter', 'vs' ) . ' ', $team_names );
|
||||
|
||||
endif;
|
||||
|
||||
@@ -152,7 +152,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '—';
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -182,7 +182,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_event' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['team'] ) ? $_REQUEST['team'] : null;
|
||||
$args = array(
|
||||
@@ -201,7 +201,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -210,7 +210,7 @@ class SP_Admin_CPT_Event extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -62,7 +62,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
public function custom_columns( $column, $post_id ) {
|
||||
switch ( $column ):
|
||||
case 'sp_player':
|
||||
echo sportspress_posts( $post_id, 'sp_player' );
|
||||
echo sp_posts( $post_id, 'sp_player' );
|
||||
break;
|
||||
case 'sp_league':
|
||||
echo get_the_terms ( $post_id, 'sp_league' ) ? the_terms( $post_id, 'sp_league' ) : '—';
|
||||
@@ -84,7 +84,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
endif;
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -114,7 +114,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_list' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
|
||||
$args = array(
|
||||
@@ -123,7 +123,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -132,7 +132,7 @@ class SP_Admin_CPT_List extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['team'] ) ? $_REQUEST['team'] : null;
|
||||
$args = array(
|
||||
|
||||
@@ -62,7 +62,7 @@ class SP_Admin_CPT_Performance extends SP_Admin_CPT {
|
||||
echo get_the_terms( $post_id, 'sp_position' ) ? the_terms( $post_id, 'sp_position' ) : '—';
|
||||
break;
|
||||
case 'sp_calculate':
|
||||
echo sportspress_get_post_calculate( $post_id );
|
||||
echo sp_get_post_calculate( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
|
||||
@@ -89,16 +89,16 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
|
||||
else:
|
||||
$results = get_post_meta( $post_id, 'sp_results', true );
|
||||
global $sportspress_options;
|
||||
$main_result = sportspress_array_value( $sportspress_options, 'main_result', null );
|
||||
$main_result = sp_array_value( $sportspress_options, 'main_result', null );
|
||||
foreach( $teams as $team_id ):
|
||||
if ( ! $team_id ) continue;
|
||||
$team = get_post( $team_id );
|
||||
|
||||
if ( $team ):
|
||||
$team_results = sportspress_array_value( $results, $team_id, null );
|
||||
$team_results = sp_array_value( $results, $team_id, null );
|
||||
|
||||
if ( $main_result ):
|
||||
$team_result = sportspress_array_value( $team_results, $main_result, null );
|
||||
$team_result = sp_array_value( $team_results, $main_result, null );
|
||||
else:
|
||||
if ( is_array( $team_results ) ):
|
||||
end( $team_results );
|
||||
@@ -131,7 +131,7 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
|
||||
echo get_the_terms ( $post_id, 'sp_venue' ) ? the_terms( $post_id, 'sp_venue' ) : '—';
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_player' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['team'] ) ? $_REQUEST['team'] : null;
|
||||
$args = array(
|
||||
@@ -180,7 +180,7 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -189,7 +189,7 @@ class SP_Admin_CPT_Player extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -108,7 +108,7 @@ class SP_Admin_CPT_Staff extends SP_Admin_CPT {
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ class SP_Admin_CPT_Staff extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_staff' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['team'] ) ? $_REQUEST['team'] : null;
|
||||
$args = array(
|
||||
@@ -157,7 +157,7 @@ class SP_Admin_CPT_Staff extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -166,7 +166,7 @@ class SP_Admin_CPT_Staff extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,10 +67,10 @@ class SP_Admin_CPT_Table extends SP_Admin_CPT {
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
||||
break;
|
||||
case 'sp_team':
|
||||
echo sportspress_posts( $post_id, 'sp_team' );
|
||||
echo sp_posts( $post_id, 'sp_team' );
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ class SP_Admin_CPT_Table extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_table' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
|
||||
$args = array(
|
||||
@@ -109,7 +109,7 @@ class SP_Admin_CPT_Table extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -118,7 +118,7 @@ class SP_Admin_CPT_Table extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['team'] ) ? $_REQUEST['team'] : null;
|
||||
$args = array(
|
||||
|
||||
@@ -82,7 +82,7 @@ class SP_Admin_CPT_Team extends SP_Admin_CPT {
|
||||
echo get_the_terms ( $post_id, 'sp_season' ) ? the_terms( $post_id, 'sp_season' ) : '—';
|
||||
break;
|
||||
case 'sp_views':
|
||||
echo sportspress_get_post_views( $post_id );
|
||||
echo sp_get_post_views( $post_id );
|
||||
break;
|
||||
endswitch;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ class SP_Admin_CPT_Team extends SP_Admin_CPT {
|
||||
if ( $typenow != 'sp_team' )
|
||||
return;
|
||||
|
||||
sportspress_highlight_admin_menu();
|
||||
sp_highlight_admin_menu();
|
||||
|
||||
$selected = isset( $_REQUEST['sp_league'] ) ? $_REQUEST['sp_league'] : null;
|
||||
$args = array(
|
||||
@@ -121,7 +121,7 @@ class SP_Admin_CPT_Team extends SP_Admin_CPT {
|
||||
'name' => 'sp_league',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
|
||||
$selected = isset( $_REQUEST['sp_season'] ) ? $_REQUEST['sp_season'] : null;
|
||||
$args = array(
|
||||
@@ -130,7 +130,7 @@ class SP_Admin_CPT_Team extends SP_Admin_CPT {
|
||||
'name' => 'sp_season',
|
||||
'selected' => $selected
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,17 +19,14 @@ class SP_Meta_Box_Calendar_Data {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
list( $data, $usecolumns ) = sportspress_get_calendar_data( $post->ID, true );
|
||||
|
||||
sportspress_edit_calendar_table( $data, $usecolumns );
|
||||
|
||||
sportspress_nonce();
|
||||
list( $data, $usecolumns ) = sp_get_calendar_data( $post->ID, true );
|
||||
sp_edit_calendar_table( $data, $usecolumns );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
|
||||
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -20,9 +20,9 @@ class SP_Meta_Box_Calendar_Details {
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
global $sportspress_formats;
|
||||
$league_id = sportspress_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sportspress_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$venue_id = sportspress_get_the_term_id( $post->ID, 'sp_venue', 0 );
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$venue_id = sp_get_the_term_id( $post->ID, 'sp_venue', 0 );
|
||||
$team_id = get_post_meta( $post->ID, 'sp_team', true );
|
||||
$formats = get_post_meta( $post->ID, 'sp_format' );
|
||||
?>
|
||||
@@ -37,8 +37,8 @@ class SP_Meta_Box_Calendar_Details {
|
||||
'selected' => $league_id,
|
||||
'values' => 'term_id'
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -52,8 +52,8 @@ class SP_Meta_Box_Calendar_Details {
|
||||
'selected' => $season_id,
|
||||
'values' => 'term_id'
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -67,8 +67,8 @@ class SP_Meta_Box_Calendar_Details {
|
||||
'selected' => $venue_id,
|
||||
'values' => 'term_id'
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -82,8 +82,8 @@ class SP_Meta_Box_Calendar_Details {
|
||||
'selected' => $team_id,
|
||||
'values' => 'ID'
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_pages( $args ) ):
|
||||
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -95,9 +95,9 @@ class SP_Meta_Box_Calendar_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
|
||||
update_post_meta( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', 0 ) );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
|
||||
update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', 0 ) );
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,6 @@ class SP_Meta_Box_Calendar_Format {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_format', sportspress_array_value( $_POST, 'sp_format', 'calendar' ) );
|
||||
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'calendar' ) );
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ class SP_Meta_Box_Column_Details {
|
||||
<p class="sp-equation-selector">
|
||||
<?php
|
||||
foreach ( $equation as $piece ):
|
||||
sportspress_equation_selector( $post->ID, $piece, array( 'team_event', 'result', 'outcome' ) );
|
||||
sp_equation_selector( $post->ID, $piece, array( 'team_event', 'result', 'outcome' ) );
|
||||
endforeach;
|
||||
?>
|
||||
</p>
|
||||
@@ -74,10 +74,10 @@ class SP_Meta_Box_Column_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
sportspress_delete_duplicate_post( $_POST );
|
||||
update_post_meta( $post_id, 'sp_equation', implode( ' ', sportspress_array_value( $_POST, 'sp_equation', array() ) ) );
|
||||
update_post_meta( $post_id, 'sp_precision', (int) sportspress_array_value( $_POST, 'sp_precision', 1 ) );
|
||||
update_post_meta( $post_id, 'sp_priority', sportspress_array_value( $_POST, 'sp_priority', '0' ) );
|
||||
update_post_meta( $post_id, 'sp_order', sportspress_array_value( $_POST, 'sp_order', 'DESC' ) );
|
||||
sp_delete_duplicate_post( $_POST );
|
||||
update_post_meta( $post_id, 'sp_equation', implode( ' ', sp_array_value( $_POST, 'sp_equation', array() ) ) );
|
||||
update_post_meta( $post_id, 'sp_precision', (int) sp_array_value( $_POST, 'sp_precision', 1 ) );
|
||||
update_post_meta( $post_id, 'sp_priority', sp_array_value( $_POST, 'sp_priority', '0' ) );
|
||||
update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', 'DESC' ) );
|
||||
}
|
||||
}
|
||||
@@ -19,10 +19,10 @@ class SP_Meta_Box_Event_Details {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
$type = sportspress_get_the_term_id( $post->ID, 'sp_type', null );
|
||||
$league_id = sportspress_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sportspress_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$venue_id = sportspress_get_the_term_id( $post->ID, 'sp_venue', 0 );
|
||||
$type = sp_get_the_term_id( $post->ID, 'sp_type', null );
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$venue_id = sp_get_the_term_id( $post->ID, 'sp_venue', 0 );
|
||||
?>
|
||||
<div>
|
||||
<fieldset class="sp-event-format-field sp-league-event-field sp-friendly-event-field">
|
||||
@@ -36,8 +36,8 @@ class SP_Meta_Box_Event_Details {
|
||||
'values' => 'term_id',
|
||||
'show_option_none' => __( '-- Not set --', 'sportspress' ),
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -51,8 +51,8 @@ class SP_Meta_Box_Event_Details {
|
||||
'values' => 'term_id',
|
||||
'show_option_none' => __( '-- Not set --', 'sportspress' ),
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -67,8 +67,8 @@ class SP_Meta_Box_Event_Details {
|
||||
'values' => 'term_id',
|
||||
'show_option_none' => __( '-- Not set --', 'sportspress' ),
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_venue', 'sp_event', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_venue', 'sp_event', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -80,8 +80,8 @@ class SP_Meta_Box_Event_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_venue', 0 ), 'sp_venue' );
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,6 @@ class SP_Meta_Box_Event_Format {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_format', sportspress_array_value( $_POST, 'sp_format', 'league' ) );
|
||||
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'league' ) );
|
||||
}
|
||||
}
|
||||
@@ -23,19 +23,19 @@ class SP_Meta_Box_Event_Performance {
|
||||
$stats = (array)get_post_meta( $post->ID, 'sp_players', true );
|
||||
|
||||
// Get columns from performance variables
|
||||
$columns = sportspress_get_var_labels( 'sp_performance' );
|
||||
$columns = sp_get_var_labels( 'sp_performance' );
|
||||
|
||||
foreach ( $teams as $key => $team_id ):
|
||||
if ( ! $team_id ) continue;
|
||||
|
||||
// Get results for players in the team
|
||||
$players = sportspress_array_between( (array)get_post_meta( $post->ID, 'sp_player', false ), 0, $key );
|
||||
$data = sportspress_array_combine( $players, sportspress_array_value( $stats, $team_id, array() ) );
|
||||
$players = sp_array_between( (array)get_post_meta( $post->ID, 'sp_player', false ), 0, $key );
|
||||
$data = sp_array_combine( $players, sp_array_value( $stats, $team_id, array() ) );
|
||||
|
||||
?>
|
||||
<div>
|
||||
<p><strong><?php echo get_the_title( $team_id ); ?></strong></p>
|
||||
<?php sportspress_edit_event_players_table( $columns, $data, $team_id ); ?>
|
||||
<?php sp_edit_event_players_table( $columns, $data, $team_id ); ?>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
@@ -46,6 +46,6 @@ class SP_Meta_Box_Event_Performance {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_players', sportspress_array_value( $_POST, 'sp_players', array() ) );
|
||||
update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -24,14 +24,14 @@ class SP_Meta_Box_Event_Results {
|
||||
$results = (array)get_post_meta( $post->ID, 'sp_results', true );
|
||||
|
||||
// Get columns from result variables
|
||||
$columns = sportspress_get_var_labels( 'sp_result' );
|
||||
$columns = sp_get_var_labels( 'sp_result' );
|
||||
|
||||
// Get results for all teams
|
||||
$data = sportspress_array_combine( $teams, $results );
|
||||
$data = sp_array_combine( $teams, $results );
|
||||
|
||||
?>
|
||||
<div>
|
||||
<?php sportspress_edit_event_results_table( $columns, $data ); ?>
|
||||
<?php sp_edit_event_results_table( $columns, $data ); ?>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class SP_Meta_Box_Event_Results {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
$results = (array)sportspress_array_value( $_POST, 'sp_results', array() );
|
||||
$results = (array)sp_array_value( $_POST, 'sp_results', array() );
|
||||
update_post_meta( $post_id, 'sp_results', $results );
|
||||
}
|
||||
}
|
||||
@@ -41,8 +41,8 @@ class SP_Meta_Box_Event_Teams {
|
||||
<li class="wp-tab"><a href="#sp_staff-all"><?php _e( 'Staff', 'sportspress' ); ?></a></li>
|
||||
</ul>
|
||||
<?php
|
||||
sportspress_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team', $key );
|
||||
sportspress_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $key );
|
||||
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_current_team', $key );
|
||||
sp_post_checklist( $post->ID, 'sp_staff', 'none', 'sp_current_team', $key );
|
||||
?>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
@@ -67,8 +67,8 @@ class SP_Meta_Box_Event_Teams {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', array() ) );
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_player', sportspress_array_value( $_POST, 'sp_player', array() ) );
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_staff', sportspress_array_value( $_POST, 'sp_staff', array() ) );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_staff', sp_array_value( $_POST, 'sp_staff', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -42,6 +42,6 @@ class SP_Meta_Box_Event_Video {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_video', sportspress_array_value( $_POST, 'sp_video', null ) );
|
||||
update_post_meta( $post_id, 'sp_video', sp_array_value( $_POST, 'sp_video', null ) );
|
||||
}
|
||||
}
|
||||
@@ -19,16 +19,16 @@ class SP_Meta_Box_List_Data {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
list( $columns, $usecolumns, $data, $placeholders, $merged ) = sportspress_get_player_list_data( $post->ID, true );
|
||||
list( $columns, $usecolumns, $data, $placeholders, $merged ) = sp_get_player_list_data( $post->ID, true );
|
||||
|
||||
sportspress_edit_player_list_table( $columns, $usecolumns, $data, $placeholders );
|
||||
sp_edit_player_list_table( $columns, $usecolumns, $data, $placeholders );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
|
||||
update_post_meta( $post_id, 'sp_players', sportspress_array_value( $_POST, 'sp_players', array() ) );
|
||||
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
||||
update_post_meta( $post_id, 'sp_players', sp_array_value( $_POST, 'sp_players', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -19,8 +19,8 @@ class SP_Meta_Box_List_Details {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
$league_id = sportspress_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sportspress_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$team_id = get_post_meta( $post->ID, 'sp_team', true );
|
||||
$orderby = get_post_meta( $post->ID, 'sp_orderby', true );
|
||||
$order = get_post_meta( $post->ID, 'sp_order', true );
|
||||
@@ -35,8 +35,8 @@ class SP_Meta_Box_List_Details {
|
||||
'selected' => $league_id,
|
||||
'values' => 'term_id',
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -49,8 +49,8 @@ class SP_Meta_Box_List_Details {
|
||||
'selected' => $season_id,
|
||||
'values' => 'term_id',
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -64,8 +64,8 @@ class SP_Meta_Box_List_Details {
|
||||
'selected' => $team_id,
|
||||
'values' => 'ID',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_pages( $args ) ):
|
||||
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -83,8 +83,8 @@ class SP_Meta_Box_List_Details {
|
||||
'selected' => $orderby,
|
||||
'values' => 'slug',
|
||||
);
|
||||
if ( ! sportspress_dropdown_pages( $args ) ):
|
||||
sportspress_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_pages( $args ) ):
|
||||
sp_post_adder( 'sp_list', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -97,8 +97,8 @@ class SP_Meta_Box_List_Details {
|
||||
</p>
|
||||
<p><strong><?php _e( 'Players', 'sportspress' ); ?></strong></p>
|
||||
<?php
|
||||
sportspress_post_checklist( $post->ID, 'sp_player', 'block', 'sp_team' );
|
||||
sportspress_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_checklist( $post->ID, 'sp_player', 'block', 'sp_team' );
|
||||
sp_post_adder( 'sp_player', __( 'Add New', 'sportspress' ) );
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
@@ -108,11 +108,11 @@ class SP_Meta_Box_List_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', array() ) );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
update_post_meta( $post_id, 'sp_orderby', sportspress_array_value( $_POST, 'sp_orderby', array() ) );
|
||||
update_post_meta( $post_id, 'sp_order', sportspress_array_value( $_POST, 'sp_order', array() ) );
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_player', sportspress_array_value( $_POST, 'sp_player', array() ) );
|
||||
update_post_meta( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array() ) );
|
||||
update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_player', sp_array_value( $_POST, 'sp_player', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,6 @@ class SP_Meta_Box_List_Format {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_format', sportspress_array_value( $_POST, 'sp_format', 'list' ) );
|
||||
update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'list' ) );
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,6 @@ class SP_Meta_Box_Outcome_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
sportspress_delete_duplicate_post( $_POST );
|
||||
sp_delete_duplicate_post( $_POST );
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class SP_Meta_Box_Performance_Details {
|
||||
?>
|
||||
<p><strong><?php _e( 'Calculate', 'sportspress' ); ?></strong></p>
|
||||
<p class="sp-calculate-selector">
|
||||
<?php sportspress_calculate_selector( $post->ID, $calculate ); ?>
|
||||
<?php sp_calculate_selector( $post->ID, $calculate ); ?>
|
||||
</p>
|
||||
<?php
|
||||
}
|
||||
@@ -33,7 +33,7 @@ class SP_Meta_Box_Performance_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
sportspress_delete_duplicate_post( $_POST );
|
||||
update_post_meta( $post_id, 'sp_calculate', sportspress_array_value( $_POST, 'sp_calculate', 'DESC' ) );
|
||||
sp_delete_duplicate_post( $_POST );
|
||||
update_post_meta( $post_id, 'sp_calculate', sp_array_value( $_POST, 'sp_calculate', 'DESC' ) );
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ class SP_Meta_Box_Player_Details {
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
?></p>
|
||||
|
||||
<p><strong><?php _e( 'Current Team', 'sportspress' ); ?></strong></p>
|
||||
@@ -95,7 +95,7 @@ class SP_Meta_Box_Player_Details {
|
||||
'class' => 'sp-current-team widefat',
|
||||
'chosen' => true,
|
||||
);
|
||||
sportspress_dropdown_pages( $args );
|
||||
sp_dropdown_pages( $args );
|
||||
?></p>
|
||||
|
||||
<p><strong><?php _e( 'Past Teams', 'sportspress' ); ?></strong></p>
|
||||
@@ -110,7 +110,7 @@ class SP_Meta_Box_Player_Details {
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
);
|
||||
sportspress_dropdown_pages( $args );
|
||||
sp_dropdown_pages( $args );
|
||||
?></p>
|
||||
|
||||
<p><strong><?php _e( 'Leagues', 'sportspress' ); ?></strong></p>
|
||||
@@ -125,7 +125,7 @@ class SP_Meta_Box_Player_Details {
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
?></p>
|
||||
|
||||
<p><strong><?php _e( 'Seasons', 'sportspress' ); ?></strong></p>
|
||||
@@ -140,7 +140,7 @@ class SP_Meta_Box_Player_Details {
|
||||
'property' => 'multiple',
|
||||
'chosen' => true,
|
||||
);
|
||||
sportspress_dropdown_taxonomies( $args );
|
||||
sp_dropdown_taxonomies( $args );
|
||||
?></p>
|
||||
<?php
|
||||
}
|
||||
@@ -149,10 +149,10 @@ class SP_Meta_Box_Player_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_number', sportspress_array_value( $_POST, 'sp_number', '' ) );
|
||||
update_post_meta( $post_id, 'sp_nationality', sportspress_array_value( $_POST, 'sp_nationality', '' ) );
|
||||
update_post_meta( $post_id, 'sp_current_team', sportspress_array_value( $_POST, 'sp_current_team', null ) );
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_past_team', sportspress_array_value( $_POST, 'sp_past_team', array() ) );
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sportspress_array_value( $_POST, 'sp_current_team', null ) ), sportspress_array_value( $_POST, 'sp_past_team', array() ) ) );
|
||||
update_post_meta( $post_id, 'sp_number', sp_array_value( $_POST, 'sp_number', '' ) );
|
||||
update_post_meta( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', '' ) );
|
||||
update_post_meta( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', null ) );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array() ) );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', null ) ), sp_array_value( $_POST, 'sp_past_team', array() ) ) );
|
||||
}
|
||||
}
|
||||
@@ -50,11 +50,11 @@ class SP_Meta_Box_Player_Metrics {
|
||||
foreach ( $vars as $var ):
|
||||
?>
|
||||
<p><strong><?php echo $var->post_title; ?></strong></p>
|
||||
<p><input type="text" name="sp_metrics[<?php echo $var->post_name; ?>]" value="<?php echo sportspress_array_value( $metrics, $var->post_name, '' ); ?>" /></p>
|
||||
<p><input type="text" name="sp_metrics[<?php echo $var->post_name; ?>]" value="<?php echo sp_array_value( $metrics, $var->post_name, '' ); ?>" /></p>
|
||||
<?php
|
||||
endforeach;
|
||||
else:
|
||||
sportspress_post_adder( 'sp_metric', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_adder( 'sp_metric', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
}
|
||||
|
||||
@@ -62,6 +62,6 @@ class SP_Meta_Box_Player_Metrics {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_metrics', sportspress_array_value( $_POST, 'sp_metrics', array() ) );
|
||||
update_post_meta( $post_id, 'sp_metrics', sp_array_value( $_POST, 'sp_metrics', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -32,9 +32,9 @@ class SP_Meta_Box_Player_Performance {
|
||||
<?php
|
||||
endif;
|
||||
|
||||
list( $columns, $data, $placeholders, $merged, $seasons_teams ) = sportspress_get_player_performance_data( $post->ID, $league->term_id, true );
|
||||
list( $columns, $data, $placeholders, $merged, $seasons_teams ) = sp_get_player_performance_data( $post->ID, $league->term_id, true );
|
||||
|
||||
sportspress_edit_player_performance_table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, ! current_user_can( 'edit_sp_teams' ) );
|
||||
sp_edit_player_performance_table( $post->ID, $league->term_id, $columns, $data, $placeholders, $merged, $seasons_teams, ! current_user_can( 'edit_sp_teams' ) );
|
||||
|
||||
endforeach;
|
||||
}
|
||||
@@ -43,8 +43,8 @@ class SP_Meta_Box_Player_Performance {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_leagues', sportspress_array_value( $_POST, 'sp_leagues', array() ) );
|
||||
update_post_meta( $post_id, 'sp_leagues', sp_array_value( $_POST, 'sp_leagues', array() ) );
|
||||
if ( current_user_can( 'edit_sp_teams' ) )
|
||||
update_post_meta( $post_id, 'sp_performance', sportspress_array_value( $_POST, 'sp_performance', array() ) );
|
||||
update_post_meta( $post_id, 'sp_performance', sp_array_value( $_POST, 'sp_performance', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,6 @@ class SP_Meta_Box_Result_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
sportspress_delete_duplicate_post( $_POST );
|
||||
sp_delete_duplicate_post( $_POST );
|
||||
}
|
||||
}
|
||||
@@ -19,18 +19,15 @@ class SP_Meta_Box_Table_Data {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
list( $columns, $usecolumns, $data, $placeholders, $merged ) = sportspress_get_league_table_data( $post->ID, true );
|
||||
|
||||
sportspress_edit_league_table( $columns, $usecolumns, $data, $placeholders );
|
||||
|
||||
sportspress_nonce();
|
||||
list( $columns, $usecolumns, $data, $placeholders, $merged ) = sp_get_league_table_data( $post->ID, true );
|
||||
sp_edit_league_table( $columns, $usecolumns, $data, $placeholders );
|
||||
}
|
||||
|
||||
/**
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
|
||||
update_post_meta( $post_id, 'sp_teams', sportspress_array_value( $_POST, 'sp_teams', array() ) );
|
||||
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
||||
update_post_meta( $post_id, 'sp_teams', sp_array_value( $_POST, 'sp_teams', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,8 @@ class SP_Meta_Box_Table_Details {
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
wp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );
|
||||
$league_id = sportspress_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sportspress_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
$league_id = sp_get_the_term_id( $post->ID, 'sp_league', 0 );
|
||||
$season_id = sp_get_the_term_id( $post->ID, 'sp_season', 0 );
|
||||
?>
|
||||
<div>
|
||||
<p><strong><?php _e( 'League', 'sportspress' ); ?></strong></p>
|
||||
@@ -33,8 +33,8 @@ class SP_Meta_Box_Table_Details {
|
||||
'selected' => $league_id,
|
||||
'values' => 'term_id'
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
@@ -47,15 +47,15 @@ class SP_Meta_Box_Table_Details {
|
||||
'selected' => $season_id,
|
||||
'values' => 'term_id'
|
||||
);
|
||||
if ( ! sportspress_dropdown_taxonomies( $args ) ):
|
||||
sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
if ( ! sp_dropdown_taxonomies( $args ) ):
|
||||
sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
endif;
|
||||
?>
|
||||
</p>
|
||||
<p><strong><?php _e( 'Teams', 'sportspress' ); ?></strong></p>
|
||||
<?php
|
||||
sportspress_post_checklist( $post->ID, 'sp_team', 'block', 'sp_season' );
|
||||
sportspress_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
sp_post_checklist( $post->ID, 'sp_team', 'block', 'sp_season' );
|
||||
sp_post_adder( 'sp_team', __( 'Add New', 'sportspress' ) );
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
@@ -65,8 +65,8 @@ class SP_Meta_Box_Table_Details {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sportspress_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
sportspress_update_post_meta_recursive( $post_id, 'sp_team', sportspress_array_value( $_POST, 'sp_team', array() ) );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_league', 0 ), 'sp_league' );
|
||||
wp_set_post_terms( $post_id, sp_array_value( $_POST, 'sp_season', 0 ), 'sp_season' );
|
||||
sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,6 @@ class SP_Meta_Box_Team_Columns {
|
||||
* Output the metabox
|
||||
*/
|
||||
public static function output( $post ) {
|
||||
wp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' );
|
||||
$leagues = (array)get_the_terms( $post->ID, 'sp_league' );
|
||||
$league_num = sizeof( $leagues );
|
||||
|
||||
@@ -34,9 +33,9 @@ class SP_Meta_Box_Team_Columns {
|
||||
<?php
|
||||
endif;
|
||||
|
||||
list( $columns, $data, $placeholders, $merged, $leagues_seasons ) = sportspress_get_team_columns_data( $post->ID, $league_id, true );
|
||||
list( $columns, $data, $placeholders, $merged, $leagues_seasons ) = sp_get_team_columns_data( $post->ID, $league_id, true );
|
||||
|
||||
sportspress_edit_team_columns_table( $league_id, $columns, $data, $placeholders, $merged, $leagues_seasons, ! current_user_can( 'edit_sp_tables' ) );
|
||||
sp_edit_team_columns_table( $league_id, $columns, $data, $placeholders, $merged, $leagues_seasons, ! current_user_can( 'edit_sp_tables' ) );
|
||||
|
||||
endforeach;
|
||||
}
|
||||
@@ -45,8 +44,8 @@ class SP_Meta_Box_Team_Columns {
|
||||
* Save meta box data
|
||||
*/
|
||||
public static function save( $post_id, $post ) {
|
||||
update_post_meta( $post_id, 'sp_leagues_seasons', sportspress_array_value( $_POST, 'sp_leagues_seasons', array() ) );
|
||||
update_post_meta( $post_id, 'sp_leagues_seasons', sp_array_value( $_POST, 'sp_leagues_seasons', array() ) );
|
||||
if ( current_user_can( 'edit_sp_tables' ) )
|
||||
update_post_meta( $post_id, 'sp_columns', sportspress_array_value( $_POST, 'sp_columns', array() ) );
|
||||
update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) );
|
||||
}
|
||||
}
|
||||
@@ -316,9 +316,9 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
||||
<td><?php echo $row->post_name; ?></td>
|
||||
<td><?php echo sportspress_get_post_equation( $row->ID, $row->post_name ); ?></td>
|
||||
<td><?php echo sportspress_get_post_precision( $row->ID ); ?></td>
|
||||
<td><?php echo sportspress_get_post_order( $row->ID ); ?></td>
|
||||
<td><?php echo sp_get_post_equation( $row->ID, $row->post_name ); ?></td>
|
||||
<td><?php echo sp_get_post_precision( $row->ID ); ?></td>
|
||||
<td><?php echo sp_get_post_order( $row->ID ); ?></td>
|
||||
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
@@ -417,7 +417,7 @@ class SP_Settings_Config extends SP_Settings_Page {
|
||||
<tr<?php if ( $i % 2 == 0 ) echo ' class="alternate"'; ?>>
|
||||
<td class="row-title"><?php echo $row->post_title; ?></td>
|
||||
<td><?php echo get_the_terms ( $row->ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '—'; ?></td>
|
||||
<td><?php echo sportspress_get_post_calculate( $row->ID ); ?></td>
|
||||
<td><?php echo sp_get_post_calculate( $row->ID ); ?></td>
|
||||
<td class="edit"><a class="button" href="<?php echo get_edit_post_link( $row->ID ); ?>"><?php _e( 'Edit', 'sportspress' ); ?></s></td>
|
||||
</tr>
|
||||
<?php $i++; endforeach; ?>
|
||||
|
||||
Reference in New Issue
Block a user