18. 関数のカスタマイズ例(旧)
$dayswithposts = $wpdb->get_results(
"SELECT DISTINCT DAYOFMONTH(post_date)
FROM $wpdb->posts
WHERE post_date >= '{$thisyear}-{$thismonth}-01 00:00:00'
AND post_type = 'post' AND post_status = 'publish'
AND post_date <=
'{$thisyear}-{$thismonth}-{$last_day} 23:59:59'",
ARRAY_N
);
19. 関数のカスタマイズ例(新)
$dayswithposts = $wpdb->get_results(
"SELECT DISTINCT DAYOFMONTH(meta_value)
FROM $wpdb->posts
INNER JOIN $wpdb->postmeta ON ID = post_id
WHERE post_type = '${custom}'
AND post_status = 'publish'
AND meta_key = 'event_date'
AND meta_value BETWEEN '${st}' AND '${ed}' ",
ARRAY_N
);