Query post types based on timestamp

This seemed to work, please let me know if you have a better method:

$profiles = Profile::get([
    'post_status' => [
        'publish', 'draft', 'pending', 'private'
    ],
    'posts_per_page' => -1,
    'meta_query' => [
        'relation' => 'OR',
        [
            'key' => 'azure_picture_expiration',
            'value' => strtotime('+2 days'),
            'compare' => '<=',
        ],
        [
            'key' => 'azure_picture_big_expiration',
            'value' => strtotime('+2 days'),
            'compare' => '<=',
        ],
    ],
]);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top