v1.2.0: public articles, and a login gate for everything else
An article can now be marked Public, making it readable by its own link
without a login. A new Visibility meta box carries the flag and shows the
shareable link; a Visibility column on the list view makes it clear at a
glance which articles are exposed.
The flag only means something once the rest is closed, and nothing was
closed before: the shortcode page has no visitor restriction, and both
AJAX endpoints registered nopriv handlers with no capability check, so
every article was already readable by anyone. So this also adds the gate:
- get_article serves a logged-out visitor only a flagged-public article.
- get_articles (the index and the search over it) always requires a login,
so a public article is reachable by its link but is not discoverable by
browsing or searching. - The front end shows a public article without a back button, since there
is no index for that visitor, and shows a login prompt for anything
else, including a bare /help/. - REST: the post type keeps show_in_rest so the block editor still works,
but core's check_read_permission grants anonymous reads to anything with
post_status publish regardless ofpublic— which would have served
every article from /wp-json/wp/v2/help_article and made the flag
meaningless. A rest_pre_dispatch guard now requires a login on that
route. Editors authenticate by cookie, so it costs them nothing.
Note on deploy: no article is flagged public, so the Support Center
becomes members-only until the box is ticked on whichever articles should
stay open.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com