[wp-trac] [WordPress Trac] #21995: (get/the)_archive_title and (get/the)_archive_description functions
WordPress Trac
noreply at wordpress.org
Sun Mar 3 14:19:09 UTC 2013
#21995: (get/the)_archive_title and (get/the)_archive_description functions
------------------------------------+------------------
Reporter: thomask | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 3.6
Component: Template | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+------------------
Comment (by mdgl):
I like the idea of this and believe we should in general be doing more to
address the needs of theme/plugin developers. I would like however to
make a few comments on the first-cut patch from DrewAPicture:
1) The code probably intends to make use of `sprintf()` rather than
`printf()`.
2) Function `the_archive_title()` is starting to look very similar to
`wp_title()` and I wonder whether there is an opportunity to generalise
and/or share more code between these functions (e.g. create
`the_page_title()` applying to any form of page not just archives and
merge code with `wp_title()`). See also comment:4.
3) For custom taxonomies, rather than just printing "Taxonomy Archives" we
should probably refer to the name of the particular taxonomy as already
happens with `category` and `post_tag`, so for example:
{{{
} elseif ( is_tax() ) {
$term = get_queried_object();
$tax = get_taxonomy( $term->taxonomy );
$title = sprintf( __( '%1$s Archives: %2$s' ), '<span>' .
$tax->labels->singular_name . '</span>', '<span>' . single_term_title( '',
false ) . '</span>' );
}
}}}
A moot point is then whether the `<span>` elements would need to be
distinguished for styling.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21995#comment:13>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list