So your constructor is probably not being executed before the cron event is being run. If your instantiating the fb_linter class too late then your call to add_action
won’t happen in time. Try using the singleton design pattern for your class and then instantiate it right after you declare it and it should work just fine.
something like
class fb_linter {
public static function get_instance(){
static $instance;
if( ! isset( $instance ) )
$instance = new self();
return $instance;
}
...
}
fb_linter::get_instance();
Related Posts:
- Should I disable WP_CRON and instead trigger wp-cron.php from server every few mins?
- Do WordPress cron jobs slow down page loading?
- PHP Warning on fresh install (Connection timed out)
- Is there a known vulnerability for wp-cron.php?
- WordPress cron isn’t scheduled on amazon web services
- Using wp_schedule_single_event with arguments to send email
- How to use wp_schedule_event in a class?
- Run WP Cron Weekly (but on a certain day)
- wp_schedule_event() on specific time, daily
- wp_next_scheduled returning a past timestamp
- Do wp-cron scheduled tasks run asynchronously?
- Some rogue WordPress plugin killing my server – how do I isolate and kill it?
- WP CRON runs only the first time
- Run a cron job (or similar) in the background of WP after post update/create
- wp-cron still running even though DISABLE_WP_CRON is true
- How to set up WP Cron in this scenario
- WP-Cron tasks scheduled but not running
- Can’t find wp-cron.php but I can see it in the public folder [closed]
- WordPress wp-cron not working
- Why cron doesn’t work to me?
- Wp cron event is set but the function isn’t getting fired
- Is doing_wp_cron a necessary query string when scheduling cron.php as a cron job?
- Run a php file daily at specific time
- Scheduling posts on wordpress adds wrong seconds as post_date
- WordPress Cron is scheduled but not running
- How to make WordPress emails async
- How to execute existing WP Cron programmatically
- Cleaning “cron” from options table, will affect anything?
- debugging wp_cron jobs with XDebug in Eclipse
- wp_schedule_event run in background or not?
- How to code schedule / cron job
- Cron schedule not updating after run
- How to schedule and publish a post after it’s ready?
- Can you register two cron events in a single function?
- wp_schedule_single_event does not call my action
- Hourly scheduled wp_cron job keeps getting rescheduled
- wp-cron.php – timeout
- Failed to open stream: HTTP request failed! in \wamp\www\wordpress\wp-includes\class-http.php on line 929
- WP Cron jobs loops infinitely
- Scheduling a cron job from a function that is ran outside functions.php?
- wp-cron behaviour when there are multiple queued tasks
- Why is `wp_unschedule_event` not working
- WordPress Cron Job Not working
- WordPress action hooks related to scheduled posts not Fired
- Cron Job Keep Running in spite of being disabled
- How to create a WP Cron hooks based on schedules from Advanced cron manager plugin?
- Cron job not working – Can’t see in the queue attached
- Sending email to all users
- How to force ‘cron_schedules’ every minute instead 1 hour?
- WordPress, how to run a function every 12 december?
- When running WordPress Cron manually, it shows WP-Cron spawning is disabled. What is WP-Cron spawning?
- Cron job to run just once per day using external cron service
- How to know if a script started by wp_cron is still active?
- wp_schedule_event – function won’t execute
- WordPress cron creation during plugin installation results with initial execution
- WordPress cron hooks – same callback for completely different action?
- Manually running cron from the server
- How to solve cron problem in WordPress?
- Cron jobs when running multiple instances on the same DB
- WordPress Cron job, 302 response
- How to periodically roll back WordPress to a fixed point in time?
- Send Weekly Email if Users have not complete their profiles
- my wp schedule event is not working
- WP-Cron function not firing
- WP Cron scheduling doesn’t work reliably on hosted server
- Time limit on long cron job?
- Call to undefined function wp_create_category()
- WP-Cron called by separate server
- WP_cron keeps going back to the past
- How to run correctly wordpress cron from Cpanel
- Cron and request with wp_remote_post
- Real cron killed my cron system. Only define( ‘ALTERNATE_WP_CRON’, true ); works
- Unknown requests on my WP Site
- wp_schedule_event doesn’t work
- WordPress CRON job working when reloading the page
- What am I doing wrong creating post draft via wp-cron? (wp_schedule_event & wp_insert_post)
- WP cron and update post meta
- Run external file cron using WordPress Scheduler
- WP-Cron system doesn’t work on server
- Cron Job Scheduling in wordpress
- Schedule reminder at exact time
- Schedule Removal of Menu Page and Shortcode
- Sending emails to separate accounts using a for loop
- daily job to run send email based on user data
- Huge cron option_value into wp_options table
- setting up a wp cron job
- Cron Lock Timeout, when to use?
- Regenerating array key for wp_schedule_event args
- WP cron Executes once and doesnt repeat
- wp-cron not working
- how to crate cronjo not depending on user access
- Cron event running more than once if triggered from WP Crontrol
- wp_privacy_delete_old_export_files, failed to run
- How to Auto Update WordPress Post after specific time?
- Change a Post’s Status based on the date from a custom field? (for Event posts)
- Multiple conditional logic in Custom Event In WP_ Cron not working
- Update last created post in custom post types with wp_cron()?
- wp_schedule_event with dynamic names but same function
- Definition of page load for WP-Cron?
- Protect wp-cron from hackers