Metro_Sitemap::get_post_ids_for_date PHP Method

get_post_ids_for_date() public static method

Get a list of support post_type IDs for a given date
public static get_post_ids_for_date ( string $sitemap_date, $limit = 500 ) : array
$sitemap_date string Date in Y-m-d
return array IDs of posts
    public static function get_post_ids_for_date($sitemap_date, $limit = 500)
    {
        global $wpdb;
        $start_date = $sitemap_date . ' 00:00:00';
        $end_date = $sitemap_date . ' 23:59:59';
        $post_types_in = self::get_supported_post_types_in();
        return $wpdb->get_col($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_date >= %s AND post_date <= %s AND post_type IN ( {$post_types_in} ) ORDER BY post_date LIMIT %d", $start_date, $end_date, $limit));
    }