Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

1
  • If your first error_log call is displaying then the issue is not cron. When you say it doesn't go further than my_cron_job though, how are you testing that? Are you checking if wp_insert_post succeeded? I see you've used array($this, 'schedule_cron_job') but schedule_cron_job and my_cron_job are both static class methods which would mean your PHP error log is filling up with errors and warnings. Normally for static methods you would use [ 'NameOfClass', 'methodName' ] instead of [ $this, 'methodName' ], though I see no reason for the methods to be static here Commented Jun 6, 2024 at 9:49