ldc-poule-et-toque/content/plugins/ninja-forms/lib/NF_UpgradeThrottle.php
Thibault Richy e8eb4f3c6f Init wp
2018-08-10 10:36:18 +02:00

16 lines
424 B
PHP

<?php if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Upgrade Throttle
* @param int $threshold
* @option int $compare
* @return bool
*/
function ninja_forms_three_throttle( $threshold = 25 ) {
$compare = get_option( 'ninja_forms_three_throttle', 0 );
if( ! $compare ){
$compare = rand( 1, 100 );
update_option( 'ninja_forms_three_throttle', $compare );
}
return ( $threshold >= $compare );
}