Skip to content

Commit

Permalink
Update misc.php
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronHolbrook authored Apr 8, 2019
1 parent fb9c010 commit daedf27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/misc.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,11 @@ function remove_filters_for_anonymous_class( $hook_name = '', $class_name = '',
function get_current_url_slug() {
return trim( get_current_url_path(), '/' );
}

/**
* Get a ever changing number that is grouped by a number of minutes
* Useful for nonces
*/
function get_minute_based_tick( int $minutes = 10 ) : float {
return ceil( time() / ( MINUTE_IN_SECONDS * $minutes ) );
}

0 comments on commit daedf27

Please sign in to comment.