[wp-trac] [WordPress Trac] #56215: Introduce `is_term_publicly_viewable()` function
WordPress Trac
noreply at wordpress.org
Wed Jul 13 22:01:13 UTC 2022
#56215: Introduce `is_term_publicly_viewable()` function
-------------------------+------------------------------------------
Reporter: johnbillion | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version:
Severity: normal | Keywords: needs-patch needs-unit-tests
Focuses: |
-------------------------+------------------------------------------
In #49380 the `is_post_publicly_viewable()` function was introduced which
encapsulates the logic used to determine if a post type is visible to
anonymous users.
We should do the same for terms via an `is_term_publicly_viewable()`
function. Although the logic for terms is more straight forward this
serves the same purpose as introducing the corresponding function for
posts -- to centralise and reduce the logic needed to validate a term and
determine if it's publicly viewable.
There are several places in core that would benefit from an additional
"viewable" check before outputting a link to a term, but those changes can
happen in a follow-up ticket.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56215>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list