[WordPress]対象投稿タイプの投稿が存在する年だけ取得
public function get_archive_years($options = array()) { $options = array_merge( array('post_type' => 'xxx', 'type' => 'yearly', 'after' => "<format>%s,</format>", 'echo' => 0), $options ); $tmp = wp_get_archives($options); $tmp = explode(",", $tmp); array_pop($tmp); return $tmp; }