[wp-trac] [WordPress Trac] #21995: (get/the)_archive_title and (get/the)_archive_description functions

WordPress Trac noreply at wordpress.org
Tue Nov 4 17:19:49 UTC 2014


#21995: (get/the)_archive_title and (get/the)_archive_description functions
---------------------------------------------+--------------------------
 Reporter:  thomask                          |       Owner:  johnbillion
     Type:  feature request                  |      Status:  closed
 Priority:  normal                           |   Milestone:  4.1
Component:  Themes                           |     Version:  trunk
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch twenty-fifteen commit  |     Focuses:  template
---------------------------------------------+--------------------------

Comment (by McGuive7):

 I know this just went through, but I have a suggestion for improvement. .
 .

 Some of the generated titles have essentially hardcoded prefixes within
 them. For example: `__( 'Category: %s' )` and `__( 'Author: %s' )`.

 Since this text is prepended to the title before it is is passed to the
 `get_the_archive_title` filter, it now necessitates some more complicated
 string replacement to remove/change the prefix, right? My suggestion is to
 simply assign these "prefixes" to a `$prefix` variable, which is either
 filterable, or added via the `get_the_archive_title` filter so that it can
 easily be unhooked.

 Anyone else think this is worth doing? I ask because I've often needed to
 change these prefixes as per client requests to things like the plural
 label  of a custom post type (e.g. Cars: ) or a more intuitive title for a
 date archive (e.g. Archive for May, 12 2014).

 Happy to create a patch if others aren't opposed to this change. Thoughts?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/21995#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list