Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'cron_schedules', function ( $schedules ) {
- $schedules['one_minute'] = [ 'interval' => 60, 'display' => esc_html__( 'Every Minute' )];
- return $schedules;
- });
- add_action('init', function(){
- if ( ! wp_next_scheduled( $this->prefixed.'cron_hook1' ) ) {
- wp_schedule_event( time(), 'one_minute', $this->prefixed.'cron_hook1', $this->cron_params );
- }
- });
- add_action( $this->prefixed.'cron_hook1', [$this, 'cron_func'], 10, 1 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement