Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wbcom_filter_activity_feed_by_date( $args ) {
- // Get the current date and calculate the date for 7 days ago.
- $seven_days_ago = date( 'Y-m-d H:i:s', strtotime( '-7 days' ) );
- // Modify the query to show only activities from the last 7 days.
- $args['date_query'] = array(
- array(
- 'after' => $seven_days_ago,
- 'inclusive' => true,
- ),
- );
- return $args;
- }
- add_filter( 'bp_after_has_activities_parse_args', 'wbcom_filter_activity_feed_by_date' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement