mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00: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.
|
* @param int $max_page Optional. Max pages.
|
||||||
* @return string|null
|
* @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;
|
global $paged, $wp_query;
|
||||||
|
|
||||||
if ( !$max_page )
|
if ( !$max_page )
|
||||||
@ -1590,6 +1590,9 @@ function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
|
|||||||
|
|
||||||
$nextpage = intval($paged) + 1;
|
$nextpage = intval($paged) + 1;
|
||||||
|
|
||||||
|
if ( null === $label )
|
||||||
|
$label = __( 'Next Page »' );
|
||||||
|
|
||||||
if ( !is_single() && ( $nextpage <= $max_page ) ) {
|
if ( !is_single() && ( $nextpage <= $max_page ) ) {
|
||||||
$attr = apply_filters( 'next_posts_link_attributes', '' );
|
$attr = apply_filters( 'next_posts_link_attributes', '' );
|
||||||
return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) . '</a>';
|
return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) . '</a>';
|
||||||
@ -1605,7 +1608,7 @@ function get_next_posts_link( $label = 'Next Page »', $max_page = 0 ) {
|
|||||||
* @param string $label Content for link text.
|
* @param string $label Content for link text.
|
||||||
* @param int $max_page Optional. Max pages.
|
* @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 );
|
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.
|
* @param string $label Optional. Previous page link text.
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
function get_previous_posts_link( $label = '« Previous Page' ) {
|
function get_previous_posts_link( $label = null ) {
|
||||||
global $paged;
|
global $paged;
|
||||||
|
|
||||||
|
if ( null === $label )
|
||||||
|
$label = __( '« Previous Page' );
|
||||||
|
|
||||||
if ( !is_single() && $paged > 1 ) {
|
if ( !is_single() && $paged > 1 ) {
|
||||||
$attr = apply_filters( 'previous_posts_link_attributes', '' );
|
$attr = apply_filters( 'previous_posts_link_attributes', '' );
|
||||||
return '<a href="' . previous_posts( false ) . "\" $attr>". preg_replace( '/&([^#])(?![a-z]{1,8};)/', '&$1', $label ) .'</a>';
|
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.
|
* @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 );
|
echo get_previous_posts_link( $label );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user