[wp-trac] [WordPress Trac] #21949: Allow private taxonomies (public = false)
WordPress Trac
noreply at wordpress.org
Thu Oct 1 20:16:14 UTC 2015
#21949: Allow private taxonomies (public = false)
--------------------------------+---------------------------
Reporter: wpsmith | Owner: boonebgorges
Type: enhancement | Status: reopened
Priority: normal | Milestone: 4.4
Component: Taxonomy | Version:
Severity: normal | Resolution:
Keywords: has-patch rest-api | Focuses:
--------------------------------+---------------------------
Comment (by boonebgorges):
Hey mboynes - Sorry for any unintended breakage.
My first impression is that your technique is kinda weird :) The 'public'
argument previously didn't do anything except provide a default for
'show_ui' and 'show_in_nav_menus', and it *didn't* do what you wanted it
to do, namely to prevent the terms from being queried.
As for your suggestion: I assume that the reason why we allow non-public
taxonomies to register rewrite rules and then control access during
`parse_request()` is because *post types* do it that way, and as far as I
can see, have done it that way since the feature was introduced [12923].
So the question is: is there any legitimate reason why one would want to
register a rewrite rule that can never be tripped because of a block in
`parse_request()`? I can think of a couple possibilities: (1) rewrite
rules are not generated on the fly, which means that switching a
post_type/taxonomy to public would not automatically register the rules;
(2) currently, you can use the 'parse_request' action to override some of
the access protection in `parse_request()`, a task which would be
(arguably) more complex if the rewrite rules weren't registered.
I guess I don't have a particular problem making the change that mboynes
is suggesting, but it'd be nice to have someone else weigh in. Is there a
reason, other than "we've always done it this way", why we let non-public
post types register their rewrite rules?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21949#comment:25>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list