mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
ff9610e36d
commit
8e21f7f098
@ -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 »', $max_page = 0 ) {
|
||||
* @param string $label Content for link text.
|
||||
* @param int $max_page Optional. Max pages.
|
||||
*/
|
||||
function next_posts_link( $label = 'Next Page »', $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 = '« Previous Page' ) {
|
||||
function get_previous_posts_link( $label = null ) {
|
||||
global $paged;
|
||||
|
||||
if ( null === $label )
|
||||
$label = __( '« 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};)/', '&$1', $label ) .'</a>';
|
||||
@ -1672,7 +1678,7 @@ function get_previous_posts_link( $label = '« Previous Page' ) {
|
||||
*
|
||||
* @param string $label Optional. Previous page link text.
|
||||
*/
|
||||
function previous_posts_link( $label = '« Previous Page' ) {
|
||||
function previous_posts_link( $label = null ) {
|
||||
echo get_previous_posts_link( $label );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user