Skip to content

Instantly share code, notes, and snippets.

View yvettejolie's full-sized avatar

Yvette Jolie yvettejolie

View GitHub Profile
@lukecav
lukecav / functions.php
Created November 11, 2016 21:45
Expire posts to draft using a datepicker field in ACF
// Expire events
if ($expireTransient = get_transient($post->ID) === false) {
set_transient($post->ID, 'set for 1 minutes', 1 * MINUTE_IN_SECONDS );
$today = date('Y-m-d H:i:s', current_time('timestamp', 0));
$args = array(
'post_type' => 'events',
'posts_per_page' => 200,
'post_status' => 'publish',
'meta_query' => array(
array(