• We are using this function below to add the expiring date programmatically, but no matter what date we enter, the plugin always schedules it for the next day:

    function CCC_add_expiring_date_request( $post ) { $deadline = get_field( ‘deadline’, $post ); if( $_POST && array_key_exists( ‘input_9’, $_POST ) ) { $deadline = $_POST[ ‘input_9’ ]; } $date = new \DateTime( $deadline . ‘ 00:00:00’, wp_timezone() ); $date->add( new \DateInterval( ‘P1D’ ) ); $timestamp = date( ‘U’, strtotime( $date->format( ‘Y-m-d H:i:s’ ) ) ); $opts = array( ‘expireType’ => ‘draft’, ‘id’ => $post, ); do_action( ‘publishpressfuture_schedule_expiration’, $post, $timestamp, $opts ); //postexpirator_schedule_event( $post, $date->getTimestamp(), $opts ); } add_action(‘pending_requests’, ‘CCC_add_expiring_date_request’, 10, 1);

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Wrong Expiring Date’ is closed to new replies.