[wp-trac] [WordPress Trac] #38545: Add span element to get_the_archive_title()

WordPress Trac noreply at wordpress.org
Sat Jul 4 14:43:47 UTC 2020


#38545: Add span element to get_the_archive_title()
---------------------------------------------+-----------------------
 Reporter:  Kaira                            |       Owner:  ocean90
     Type:  enhancement                      |      Status:  closed
 Priority:  normal                           |   Milestone:  5.5
Component:  Themes                           |     Version:  4.6.1
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note commit  |     Focuses:  template
---------------------------------------------+-----------------------
Changes (by ocean90):

 * status:  reviewing => 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/38545#comment:98>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list