[wp-trac] [WordPress Trac] #56954: Add action or constant 'doing_sitemap'
WordPress Trac
noreply at wordpress.org
Wed Nov 2 11:23:48 UTC 2022
#56954: Add action or constant 'doing_sitemap'
-------------------------+-----------------------------
Reporter: Cybr | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Sitemaps | Version:
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
At `WP_Sitemaps_Renderer::render_sitemap()` and
`WP_Sitemaps_Renderer::render_index()`, all preliminary checks for proper
sitemap display have been conducted.
To verify we're on an actual sitemap output page, it'd be helpful to have
a constant or function asserting we reached this state. Such as `define(
'DOING_SITEMAP', true );`.
A use case I'm facing is filtering posts in archives from visitors but not
necessarily search engines.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56954>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list