[wp-trac] [WordPress Trac] #31237: improve get_the_archive_title() with new filter
WordPress Trac
noreply at wordpress.org
Sat Jul 4 14:43:47 UTC 2020
#31237: improve get_the_archive_title() with new filter
-------------------------+-----------------------
Reporter: ramiy | Owner: ocean90
Type: enhancement | Status: closed
Priority: normal | Milestone: 5.5
Component: Themes | Version: 4.1
Severity: normal | Resolution: fixed
Keywords: has-patch | Focuses: template
-------------------------+-----------------------
Changes (by ocean90):
* owner: (none) => ocean90
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"48294" 48294]:
{{{
#!CommitTicketReference repository="" revision="48294"
Themes: Introduce `get_the_archive_title_prefix` filter for changing the
prefix used for archive titles.
In `get_the_archive_title()` split the internal `$title` variable into
`$title` and `$prefix`. By using the new `get_the_archive_title_prefix`
filter the prefix can now wrapped with custom elements or removed
completely by using
{{{
add_filter( 'get_the_archive_title_prefix', '__return_empty_string' );
}}}
Also, wrap the title part with a `span` element and pass the original
title and prefix to the existing `get_the_archive_title` filter, allowing
further customization to the archive titles.
Props Kaira, milindmore22, shireling, grapplerulrich, audrasjb, desrosj,
Confridin, ramiy, ocean90.
Fixes #31237.
Fixes #38545.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31237#comment:16>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list