Skip to content

Instantly share code, notes, and snippets.

@spivurno
Created February 24, 2019 23:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spivurno/961aae8e182d5bee0b75c67807f596a2 to your computer and use it in GitHub Desktop.
Save spivurno/961aae8e182d5bee0b75c67807f596a2 to your computer and use it in GitHub Desktop.
<?php
/**
* Gravity Perks // Nested Forms // Hourly Cron & Orphaned Entry Expiration
* http://gravitywiz.com/documentation/gravity-forms-nested-forms/
*/
function gpnf_custom_hourly_cron() {
if( ! is_callable( 'gp_nested_forms' ) ) {
return;
}
if ( ! wp_next_scheduled( 'gpnf_hourly_cron' ) ) {
wp_schedule_event( time(), 'hourly', 'gpnf_hourly_cron' );
}
add_action( 'gpnf_hourly_cron', array( gp_nested_forms(), 'daily_cron' ) );
}
gpnf_custom_hourly_cron();
add_filter( 'gpnf_expiration_modifier', function() {
return HOUR_IN_SECONDS;
} );
@spivurno
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment