Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Thank you very much, you are obviously right. However, I can't give up hoping that I still could use my existing data, as comparing the dates as numbers in my head would return the same results? Of course using your meta_query method, instead of filtering in php. Or am I completely wrong?
@nmr That is strange. As I state in the description, the code works in a template file. But not when I try to trigger it by a hook. In the first case, the log is filled with info, and the posts get their status changed. In the last case, nothing happens.