• 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)
  • Thread Starter Guillermo Figueredo

    (@cleftune)

    *I am happy to share the staging site separately via email

    Plugin Author Steve Burge

    (@stevejburge)

    Hi @cleftune. Thanks for using PublishPress Future.

    We do have code samples on our site: https://publishpress.com/knowledge-base/programmatically-schedule-actions/

    However, we’re not able to support custom code here for Free users on www.ads-software.com.

    Thread Starter Guillermo Figueredo

    (@cleftune)

    Yes, we are using that code.

    We are going to test is trying to add the function on another action, but there seems to be an incompatibility that was not there before.

    The code was working until recently.

    Thread Starter Guillermo Figueredo

    (@cleftune)

    We are very happy with your plugin, and if you can assist us with this issue we would be more than happy to pay for that. Either by buying the pro version or just paying directly for a fix of this issue. For some reason, no matter where I use the function, the expire date is always today+1. We dont know when and why it stopped working as expected.

    Plugin Support Riza Maulana Ardiyanto

    (@rizaardiyanto)

    @cleftune Sorry our support option is limited, and it’s not included on troubleshooting custom code on our plugin.

    You might want to consider hire dedicated developer on this.

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