Add options to widgets

This commit is contained in:
Brian Miyaji
2014-03-17 22:55:24 +11:00
parent da10162988
commit b885665f21
4 changed files with 25 additions and 4 deletions

View File

@@ -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 );

View File

@@ -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>';

View File

@@ -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 );
}