Add options to toggle individual templates per post type
This commit is contained in:
@@ -47,13 +47,61 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
'id' => 'sportspress_link_events',
|
'id' => 'sportspress_link_events',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Display', 'sportspress' ),
|
||||||
|
'desc' => __( 'Logos', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_logos',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'start',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'desc' => __( 'Link venues', 'sportspress' ),
|
'desc' => __( 'Results', 'sportspress' ),
|
||||||
'id' => 'sportspress_link_venues',
|
'id' => 'sportspress_event_show_results',
|
||||||
'default' => 'no',
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Details', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_details',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Venue', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_venue',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Players', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_players',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Staff', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_staff',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Total', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_event_show_total',
|
||||||
|
'default' => 'yes',
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'end',
|
'checkboxgroup' => 'end',
|
||||||
),
|
),
|
||||||
@@ -73,31 +121,6 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'type' => 'delimiter' ),
|
array( 'type' => 'delimiter' ),
|
||||||
|
|
||||||
array(
|
|
||||||
'title' => __( 'Teams', 'sportspress' ),
|
|
||||||
'desc' => __( 'Display logos', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_event_show_logos',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'start',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Display players', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_event_show_players',
|
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => '',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
|
||||||
'desc' => __( 'Display total', 'sportspress' ),
|
|
||||||
'id' => 'sportspress_event_show_total',
|
|
||||||
'default' => 'no',
|
|
||||||
'type' => 'checkbox',
|
|
||||||
'checkboxgroup' => 'end',
|
|
||||||
),
|
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Player Performance', 'sportspress' ),
|
'title' => __( 'Player Performance', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_performance_mode',
|
'id' => 'sportspress_event_performance_mode',
|
||||||
@@ -110,7 +133,7 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Venue', 'sportspress' ),
|
'title' => __( 'Venues', 'sportspress' ),
|
||||||
'desc' => __( 'Display maps', 'sportspress' ),
|
'desc' => __( 'Display maps', 'sportspress' ),
|
||||||
'id' => 'sportspress_event_show_maps',
|
'id' => 'sportspress_event_show_maps',
|
||||||
'default' => 'yes',
|
'default' => 'yes',
|
||||||
@@ -119,12 +142,11 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Staff', 'sportspress' ),
|
'desc' => __( 'Link venues', 'sportspress' ),
|
||||||
'desc' => __( 'Display staff', 'sportspress' ),
|
'id' => 'sportspress_link_venues',
|
||||||
'id' => 'sportspress_event_show_staff',
|
'default' => 'no',
|
||||||
'default' => 'yes',
|
|
||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
'checkboxgroup' => 'start',
|
'checkboxgroup' => 'end',
|
||||||
),
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
|
|||||||
@@ -46,6 +46,23 @@ class SP_Settings_Players extends SP_Settings_Page {
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Display', 'sportspress' ),
|
||||||
|
'desc' => __( 'Photo', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_player_show_photo',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Details', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_player_show_details',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Nationality', 'sportspress' ),
|
'title' => __( 'Nationality', 'sportspress' ),
|
||||||
'desc' => __( 'Display national flags', 'sportspress' ),
|
'desc' => __( 'Display national flags', 'sportspress' ),
|
||||||
|
|||||||
@@ -48,6 +48,23 @@ class SP_Settings_Staff extends SP_Settings_Page {
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Display', 'sportspress' ),
|
||||||
|
'desc' => __( 'Photo', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_staff_show_photo',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Details', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_staff_show_details',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Nationality', 'sportspress' ),
|
'title' => __( 'Nationality', 'sportspress' ),
|
||||||
'desc' => __( 'Display national flags', 'sportspress' ),
|
'desc' => __( 'Display national flags', 'sportspress' ),
|
||||||
|
|||||||
@@ -48,6 +48,39 @@ class SP_Settings_Teams extends SP_Settings_Page {
|
|||||||
'type' => 'checkbox',
|
'type' => 'checkbox',
|
||||||
),
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Display', 'sportspress' ),
|
||||||
|
'desc' => __( 'Logo', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_team_show_logo',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'start',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Details', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_team_show_details',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => '',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'desc' => __( 'Visit Site', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_team_show_link',
|
||||||
|
'default' => 'yes',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
'checkboxgroup' => 'end',
|
||||||
|
),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Venue', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link venues', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_team_link_venues',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Abbreviation', 'sportspress' ),
|
'title' => __( 'Abbreviation', 'sportspress' ),
|
||||||
'desc' => __( 'Abbreviate team names', 'sportspress' ),
|
'desc' => __( 'Abbreviate team names', 'sportspress' ),
|
||||||
|
|||||||
@@ -186,6 +186,32 @@ if ( ! function_exists( 'sportspress_output_team_link' ) ) {
|
|||||||
sp_get_template( 'team-link.php' );
|
sp_get_template( 'team-link.php' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( ! function_exists( 'sportspress_output_team_logo' ) ) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the team logo.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @subpackage Team/Logo
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function sportspress_output_team_logo() {
|
||||||
|
sp_get_template( 'team-logo.php' );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( ! function_exists( 'sportspress_output_team_details' ) ) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the team details.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @subpackage Team/Details
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function sportspress_output_team_details() {
|
||||||
|
sp_get_template( 'team-details.php' );
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( ! function_exists( 'sportspress_output_team_tables' ) ) {
|
if ( ! function_exists( 'sportspress_output_team_tables' ) ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,13 +257,26 @@ if ( ! function_exists( 'sportspress_output_league_table' ) ) {
|
|||||||
|
|
||||||
/** Single Player ********************************************************/
|
/** Single Player ********************************************************/
|
||||||
|
|
||||||
|
if ( ! function_exists( 'sportspress_output_player_photo' ) ) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the player photo.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @subpackage Player/Photo
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function sportspress_output_player_photo() {
|
||||||
|
sp_get_template( 'player-photo.php' );
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( ! function_exists( 'sportspress_output_player_details' ) ) {
|
if ( ! function_exists( 'sportspress_output_player_details' ) ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output the player metrics.
|
* Output the player details.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @subpackage Player/Metrics
|
* @subpackage Player/Details
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function sportspress_output_player_details() {
|
function sportspress_output_player_details() {
|
||||||
@@ -281,13 +320,26 @@ if ( ! function_exists( 'sportspress_output_player_list' ) ) {
|
|||||||
|
|
||||||
/** Single Staff ********************************************************/
|
/** Single Staff ********************************************************/
|
||||||
|
|
||||||
|
if ( ! function_exists( 'sportspress_output_staff_photo' ) ) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Output the staff photo.
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
|
* @subpackage Staff/Photo
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
function sportspress_output_staff_photo() {
|
||||||
|
sp_get_template( 'staff-photo.php' );
|
||||||
|
}
|
||||||
|
}
|
||||||
if ( ! function_exists( 'sportspress_output_staff_details' ) ) {
|
if ( ! function_exists( 'sportspress_output_staff_details' ) ) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Output the staff metrics.
|
* Output the staff details.
|
||||||
*
|
*
|
||||||
* @access public
|
* @access public
|
||||||
* @subpackage Staff/Metrics
|
* @subpackage Staff/Details
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function sportspress_output_staff_details() {
|
function sportspress_output_staff_details() {
|
||||||
|
|||||||
@@ -30,8 +30,9 @@ add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );
|
|||||||
* @see sportspress_output_event_details()
|
* @see sportspress_output_event_details()
|
||||||
* @see sportspress_output_event_venue()
|
* @see sportspress_output_event_venue()
|
||||||
* @see sportspress_output_event_performance()
|
* @see sportspress_output_event_performance()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
add_action( 'sportspress_single_event_content', 'sportspress_output_event_logos', 5 );
|
add_action( 'sportspress_single_event_content', 'sportspress_output_event_logos', 0 );
|
||||||
add_action( 'sportspress_single_event_content', 'sportspress_output_event_video', 10 );
|
add_action( 'sportspress_single_event_content', 'sportspress_output_event_video', 10 );
|
||||||
add_action( 'sportspress_single_event_content', 'sportspress_output_event_results', 20 );
|
add_action( 'sportspress_single_event_content', 'sportspress_output_event_results', 20 );
|
||||||
add_action( 'sportspress_single_event_content', 'sportspress_output_event_details', 30 );
|
add_action( 'sportspress_single_event_content', 'sportspress_output_event_details', 30 );
|
||||||
@@ -43,6 +44,7 @@ add_action( 'sportspress_single_event_content', 'sportspress_output_br_tag', 100
|
|||||||
* Single Calendar Content
|
* Single Calendar Content
|
||||||
*
|
*
|
||||||
* @see sportspress_output_calendar()
|
* @see sportspress_output_calendar()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
add_action( 'sportspress_single_calendar_content', 'sportspress_output_calendar', 10 );
|
add_action( 'sportspress_single_calendar_content', 'sportspress_output_calendar', 10 );
|
||||||
add_action( 'sportspress_single_calendar_content', 'sportspress_output_br_tag', 100 );
|
add_action( 'sportspress_single_calendar_content', 'sportspress_output_br_tag', 100 );
|
||||||
@@ -50,20 +52,29 @@ add_action( 'sportspress_single_calendar_content', 'sportspress_output_br_tag',
|
|||||||
/**
|
/**
|
||||||
* Single Team Content
|
* Single Team Content
|
||||||
*
|
*
|
||||||
* @see sportspress_output_team_link()
|
* @see sportspress_output_team_logo()
|
||||||
* @see sportspress_output_team_tables()
|
* @see sportspress_output_team_details()
|
||||||
* @see sportspress_output_team_lists()
|
* @see sportspress_output_team_lists()
|
||||||
|
* @see sportspress_output_team_tables()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
|
add_action( 'sportspress_single_team_content', 'sportspress_output_team_logo', 0 );
|
||||||
|
add_action( 'sportspress_single_team_content', 'sportspress_output_team_details', 10 );
|
||||||
add_action( 'sportspress_single_team_content', 'sportspress_output_team_lists', 20 );
|
add_action( 'sportspress_single_team_content', 'sportspress_output_team_lists', 20 );
|
||||||
add_action( 'sportspress_single_team_content', 'sportspress_output_team_tables', 30 );
|
add_action( 'sportspress_single_team_content', 'sportspress_output_team_tables', 30 );
|
||||||
add_action( 'sportspress_single_team_content', 'sportspress_output_br_tag', 100 );
|
add_action( 'sportspress_single_team_content', 'sportspress_output_br_tag', 100 );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* After Single Team
|
||||||
|
* @see sportspress_output_team_link()
|
||||||
|
*/
|
||||||
add_action( 'sportspress_after_single_team', 'sportspress_output_team_link', 10 );
|
add_action( 'sportspress_after_single_team', 'sportspress_output_team_link', 10 );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Single Table Content
|
* Single Table Content
|
||||||
*
|
*
|
||||||
* @see sportspress_output_league_table()
|
* @see sportspress_output_league_table()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
add_action( 'sportspress_single_table_content', 'sportspress_output_league_table', 10 );
|
add_action( 'sportspress_single_table_content', 'sportspress_output_league_table', 10 );
|
||||||
add_action( 'sportspress_single_table_content', 'sportspress_output_br_tag', 100 );
|
add_action( 'sportspress_single_table_content', 'sportspress_output_br_tag', 100 );
|
||||||
@@ -71,9 +82,12 @@ add_action( 'sportspress_single_table_content', 'sportspress_output_br_tag', 100
|
|||||||
/**
|
/**
|
||||||
* Single Player Content
|
* Single Player Content
|
||||||
*
|
*
|
||||||
|
* @see sportspress_output_player_photo()
|
||||||
* @see sportspress_output_player_details()
|
* @see sportspress_output_player_details()
|
||||||
* @see sportspress_output_player_statistics()
|
* @see sportspress_output_player_statistics()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
|
add_action( 'sportspress_single_player_content', 'sportspress_output_player_photo', 0 );
|
||||||
add_action( 'sportspress_single_player_content', 'sportspress_output_player_details', 10 );
|
add_action( 'sportspress_single_player_content', 'sportspress_output_player_details', 10 );
|
||||||
add_action( 'sportspress_single_player_content', 'sportspress_output_player_statistics', 20 );
|
add_action( 'sportspress_single_player_content', 'sportspress_output_player_statistics', 20 );
|
||||||
add_action( 'sportspress_single_player_content', 'sportspress_output_br_tag', 100 );
|
add_action( 'sportspress_single_player_content', 'sportspress_output_br_tag', 100 );
|
||||||
@@ -82,6 +96,7 @@ add_action( 'sportspress_single_player_content', 'sportspress_output_br_tag', 10
|
|||||||
* Single List Content
|
* Single List Content
|
||||||
*
|
*
|
||||||
* @see sportspress_output_player_list()
|
* @see sportspress_output_player_list()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
add_action( 'sportspress_single_list_content', 'sportspress_output_player_list', 10 );
|
add_action( 'sportspress_single_list_content', 'sportspress_output_player_list', 10 );
|
||||||
add_action( 'sportspress_single_list_content', 'sportspress_output_br_tag', 100 );
|
add_action( 'sportspress_single_list_content', 'sportspress_output_br_tag', 100 );
|
||||||
@@ -89,8 +104,11 @@ add_action( 'sportspress_single_list_content', 'sportspress_output_br_tag', 100
|
|||||||
/**
|
/**
|
||||||
* Single Staff Content
|
* Single Staff Content
|
||||||
*
|
*
|
||||||
|
* @see sportspress_output_staff_photo()
|
||||||
* @see sportspress_output_staff_details()
|
* @see sportspress_output_staff_details()
|
||||||
|
* @see sportspress_output_br_tag()
|
||||||
*/
|
*/
|
||||||
|
add_action( 'sportspress_single_staff_content', 'sportspress_output_staff_photo', 0 );
|
||||||
add_action( 'sportspress_single_staff_content', 'sportspress_output_staff_details', 10 );
|
add_action( 'sportspress_single_staff_content', 'sportspress_output_staff_details', 10 );
|
||||||
add_action( 'sportspress_single_staff_content', 'sportspress_output_br_tag', 100 );
|
add_action( 'sportspress_single_staff_content', 'sportspress_output_br_tag', 100 );
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_event_show_details', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|||||||
@@ -8,24 +8,25 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_event_show_logos', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|
||||||
if ( get_option( 'sportspress_event_show_logos', 'yes' ) == 'yes' ):
|
$teams = get_post_meta( $id, 'sp_team' );
|
||||||
$teams = get_post_meta( $id, 'sp_team' );
|
$teams = array_filter( $teams );
|
||||||
$teams = array_filter( $teams );
|
if ( $teams ):
|
||||||
if ( $teams ):
|
$team_logos = array();
|
||||||
$team_logos = array();
|
foreach ( $teams as $team ):
|
||||||
foreach ( $teams as $team ):
|
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
|
||||||
$team_logos[] = get_the_post_thumbnail( $team, 'sportspress-fit-icon' );
|
if ( get_option( 'sportspress_link_teams', 'no' ) == 'yes' ) $logo = '<a href="' . get_post_permalink( $team ) . '">' . $logo . '</a>';
|
||||||
endforeach;
|
$team_logos[] = $logo;
|
||||||
$team_logos = array_filter( $team_logos );
|
endforeach;
|
||||||
if ( ! empty( $team_logos ) ):
|
$team_logos = array_filter( $team_logos );
|
||||||
echo '<div class="sp-template sp-template-event-logos sp-event-logos">';
|
if ( ! empty( $team_logos ) ):
|
||||||
$delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
|
echo '<div class="sp-template sp-template-event-logos sp-event-logos">';
|
||||||
echo implode( ' ' . $delimiter . ' ', $team_logos );
|
$delimiter = get_option( 'sportspress_event_teams_delimiter', 'vs' );
|
||||||
echo '</div>';
|
echo implode( ' ' . $delimiter . ' ', $team_logos );
|
||||||
endif;
|
echo '</div>';
|
||||||
endif;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
@@ -9,39 +9,46 @@
|
|||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
|
||||||
|
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) === 'yes' ? true : false;
|
||||||
|
$show_staff = get_option( 'sportspress_event_show_staff', 'yes' ) === 'yes' ? true : false;
|
||||||
|
$show_total = get_option( 'sportspress_event_show_total', 'yes' ) === 'yes' ? true : false;
|
||||||
|
|
||||||
|
if ( ! $show_players && ! $show_staff && ! $show_total ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|
||||||
$event = new SP_Event( $id );
|
|
||||||
$performance = $event->performance();
|
|
||||||
|
|
||||||
// The first row should be column labels
|
|
||||||
$labels = $performance[0];
|
|
||||||
|
|
||||||
// Remove the first row to leave us with the actual data
|
|
||||||
unset( $performance[0] );
|
|
||||||
|
|
||||||
$performance = array_filter( $performance );
|
|
||||||
|
|
||||||
$teams = get_post_meta( $id, 'sp_team', false );
|
$teams = get_post_meta( $id, 'sp_team', false );
|
||||||
$status = $event->status();
|
|
||||||
|
|
||||||
$show_players = get_option( 'sportspress_event_show_players', 'yes' ) == 'yes' ? true : false;
|
|
||||||
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
|
|
||||||
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
|
||||||
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
|
||||||
$mode = get_option( 'sportspress_event_performance_mode', 'values' );
|
|
||||||
|
|
||||||
// Get performance ids for icons
|
|
||||||
if ( $mode == 'icons' ):
|
|
||||||
$performance_ids = array();
|
|
||||||
$performance_posts = get_posts( array( 'posts_per_page' => -1, 'post_type' => 'sp_performance' ) );
|
|
||||||
foreach ( $performance_posts as $post ):
|
|
||||||
$performance_ids[ $post->post_name ] = $post->ID;
|
|
||||||
endforeach;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( is_array( $teams ) ):
|
if ( is_array( $teams ) ):
|
||||||
|
|
||||||
|
$event = new SP_Event( $id );
|
||||||
|
$performance = $event->performance();
|
||||||
|
|
||||||
|
// The first row should be column labels
|
||||||
|
$labels = $performance[0];
|
||||||
|
|
||||||
|
// Remove the first row to leave us with the actual data
|
||||||
|
unset( $performance[0] );
|
||||||
|
|
||||||
|
$performance = array_filter( $performance );
|
||||||
|
|
||||||
|
$status = $event->status();
|
||||||
|
|
||||||
|
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
|
||||||
|
$scrollable = get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
$responsive = get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false;
|
||||||
|
$mode = get_option( 'sportspress_event_performance_mode', 'values' );
|
||||||
|
|
||||||
|
// Get performance ids for icons
|
||||||
|
if ( $mode == 'icons' ):
|
||||||
|
$performance_ids = array();
|
||||||
|
$performance_posts = get_posts( array( 'posts_per_page' => -1, 'post_type' => 'sp_performance' ) );
|
||||||
|
foreach ( $performance_posts as $post ):
|
||||||
|
$performance_ids[ $post->post_name ] = $post->ID;
|
||||||
|
endforeach;
|
||||||
|
endif;
|
||||||
|
|
||||||
foreach( $teams as $index => $team_id ):
|
foreach( $teams as $index => $team_id ):
|
||||||
if ( ! $team_id ) continue;
|
if ( ! $team_id ) continue;
|
||||||
|
|
||||||
@@ -49,10 +56,7 @@ if ( is_array( $teams ) ):
|
|||||||
$players = sp_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $index );
|
$players = sp_array_between( (array)get_post_meta( $id, 'sp_player', false ), 0, $index );
|
||||||
$has_players = sizeof( $players ) > 1;
|
$has_players = sizeof( $players ) > 1;
|
||||||
|
|
||||||
if ( ! $has_players ):
|
$show_players = $show_players && $has_players;
|
||||||
if ( $status != 'results' ) continue;
|
|
||||||
elseif ( get_option( 'sportspress_event_show_total', 'yes' ) != 'yes' ) continue;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
$totals = array();
|
$totals = array();
|
||||||
|
|
||||||
@@ -62,157 +66,159 @@ if ( is_array( $teams ) ):
|
|||||||
<div class="sp-template sp-template-event-performance">
|
<div class="sp-template sp-template-event-performance">
|
||||||
<h4 class="sp-table-caption"><?php echo get_the_title( $team_id ); ?></h4>
|
<h4 class="sp-table-caption"><?php echo get_the_title( $team_id ); ?></h4>
|
||||||
<?php
|
<?php
|
||||||
if ( get_option( 'sportspress_event_show_staff', 'yes' ) == 'yes' ):
|
if ( $show_staff ):
|
||||||
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
|
sp_get_template( 'event-staff.php', array( 'id' => $id, 'index' => $index ) );
|
||||||
endif;
|
endif;
|
||||||
?>
|
?>
|
||||||
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
<?php if ( $show_players || $show_total ): ?>
|
||||||
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } ?>">
|
<div class="sp-table-wrapper<?php if ( $scrollable ) { ?> sp-scrollable-table-wrapper<?php } ?>">
|
||||||
<thead>
|
<table class="sp-event-performance sp-data-table <?php if ( $responsive ) { ?> sp-responsive-table<?php } ?>">
|
||||||
<tr>
|
<thead>
|
||||||
<?php if ( $has_players ): ?>
|
<tr>
|
||||||
<th class="data-number">#</th>
|
<?php if ( $show_players ): ?>
|
||||||
<th class="data-name"><?php _e( 'Player', 'sportspress' ); ?></th>
|
<th class="data-number">#</th>
|
||||||
<?php endif; ?>
|
<th class="data-name"><?php _e( 'Player', 'sportspress' ); ?></th>
|
||||||
<?php if ( $mode == 'values' ): foreach( $labels as $key => $label ): ?>
|
<?php endif; ?>
|
||||||
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
<?php if ( $mode == 'values' ): foreach( $labels as $key => $label ): ?>
|
||||||
<?php endforeach; else: ?>
|
<th class="data-<?php echo $key; ?>"><?php echo $label; ?></th>
|
||||||
<th class="sp-performance-icons"> </th>
|
<?php endforeach; else: ?>
|
||||||
<?php endif; ?>
|
<th class="sp-performance-icons"> </th>
|
||||||
</tr>
|
<?php endif; ?>
|
||||||
</thead>
|
</tr>
|
||||||
<?php if ( $show_players && $has_players ): ?>
|
</thead>
|
||||||
<tbody>
|
<?php if ( $show_players ): ?>
|
||||||
<?php
|
<tbody>
|
||||||
|
<?php
|
||||||
|
|
||||||
$lineups = array_filter( $data, array( $event, 'lineup_filter' ) );
|
$lineups = array_filter( $data, array( $event, 'lineup_filter' ) );
|
||||||
$subs = array_filter( $data, array( $event, 'sub_filter' ) );
|
$subs = array_filter( $data, array( $event, 'sub_filter' ) );
|
||||||
|
|
||||||
$lineup_sub_relation = array();
|
$lineup_sub_relation = array();
|
||||||
foreach ( $subs as $sub_id => $sub ):
|
foreach ( $subs as $sub_id => $sub ):
|
||||||
if ( ! $sub_id )
|
if ( ! $sub_id )
|
||||||
continue;
|
|
||||||
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
$i = 0;
|
|
||||||
foreach( $data as $player_id => $row ):
|
|
||||||
|
|
||||||
if ( ! $player_id )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
$name = get_the_title( $player_id );
|
|
||||||
|
|
||||||
if ( ! $name )
|
|
||||||
continue;
|
|
||||||
|
|
||||||
echo '<tr class="' . sp_array_value( $row, 'status', 'lineup' ) . ' ' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
|
||||||
|
|
||||||
$number = sp_array_value( $row, 'number', ' ' );
|
|
||||||
|
|
||||||
// Player number
|
|
||||||
echo '<td class="data-number">' . $number . '</td>';
|
|
||||||
|
|
||||||
if ( $link_posts ):
|
|
||||||
$permalink = get_post_permalink( $player_id );
|
|
||||||
$name = '<a href="' . $permalink . '">' . $name . '</a>';
|
|
||||||
if ( isset( $row['status'] ) && $row['status'] == 'sub' ):
|
|
||||||
$name = '(' . $name . ')';
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
|
|
||||||
$name .= ' <span class="sub-in" title="' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';
|
|
||||||
elseif ( isset( $row['sub'] ) && $row['sub'] ):
|
|
||||||
$name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
echo '<td class="data-name">' . $name . '</td>';
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
|
||||||
|
|
||||||
foreach( $labels as $key => $label ):
|
|
||||||
if ( $key == 'name' )
|
|
||||||
continue;
|
continue;
|
||||||
$value = '—';
|
$lineup_sub_relation[ sp_array_value( $sub, 'sub', 0 ) ] = $sub_id;
|
||||||
if ( $key == 'position' ):
|
endforeach;
|
||||||
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
$position = get_term_by( 'id', $row[ $key ], 'sp_position' );
|
$i = 0;
|
||||||
if ( $position ) $value = $position->name;
|
foreach( $data as $player_id => $row ):
|
||||||
|
|
||||||
|
if ( ! $player_id )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
$name = get_the_title( $player_id );
|
||||||
|
|
||||||
|
if ( ! $name )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
echo '<tr class="' . sp_array_value( $row, 'status', 'lineup' ) . ' ' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">';
|
||||||
|
|
||||||
|
$number = sp_array_value( $row, 'number', ' ' );
|
||||||
|
|
||||||
|
// Player number
|
||||||
|
echo '<td class="data-number">' . $number . '</td>';
|
||||||
|
|
||||||
|
if ( $link_posts ):
|
||||||
|
$permalink = get_post_permalink( $player_id );
|
||||||
|
$name = '<a href="' . $permalink . '">' . $name . '</a>';
|
||||||
|
if ( isset( $row['status'] ) && $row['status'] == 'sub' ):
|
||||||
|
$name = '(' . $name . ')';
|
||||||
endif;
|
endif;
|
||||||
else:
|
endif;
|
||||||
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
|
if ( array_key_exists( $player_id, $lineup_sub_relation ) ):
|
||||||
|
$name .= ' <span class="sub-in" title="' . get_the_title( $lineup_sub_relation[ $player_id ] ) . '">' . sp_array_value( sp_array_value( $data, $lineup_sub_relation[ $player_id ], array() ), 'number', null ) . '</span>';
|
||||||
|
elseif ( isset( $row['sub'] ) && $row['sub'] ):
|
||||||
|
$name .= ' <span class="sub-out" title="' . get_the_title( $row[ 'sub' ] ) . '">' . sp_array_value( sp_array_value( $data, $row['sub'], array() ), 'number', null ) . '</span>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
echo '<td class="data-name">' . $name . '</td>';
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
||||||
|
|
||||||
|
foreach( $labels as $key => $label ):
|
||||||
|
if ( $key == 'name' )
|
||||||
|
continue;
|
||||||
|
$value = '—';
|
||||||
|
if ( $key == 'position' ):
|
||||||
|
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
|
$position = get_term_by( 'id', $row[ $key ], 'sp_position' );
|
||||||
|
if ( $position ) $value = $position->name;
|
||||||
|
endif;
|
||||||
|
else:
|
||||||
|
if ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
|
$value = $row[ $key ];
|
||||||
|
else:
|
||||||
|
$value = 0;
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
if ( ! array_key_exists( $key, $totals ) ):
|
||||||
|
$totals[ $key ] = 0;
|
||||||
|
endif;
|
||||||
|
$totals[ $key ] += $value;
|
||||||
|
|
||||||
|
if ( $mode == 'values' ):
|
||||||
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
|
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
|
endif;
|
||||||
|
endif;
|
||||||
|
endforeach;
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ) echo '</td>';
|
||||||
|
|
||||||
|
echo '</tr>';
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
endforeach;
|
||||||
|
?>
|
||||||
|
</tbody>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ( $status == 'results' && $show_total && array_key_exists( 0, $data ) ): ?>
|
||||||
|
<<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
|
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
||||||
|
<?php
|
||||||
|
if ( $show_players ):
|
||||||
|
echo '<td class="data-number"> </td>';
|
||||||
|
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
||||||
|
endif;
|
||||||
|
|
||||||
|
$row = $data[0];
|
||||||
|
|
||||||
|
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
||||||
|
|
||||||
|
foreach( $labels as $key => $label ):
|
||||||
|
if ( $key == 'name' )
|
||||||
|
continue;
|
||||||
|
if ( $key == 'position' ):
|
||||||
|
$value = '—';
|
||||||
|
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
||||||
$value = $row[ $key ];
|
$value = $row[ $key ];
|
||||||
else:
|
else:
|
||||||
$value = 0;
|
$value = sp_array_value( $totals, $key, 0 );
|
||||||
endif;
|
endif;
|
||||||
endif;
|
|
||||||
if ( ! array_key_exists( $key, $totals ) ):
|
|
||||||
$totals[ $key ] = 0;
|
|
||||||
endif;
|
|
||||||
$totals[ $key ] += $value;
|
|
||||||
|
|
||||||
if ( $mode == 'values' ):
|
if ( $mode == 'values' ):
|
||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
elseif ( intval( $value ) && $mode == 'icons' ):
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
$performance_id = sp_array_value( $performance_ids, $key, null );
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
||||||
|
endif;
|
||||||
endif;
|
endif;
|
||||||
endif;
|
endforeach;
|
||||||
endforeach;
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '</td>';
|
|
||||||
|
|
||||||
echo '</tr>';
|
if ( $mode == 'icons' ) echo '</td>';
|
||||||
|
?>
|
||||||
$i++;
|
</tr>
|
||||||
|
</<?php echo ( $show_players ? 'tfoot' : 'tbody' ); ?>>
|
||||||
endforeach;
|
<?php endif; ?>
|
||||||
?>
|
</table>
|
||||||
</tbody>
|
</div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if ( $status == 'results' && get_option( 'sportspress_event_show_total', 'yes' ) == 'yes' && array_key_exists( 0, $data ) ): ?>
|
|
||||||
<<?php echo ( $show_players && $has_players ? 'tfoot' : 'tbody' ); ?>>
|
|
||||||
<tr class="' . ( $i % 2 == 0 ? 'odd' : 'even' ) . '">
|
|
||||||
<?php
|
|
||||||
if ( $has_players ):
|
|
||||||
echo '<td class="data-number"> </td>';
|
|
||||||
echo '<td class="data-name">' . __( 'Total', 'sportspress' ) . '</td>';
|
|
||||||
endif;
|
|
||||||
|
|
||||||
$row = $data[0];
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '<td class="sp-performance-icons">';
|
|
||||||
|
|
||||||
foreach( $labels as $key => $label ):
|
|
||||||
if ( $key == 'name' )
|
|
||||||
continue;
|
|
||||||
if ( $key == 'position' ):
|
|
||||||
$value = '—';
|
|
||||||
elseif ( array_key_exists( $key, $row ) && $row[ $key ] != '' ):
|
|
||||||
$value = $row[ $key ];
|
|
||||||
else:
|
|
||||||
$value = sp_array_value( $totals, $key, 0 );
|
|
||||||
endif;
|
|
||||||
|
|
||||||
if ( $mode == 'values' ):
|
|
||||||
echo '<td class="data-' . $key . '">' . $value . '</td>';
|
|
||||||
elseif ( intval( $value ) && $mode == 'icons' ):
|
|
||||||
$performance_id = sp_array_value( $performance_ids, $key, null );
|
|
||||||
if ( $performance_id && has_post_thumbnail( $performance_id ) ):
|
|
||||||
echo str_repeat( get_the_post_thumbnail( $performance_id, 'sportspress-fit-mini' ) . ' ', $value );
|
|
||||||
endif;
|
|
||||||
endif;
|
|
||||||
endforeach;
|
|
||||||
|
|
||||||
if ( $mode == 'icons' ) echo '</td>';
|
|
||||||
?>
|
|
||||||
</tr>
|
|
||||||
</<?php echo ( $has_players ? 'tfoot' : 'tbody' ); ?>>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_event_show_results', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_event_show_venue', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
*
|
*
|
||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @package SportsPress/Templates
|
* @package SportsPress/Templates
|
||||||
* @version 0.8
|
* @version 1.4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_player_show_details', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
@@ -66,15 +67,14 @@ if ( $past_teams ):
|
|||||||
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
|
$data[ __( 'Past Teams', 'sportspress' ) ] = implode( ', ', $teams );
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$output = '<div class="sp-list-wrapper">' .
|
$output = '<div class="sp-template sp-template-player-details sp-template-details"><div class="sp-list-wrapper"><dl class="sp-player-details">';
|
||||||
'<dl class="sp-player-details">';
|
|
||||||
|
|
||||||
foreach( $data as $label => $value ):
|
foreach( $data as $label => $value ):
|
||||||
|
|
||||||
$output .= '<dt>' . $label . '<dd>' . $value . '</dd>';
|
$output .= '<dt>' . $label . '</dt><dd>' . $value . '</dd>';
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</dl></div>';
|
$output .= '</dl></div></div>';
|
||||||
|
|
||||||
echo $output;
|
echo $output;
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
*
|
*
|
||||||
* @author ThemeBoy
|
* @author ThemeBoy
|
||||||
* @package SportsPress/Templates
|
* @package SportsPress/Templates
|
||||||
* @version 0.8
|
* @version 1.4
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_staff_show_details', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
@@ -48,12 +49,12 @@ $output = '<div class="sp-list-wrapper">' .
|
|||||||
|
|
||||||
foreach( $data as $label => $value ):
|
foreach( $data as $label => $value ):
|
||||||
|
|
||||||
$output .= '<dt>' . $label . '<dd>' . $value . '</dd>';
|
$output .= '<dt>' . $label . '</dt><dd>' . $value . '</dd>';
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
$output .= '</dl></div>';
|
$output .= '</dl></div>';
|
||||||
?>
|
?>
|
||||||
<div class="sp-template sp-template-staff-details">
|
<div class="sp-template sp-template-staff-details sp-template-details">
|
||||||
<?php echo $output; ?>
|
<?php echo $output; ?>
|
||||||
</div>
|
</div>
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||||
|
if ( get_option( 'sportspress_team_show_link', 'yes' ) === 'no' ) return;
|
||||||
|
|
||||||
if ( ! isset( $id ) )
|
if ( ! isset( $id ) )
|
||||||
$id = get_the_ID();
|
$id = get_the_ID();
|
||||||
|
|||||||
Reference in New Issue
Block a user