On the default post
type, why does the has_archive
property equals to FALSE
?
$type_obj = get_post_type_object('post');
var_dump($type_obj->has_archive); // FALSE
On the default post
type, why does the has_archive
property equals to FALSE
?
$type_obj = get_post_type_object('post');
var_dump($type_obj->has_archive); // FALSE
You must be logged in to post a comment.
Late answer.
has_archive
applies only for therewrite
arguments.In Detail
If
has_archive
is set totrue
, then the$archive_slug
will get set to therewrite['slug']
argument. If then arewrite['with_front']
arg is set, then this one will get prepended. The result of this will then get added as rewrite rule:If
feeds
are set to true andhas_archive
also, then you’ll also get rewritten rules for feeds:The same principle applies for
rewrite['pages']
:Summed up:
If you ain’t got
has_archive
set totrue
, then any try to add rewrites forfeeds
,pages
or archives will end up with a big?
.