Add options to toggle individual templates per post type

This commit is contained in:
Brian Miyaji
2014-10-22 18:51:25 +11:00
parent 5d144aacfb
commit 13cb8cbada
14 changed files with 404 additions and 233 deletions

View File

@@ -47,13 +47,61 @@ class SP_Settings_Events extends SP_Settings_Page {
'id' => 'sportspress_link_events',
'default' => 'yes',
'type' => 'checkbox',
),
array(
'title' => __( 'Display', 'sportspress' ),
'desc' => __( 'Logos', 'sportspress' ),
'id' => 'sportspress_event_show_logos',
'default' => 'yes',
'type' => 'checkbox',
'checkboxgroup' => 'start',
),
array(
'desc' => __( 'Link venues', 'sportspress' ),
'id' => 'sportspress_link_venues',
'default' => 'no',
'desc' => __( 'Results', 'sportspress' ),
'id' => 'sportspress_event_show_results',
'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',
'checkboxgroup' => 'end',
),
@@ -73,31 +121,6 @@ class SP_Settings_Events extends SP_Settings_Page {
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(
'title' => __( 'Player Performance', 'sportspress' ),
'id' => 'sportspress_event_performance_mode',
@@ -110,7 +133,7 @@ class SP_Settings_Events extends SP_Settings_Page {
),
array(
'title' => __( 'Venue', 'sportspress' ),
'title' => __( 'Venues', 'sportspress' ),
'desc' => __( 'Display maps', 'sportspress' ),
'id' => 'sportspress_event_show_maps',
'default' => 'yes',
@@ -119,12 +142,11 @@ class SP_Settings_Events extends SP_Settings_Page {
),
array(
'title' => __( 'Staff', 'sportspress' ),
'desc' => __( 'Display staff', 'sportspress' ),
'id' => 'sportspress_event_show_staff',
'default' => 'yes',
'desc' => __( 'Link venues', 'sportspress' ),
'id' => 'sportspress_link_venues',
'default' => 'no',
'type' => 'checkbox',
'checkboxgroup' => 'start',
'checkboxgroup' => 'end',
),
array(

View File

@@ -46,6 +46,23 @@ class SP_Settings_Players extends SP_Settings_Page {
'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(
'title' => __( 'Nationality', 'sportspress' ),
'desc' => __( 'Display national flags', 'sportspress' ),

View File

@@ -48,6 +48,23 @@ class SP_Settings_Staff extends SP_Settings_Page {
'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(
'title' => __( 'Nationality', 'sportspress' ),
'desc' => __( 'Display national flags', 'sportspress' ),

View File

@@ -48,6 +48,39 @@ class SP_Settings_Teams extends SP_Settings_Page {
'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(
'title' => __( 'Abbreviation', 'sportspress' ),
'desc' => __( 'Abbreviate team names', 'sportspress' ),

View File

@@ -186,6 +186,32 @@ if ( ! function_exists( 'sportspress_output_team_link' ) ) {
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' ) ) {
/**
@@ -231,13 +257,26 @@ if ( ! function_exists( 'sportspress_output_league_table' ) ) {
/** 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' ) ) {
/**
* Output the player metrics.
* Output the player details.
*
* @access public
* @subpackage Player/Metrics
* @subpackage Player/Details
* @return void
*/
function sportspress_output_player_details() {
@@ -281,13 +320,26 @@ if ( ! function_exists( 'sportspress_output_player_list' ) ) {
/** 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' ) ) {
/**
* Output the staff metrics.
* Output the staff details.
*
* @access public
* @subpackage Staff/Metrics
* @subpackage Staff/Details
* @return void
*/
function sportspress_output_staff_details() {

View File

@@ -30,8 +30,9 @@ add_action( 'get_the_generator_xhtml', 'sp_generator_tag', 10, 2 );
* @see sportspress_output_event_details()
* @see sportspress_output_event_venue()
* @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_results', 20 );
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
*
* @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_br_tag', 100 );
@@ -50,20 +52,29 @@ add_action( 'sportspress_single_calendar_content', 'sportspress_output_br_tag',
/**
* Single Team Content
*
* @see sportspress_output_team_link()
* @see sportspress_output_team_tables()
* @see sportspress_output_team_logo()
* @see sportspress_output_team_details()
* @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_tables', 30 );
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 );
/**
* Single Table Content
*
* @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_br_tag', 100 );
@@ -71,9 +82,12 @@ add_action( 'sportspress_single_table_content', 'sportspress_output_br_tag', 100
/**
* Single Player Content
*
* @see sportspress_output_player_photo()
* @see sportspress_output_player_details()
* @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_statistics', 20 );
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
*
* @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_br_tag', 100 );
@@ -89,8 +104,11 @@ add_action( 'sportspress_single_list_content', 'sportspress_output_br_tag', 100
/**
* Single Staff Content
*
* @see sportspress_output_staff_photo()
* @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_br_tag', 100 );