norcross/yourls-link-creator

Cron job generating notices

Closed this issue · 0 comments

The cron function yourls_click_cron() was generating a PHP Notice for every post it looped through:

PHP Notice: Trying to get property of non-object in admin/wp-includes/query.php on line 3628

I tracked it down to line 596 setup_postdata($post); I can't see why that should be there, it serves no purpose and is trying to send a string (since you are only fetching IDs in your query) when that function is expecting a post object. I think you left it in by mistake as its on the same line as the foreach and you must have missed it when you had finished testing something.

Anyway removing that function call prevents any errors and everything continues to function as normal.