Add option to select if calendar links to teams
This commit is contained in:
@@ -32,7 +32,7 @@ class SP_Meta_Box_Event_Teams {
|
|||||||
'name' => 'sp_team[]',
|
'name' => 'sp_team[]',
|
||||||
'class' => 'sportspress-pages',
|
'class' => 'sportspress-pages',
|
||||||
'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ),
|
'show_option_none' => sprintf( __( '— None —', 'sportspress' ), 'Team' ),
|
||||||
'selected' => $team
|
'selected' => $team,
|
||||||
);
|
);
|
||||||
wp_dropdown_pages( $args );
|
wp_dropdown_pages( $args );
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -101,6 +101,14 @@ class SP_Settings_Events extends SP_Settings_Page {
|
|||||||
|
|
||||||
array( 'title' => __( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options' ),
|
array( 'title' => __( 'Calendars', 'sportspress' ), 'type' => 'title', 'id' => 'calendar_options' ),
|
||||||
|
|
||||||
|
array(
|
||||||
|
'title' => __( 'Teams', 'sportspress' ),
|
||||||
|
'desc' => __( 'Link teams', 'sportspress' ),
|
||||||
|
'id' => 'sportspress_calendar_link_teams',
|
||||||
|
'default' => 'no',
|
||||||
|
'type' => 'checkbox',
|
||||||
|
),
|
||||||
|
|
||||||
array(
|
array(
|
||||||
'title' => __( 'Pagination', 'sportspress' ),
|
'title' => __( 'Pagination', 'sportspress' ),
|
||||||
'desc' => __( 'Paginate', 'sportspress' ),
|
'desc' => __( 'Paginate', 'sportspress' ),
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ $primary_result = get_option( 'sportspress_primary_result', null );
|
|||||||
$defaults = array(
|
$defaults = array(
|
||||||
'status' => 'default',
|
'status' => 'default',
|
||||||
'number' => -1,
|
'number' => -1,
|
||||||
|
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
'rows' => get_option( 'sportspress_calendar_rows', 10 ),
|
||||||
'order' => 'default',
|
'order' => 'default',
|
||||||
@@ -57,7 +58,11 @@ if ( isset( $columns ) )
|
|||||||
if ( ! has_post_thumbnail ( $team ) )
|
if ( ! has_post_thumbnail ( $team ) )
|
||||||
continue;
|
continue;
|
||||||
$j++;
|
$j++;
|
||||||
$logo = '<a href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '</a>';
|
if ( $link_teams ):
|
||||||
|
$logo = '<a href="' . get_post_permalink( $team ) . '" title="' . get_the_title( $team ) . '">' . get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) ) . '</a>';
|
||||||
|
else:
|
||||||
|
$logo = get_the_post_thumbnail( $team, 'sportspress-fit-icon', array( 'class' => 'team-logo logo-' . ( $j % 2 ? 'odd' : 'even' ) ) );
|
||||||
|
endif;
|
||||||
$logos[] = $logo;
|
$logos[] = $logo;
|
||||||
$team_results = sp_array_value( $results, $team, null );
|
$team_results = sp_array_value( $results, $team, null );
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ $primary_result = get_option( 'sportspress_primary_result', null );
|
|||||||
$defaults = array(
|
$defaults = array(
|
||||||
'status' => 'default',
|
'status' => 'default',
|
||||||
'number' => -1,
|
'number' => -1,
|
||||||
|
'link_teams' => get_option( 'sportspress_calendar_link_teams', 'no' ) == 'yes' ? true : false,
|
||||||
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
'sortable' => get_option( 'sportspress_enable_sortable_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
'responsive' => get_option( 'sportspress_enable_responsive_tables', 'yes' ) == 'yes' ? true : false,
|
||||||
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
'paginated' => get_option( 'sportspress_calendar_paginated', 'yes' ) == 'yes' ? true : false,
|
||||||
@@ -93,7 +94,11 @@ if ( isset( $columns ) )
|
|||||||
endif;
|
endif;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$teams_output .= $name;
|
if ( $link_teams ):
|
||||||
|
$teams_output .= '<a href="' . get_post_permalink( $team ) . '">' . $name . '</a>';
|
||||||
|
else:
|
||||||
|
$teams_output .= $name;
|
||||||
|
endif;
|
||||||
|
|
||||||
if ( $team_result != null ):
|
if ( $team_result != null ):
|
||||||
$main_results[] = $team_result;
|
$main_results[] = $team_result;
|
||||||
|
|||||||
Reference in New Issue
Block a user