wp-cron not working

function cron_daily_whatever() { if (!wp_next_scheduled(‘check_daily_event’)) { wp_schedule_event(time(),’daily’,’check_daily_event’); } } function check_daily_event() { error_log(‘check’); } add_action(‘wp’,’cron_daily_whatever’); add_action(‘check_daily_event’,’check_daily_event’);

Run cronjob with browser request

You’d be better off using the wordpress API: function wp_register_cron_endpoint() { register_rest_route( ‘crons’, ‘/run_cron’, array( ‘methods’ => ‘GET’, ‘callback’ => ‘run_crons’ )); } add_action( ‘rest_api_init’, ‘wp_register_cron_endpoint’ ); function run_crons(){ /*** Do whatever you want ***/ } Then you can hit http://example.com/crons/run_crons and you’ll A)Trigger wp_cron based on the wp_load and B) Do whatever you want … Read more

How to execute add_action() function from custom plugin to Crontrol plugin or do_action()?

I didn’t call the class yet, this code is now working class Scheduler { public $setup; public static $instance; public function __construct() { self::$instance =& $this; add_action(‘scheduler’, [$this, ‘etf_scheduler_func’]); } public function etf_scheduler_func() { $this->setup = new Setup(); $this->setup->set_table(); } public static function &get_instance() { if ( ! isset( self::$instance ) ) self::$instance = new … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)