Skip to content

Instantly share code, notes, and snippets.

@xnau
Last active Aug 8, 2017
Embed
What would you like to do?
Showing the last week's records in Participants Database
<?php
// determine the range of dates to show
$start = date( 'M j,Y', strtotime(  '-7 days' )  ); // the date 7 days ago
$end = date( 'M j,Y' ); // today's date
// now build the shortcode with the date range filter
echo do_shortcode( '[pdb_list filter="date_recorded>=' . $start . '&date_recorded<=' . $end . '" ]' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment