Add options to widgets
This commit is contained in:
@@ -197,7 +197,7 @@ if ( !function_exists( 'sportspress_events_calendar' ) ) {
|
||||
$calendar_output .= "\n\t</tr>\n\t</tbody>\n\t</table>";
|
||||
|
||||
if ( $id && $r['show_all_events_link'] )
|
||||
$calendar_output .= '<a class="sp-all-events-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
$calendar_output .= '<a class="sp-calendar-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
|
||||
return apply_filters( 'sportspress_events_calendar', $calendar_output );
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ if ( !function_exists( 'sportspress_events_list' ) ) {
|
||||
$output .= '</tbody>' . '</table>';
|
||||
|
||||
if ( $id && $r['show_all_events_link'] )
|
||||
$output .= '<a class="sp-all-events-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
$output .= '<a class="sp-calendar-link" href="' . get_permalink( $id ) . '">' . __( 'View all events', 'sportspress' ) . '</a>';
|
||||
|
||||
$output .= '</div>';
|
||||
|
||||
|
||||
@@ -6,9 +6,11 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
|
||||
$id = get_the_ID();
|
||||
|
||||
$defaults = array(
|
||||
'number' => -1,
|
||||
'statistics' => null,
|
||||
'orderby' => 'default',
|
||||
'order' => 'ASC',
|
||||
'show_all_players_link' => false,
|
||||
);
|
||||
|
||||
$r = wp_parse_args( $args, $defaults );
|
||||
@@ -55,7 +57,11 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
|
||||
|
||||
$i = 0;
|
||||
|
||||
if ( is_int( $r['number'] ) && $r['number'] > 0 )
|
||||
$limit = $r['number'];
|
||||
|
||||
foreach( $data as $player_id => $row ):
|
||||
if ( isset( $limit ) && $i >= $limit ) continue;
|
||||
|
||||
$name = sportspress_array_value( $row, 'name', null );
|
||||
if ( ! $name ) continue;
|
||||
@@ -89,6 +95,9 @@ if ( !function_exists( 'sportspress_player_list' ) ) {
|
||||
|
||||
$output .= '</tbody>' . '</table>' . '</div>';
|
||||
|
||||
if ( $r['show_all_players_link'] )
|
||||
$output .= '<a class="sp-player-list-link" href="' . get_permalink( $id ) . '">' . __( 'View all players', 'sportspress' ) . '</a>';
|
||||
|
||||
return apply_filters( 'sportspress_player_list', $output );
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user