Add "week" as a filtering option to Birthdays widget
This commit is contained in:
@@ -46,6 +46,7 @@ class SP_Widget_Birthdays extends WP_Widget {
|
|||||||
$date = strip_tags($instance['date']);
|
$date = strip_tags($instance['date']);
|
||||||
$options = array(
|
$options = array(
|
||||||
'day' => __( 'Today', 'sportspress' ),
|
'day' => __( 'Today', 'sportspress' ),
|
||||||
|
'week' => __( 'This week', 'sportspress' ),
|
||||||
'month' => __( 'This month', 'sportspress' ),
|
'month' => __( 'This month', 'sportspress' ),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ if ( $date == 'day' ) {
|
|||||||
$args['day'] = date('j');
|
$args['day'] = date('j');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( $date == 'week' ) {
|
||||||
|
$args['year'] = date( 'Y' );
|
||||||
|
$args['week'] = date( 'W' );
|
||||||
|
}
|
||||||
|
|
||||||
$posts = get_posts( $args );
|
$posts = get_posts( $args );
|
||||||
|
|
||||||
foreach ( $posts as $post ) {
|
foreach ( $posts as $post ) {
|
||||||
|
|||||||
Reference in New Issue
Block a user