Created
February 24, 2019 23:17
-
-
Save spivurno/961aae8e182d5bee0b75c67807f596a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👉 This Gist has been migrated to the Gravity Wiz Snippet Library:
https://github.com/gravitywiz/snippet-library/blob/master/gp-nested-forms/gpnf-hourly-cron.php