[wp-trac] [WordPress Trac] #21995: (get/the)_archive_title and (get/the)_archive_description functions
WordPress Trac
noreply at wordpress.org
Wed Nov 5 14:32:43 UTC 2014
#21995: (get/the)_archive_title and (get/the)_archive_description functions
---------------------------------------------+--------------------------
Reporter: thomask | Owner: johnbillion
Type: feature request | Status: reopened
Priority: normal | Milestone: 4.1
Component: Themes | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch twenty-fifteen commit | Focuses: template
---------------------------------------------+--------------------------
Comment (by Frank Klein):
> 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?
The filter doesn't restrict you to doing string replacement, you can
create your own string with whatever you want and return that. Using a
prefix variable is not only not needed, because of the filter, but also
very difficult to use, as this would have to be an array with keys for the
different contexts.
So the filter allows you to do everything you could do with that variable
you propose, and the filter is way easier to use and in line with how
WordPress handles similar cases.
> Moreover, please don't think just in English. Other languages may need
to change the titles and provide more context; trying to handle this with
the translation sometimes is not enough.
The current code already handles context via the `_x()` function. I think
we should leave it up to the translators to see whether they can make this
work for their language or not. We can always reopen when that need
arises, which I doubt.
> read out of context, they don't give enough information about the page.
Is this a single post title? Is this a generic list? Is a chronological
archive? Please don't think just visually.
Considering that this code comes from Underscores, an open source project
that gets reviewed regularly by contributors with accessibility
experience, I don't think this is a problem. Also, you can always filter
if you want to change the implementation in your theme.
Proposing to close.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21995#comment:45>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list