Add option to choose individual/team mode per event
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
||||
|
||||
$is_individual = get_option( 'sportspress_load_individual_mode_module', 'no' ) === 'yes' ? true : false;
|
||||
$is_individual = get_option( 'sportspress_mode', 'team' ) === 'player' ? true : false;
|
||||
$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;
|
||||
|
||||
@@ -18,7 +18,7 @@ $defaults = array(
|
||||
'title' => false,
|
||||
'show_title' => get_option( 'sportspress_table_show_title', 'yes' ) == 'yes' ? true : false,
|
||||
'show_team_logo' => get_option( 'sportspress_table_show_logos', 'yes' ) == 'yes' ? true : false,
|
||||
'link_posts' => get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false,
|
||||
'link_posts' => null,
|
||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||
'scrollable' => get_option( 'sportspress_enable_scrollable_tables', 'yes' ) == 'yes' ? true : false,
|
||||
'paginated' => get_option( 'sportspress_table_paginated', 'yes' ) == 'yes' ? true : false,
|
||||
@@ -27,6 +27,14 @@ $defaults = array(
|
||||
|
||||
extract( $defaults, EXTR_SKIP );
|
||||
|
||||
if ( ! isset( $link_posts ) ) {
|
||||
if ( 'player' === sp_get_post_mode( $id ) ) {
|
||||
$link_posts = get_option( 'sportspress_link_players', 'yes' ) == 'yes' ? true : false;
|
||||
} else {
|
||||
$link_posts = get_option( 'sportspress_link_teams', 'no' ) == 'yes' ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! isset( $highlight ) ) $highlight = get_post_meta( $id, 'sp_highlight', true );
|
||||
|
||||
$table = new SP_League_Table( $id );
|
||||
|
||||
@@ -45,7 +45,7 @@ if ( $season_ids ):
|
||||
);
|
||||
endif;
|
||||
|
||||
if ( $team && apply_filters( 'sportspress_has_teams', true ) ):
|
||||
if ( $team ):
|
||||
$args['meta_query'] = array(
|
||||
array(
|
||||
'key' => 'sp_team',
|
||||
|
||||
@@ -44,7 +44,7 @@ if ( $season_ids ):
|
||||
);
|
||||
endif;
|
||||
|
||||
if ( $team && apply_filters( 'sportspress_has_teams', true ) ):
|
||||
if ( $team ):
|
||||
$args['meta_query'] = array(
|
||||
array(
|
||||
'key' => 'sp_team',
|
||||
|
||||
Reference in New Issue
Block a user