diff --git a/includes/admin/class-sp-admin-dashboard.php b/includes/admin/class-sp-admin-dashboard.php index bd0b5ee4..4a5ec268 100644 --- a/includes/admin/class-sp-admin-dashboard.php +++ b/includes/admin/class-sp-admin-dashboard.php @@ -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 ); diff --git a/includes/admin/class-sp-admin-menus.php b/includes/admin/class-sp-admin-menus.php index 43a28664..6f3fb3aa 100644 --- a/includes/admin/class-sp-admin-menus.php +++ b/includes/admin/class-sp-admin-menus.php @@ -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' ); } /** diff --git a/includes/admin/class-sp-admin-permalink-settings.php b/includes/admin/class-sp-admin-permalink-settings.php index c7d02026..0a3d29b7 100644 --- a/includes/admin/class-sp-admin-permalink-settings.php +++ b/includes/admin/class-sp-admin-permalink-settings.php @@ -93,7 +93,7 @@ class SP_Admin_Permalink_Settings { else update_option( $key, $value ); endforeach; - sportspress_flush_rewrite_rules(); + sp_flush_rewrite_rules(); endif; } } diff --git a/includes/admin/class-sp-admin-taxonomies.php b/includes/admin/class-sp-admin-taxonomies.php index 12ab22d5..a40924a8 100644 --- a/includes/admin/class-sp-admin-taxonomies.php +++ b/includes/admin/class-sp-admin-taxonomies.php @@ -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'; diff --git a/includes/admin/importers/class-sp-event-importer.php b/includes/admin/importers/class-sp-event-importer.php index f7821ee7..37a027c7 100644 --- a/includes/admin/importers/class-sp-event-importer.php +++ b/includes/admin/importers/class-sp-event-importer.php @@ -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 '

' . __( 'None', 'sportspress' ) . '

'; - sportspress_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) ); + sp_taxonomy_adder( 'sp_league', 'sp_team', __( 'Add New', 'sportspress' ) ); endif; ?> @@ -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 '

' . __( 'None', 'sportspress' ) . '

'; - sportspress_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) ); + sp_taxonomy_adder( 'sp_season', 'sp_team', __( 'Add New', 'sportspress' ) ); endif; ?> diff --git a/includes/admin/post-types/class-sp-admin-cpt-calendar.php b/includes/admin/post-types/class-sp-admin-cpt-calendar.php index bc359cb6..e1d258d9 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-calendar.php +++ b/includes/admin/post-types/class-sp-admin-cpt-calendar.php @@ -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( diff --git a/includes/admin/post-types/class-sp-admin-cpt-column.php b/includes/admin/post-types/class-sp-admin-cpt-column.php index 1b50ff01..6c52929d 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-column.php +++ b/includes/admin/post-types/class-sp-admin-cpt-column.php @@ -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; } 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 28ed6232..3458cacb 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-event.php +++ b/includes/admin/post-types/class-sp-admin-cpt-event.php @@ -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 ); } /** diff --git a/includes/admin/post-types/class-sp-admin-cpt-list.php b/includes/admin/post-types/class-sp-admin-cpt-list.php index 4a5c6024..5ed52345 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-list.php +++ b/includes/admin/post-types/class-sp-admin-cpt-list.php @@ -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( diff --git a/includes/admin/post-types/class-sp-admin-cpt-performance.php b/includes/admin/post-types/class-sp-admin-cpt-performance.php index 5a43a9c1..5099b402 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-performance.php +++ b/includes/admin/post-types/class-sp-admin-cpt-performance.php @@ -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; } 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 9749a91e..0e039ddf 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-player.php +++ b/includes/admin/post-types/class-sp-admin-cpt-player.php @@ -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 ); } /** diff --git a/includes/admin/post-types/class-sp-admin-cpt-staff.php b/includes/admin/post-types/class-sp-admin-cpt-staff.php index e21ef985..c44991b8 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-staff.php +++ b/includes/admin/post-types/class-sp-admin-cpt-staff.php @@ -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 ); } /** diff --git a/includes/admin/post-types/class-sp-admin-cpt-table.php b/includes/admin/post-types/class-sp-admin-cpt-table.php index 58183a5c..8502078d 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-table.php +++ b/includes/admin/post-types/class-sp-admin-cpt-table.php @@ -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( diff --git a/includes/admin/post-types/class-sp-admin-cpt-team.php b/includes/admin/post-types/class-sp-admin-cpt-team.php index 15ab2811..3b887d73 100644 --- a/includes/admin/post-types/class-sp-admin-cpt-team.php +++ b/includes/admin/post-types/class-sp-admin-cpt-team.php @@ -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 ); } } diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php index ff242dfc..300bfa01 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-data.php @@ -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() ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php index 2cc4cfb6..cf253318 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-details.php @@ -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; ?>

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

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

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

@@ -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 ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-format.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-format.php index 2a675090..25237657 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-format.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-calendar-format.php @@ -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' ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php index 7a37c5d3..37c058de 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-column-details.php @@ -36,7 +36,7 @@ class SP_Meta_Box_Column_Details {

ID, $piece, array( 'team_event', 'result', 'outcome' ) ); + sp_equation_selector( $post->ID, $piece, array( 'team_event', 'result', 'outcome' ) ); endforeach; ?>

@@ -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' ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php index 069a1d22..75b9c34f 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-details.php @@ -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 ); ?>
@@ -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; ?>

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

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

@@ -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' ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-format.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-format.php index 458b3a43..49709378 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-format.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-format.php @@ -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' ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php index 04e6dc5a..b2549949 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-performance.php @@ -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() ) ); ?>

- +
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 ); ?>
- +
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 ); ?>
@@ -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() ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php index 3248586c..1601e540 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-event-video.php @@ -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 ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php index f09d653e..8db5f4ae 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-data.php @@ -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() ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php index 2401b7b9..184f501d 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-list-details.php @@ -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; ?>

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

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

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

@@ -97,8 +97,8 @@ class SP_Meta_Box_List_Details {

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

- ID, $calculate ); ?> + ID, $calculate ); ?>

'multiple', 'chosen' => true, ); - sportspress_dropdown_taxonomies( $args ); + sp_dropdown_taxonomies( $args ); ?>

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

@@ -110,7 +110,7 @@ class SP_Meta_Box_Player_Details { 'property' => 'multiple', 'chosen' => true, ); - sportspress_dropdown_pages( $args ); + sp_dropdown_pages( $args ); ?>

@@ -125,7 +125,7 @@ class SP_Meta_Box_Player_Details { 'property' => 'multiple', 'chosen' => true, ); - sportspress_dropdown_taxonomies( $args ); + sp_dropdown_taxonomies( $args ); ?>

@@ -140,7 +140,7 @@ class SP_Meta_Box_Player_Details { 'property' => 'multiple', 'chosen' => true, ); - sportspress_dropdown_taxonomies( $args ); + sp_dropdown_taxonomies( $args ); ?>

post_title; ?>

-

+

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() ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php index aca464dc..94dab1c3 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-result-details.php @@ -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 ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php index 84944ebf..183c6e89 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php @@ -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() ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php index 5ac9a46c..6d9d20d2 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php @@ -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 ); ?>

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

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

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' ) ); ?>
ID, 'sp_league' ); $league_num = sizeof( $leagues ); @@ -34,9 +33,9 @@ class SP_Meta_Box_Team_Columns { 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() ) ); } } \ No newline at end of file diff --git a/includes/admin/settings/class-sp-settings-config.php b/includes/admin/settings/class-sp-settings-config.php index 2ccf4641..0b12dab2 100644 --- a/includes/admin/settings/class-sp-settings-config.php +++ b/includes/admin/settings/class-sp-settings-config.php @@ -316,9 +316,9 @@ class SP_Settings_Config extends SP_Settings_Page { > post_title; ?> post_name; ?> - ID, $row->post_name ); ?> - ID ); ?> - ID ); ?> + ID, $row->post_name ); ?> + ID ); ?> + ID ); ?> @@ -417,7 +417,7 @@ class SP_Settings_Config extends SP_Settings_Page { > post_title; ?> ID, 'sp_position' ) ? the_terms( $row->ID, 'sp_position' ) : '—'; ?> - ID ); ?> + ID ); ?> diff --git a/includes/sp-core-functions.php b/includes/sp-core-functions.php index 1f6619b2..7d82f20d 100644 --- a/includes/sp-core-functions.php +++ b/includes/sp-core-functions.php @@ -191,7 +191,7 @@ if ( !function_exists( 'sp_flush_rewrite_rules' ) ) { if ( !function_exists( 'sp_nonce' ) ) { function sp_nonce() { - echo ''; + wp_nonce_field( 'sportspress_save_data', 'sportspress_meta_nonce' ); } } @@ -341,18 +341,6 @@ if ( !function_exists( 'sp_get_post_order' ) ) { } } -if ( !function_exists( 'sp_get_config_formats' ) ) { - function sp_get_config_formats() { - $arr = array( - 'integer' => __( 'Integer', 'sportspress' ), - 'decimal' => __( 'Decimal', 'sportspress' ), - 'time' => __( 'Time', 'sportspress' ), - 'custom' => __( 'Custom Field', 'sportspress' ), - ); - return $arr; - } -} - if ( !function_exists( 'sp_dropdown_taxonomies' ) ) { function sp_dropdown_taxonomies( $args = array() ) { $defaults = array( @@ -589,7 +577,7 @@ if ( !function_exists( 'sp_post_checklist' ) ) {