Translate default link labels for *posts_link(). Props nathanrice, CharlesClarkson. fixes #16998

git-svn-id: http://svn.automattic.com/wordpress/trunk@17728 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-04-27 21:25:09 +00:00
parent ff9610e36d
commit 8e21f7f098

View File

@ -1579,7 +1579,7 @@ function next_posts( $max_page = 0, $echo = true ) {
* @param int $max_page Optional. Max pages.
* @return string|null
*/
function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
function get_next_posts_link( $label = null, $max_page = 0 ) {
global $paged, $wp_query;
if ( !$max_page )
@ -1589,6 +1589,9 @@ function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
$paged = 1;
$nextpage = intval($paged) + 1;
if ( null === $label )
$label = __( 'Next Page »' );
if ( !is_single() && ( $nextpage <= $max_page ) ) {
$attr = apply_filters( 'next_posts_link_attributes', '' );
@ -1605,7 +1608,7 @@ function get_next_posts_link( $label = 'Next Page &raquo;', $max_page = 0 ) {
* @param string $label Content for link text.
* @param int $max_page Optional. Max pages.
*/
function next_posts_link( $label = 'Next Page &raquo;', $max_page = 0 ) {
function next_posts_link( $label = null, $max_page = 0 ) {
echo get_next_posts_link( $label, $max_page );
}
@ -1655,9 +1658,12 @@ function previous_posts( $echo = true ) {
* @param string $label Optional. Previous page link text.
* @return string|null
*/
function get_previous_posts_link( $label = '&laquo; Previous Page' ) {
function get_previous_posts_link( $label = null ) {
global $paged;
if ( null === $label )
$label = __( '&laquo; Previous Page' );
if ( !is_single() && $paged > 1 ) {
$attr = apply_filters( 'previous_posts_link_attributes', '' );
return '<a href="' . previous_posts( false ) . "\" $attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/', '&#038;$1', $label ) .'</a>';
@ -1672,7 +1678,7 @@ function get_previous_posts_link( $label = '&laquo; Previous Page' ) {
*
* @param string $label Optional. Previous page link text.
*/
function previous_posts_link( $label = '&laquo; Previous Page' ) {
function previous_posts_link( $label = null ) {
echo get_previous_posts_link( $label );
}