get_previous_posts_link

Definition:
function get_previous_posts_link( $label = null ) {}

Return the previous posts page link.

Parameters

  • string $label: Optional. Previous page link text.

Defined filters

  • previous_posts_link_attributes
    apply_filters( 'previous_posts_link_attributes', '' )

Source code

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>';

	}

}

1643

No comments yet... Be the first to leave a reply!

Leave a comment