From fcc158c8e5413a25ca4d7c0fa683f0bc59e27c70 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Fri, 3 Jun 2016 12:41:59 +0200 Subject: [PATCH] cron now WORKS! --- cronplus.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cronplus.php b/cronplus.php index 990f46a..6dfaeab 100644 --- a/cronplus.php +++ b/cronplus.php @@ -35,12 +35,13 @@ function __construct( $args ) { $defaults = array( 'recurrence' => 'hourly', // Hourly,daily,twicedaily,weekly,monthly 'name' => 'cronplus', - 'schedule' => 'schedule' // Schedule or single + 'schedule' => 'schedule', // Schedule or single, + 'cb' => '' ); $this->args = wp_parse_args( $args, $defaults ); - if ( isset( $this->cb ) && isset( $this->name ) ) { - add_action( $this->args[ 'name' ], $this->cb ); + if ( isset( $this->args['cb'] ) && isset( $this->args['name'] ) ) { + add_action( $this->args[ 'name' ], $this->args['cb'] ); } }