previous_posts

函数


previous_posts ( $echo = true )
参数
  • (bool)
    $echo
    Optional. Whether to echo the link. Default true.
    Required:
    Default: true
返回值
  • (string|void) The previous posts page link if `$echo = false`.
定义位置
  • wp-includes/link-template.php
    , line 2561
引入
0.71
弃用

Displays or retrieves the previous posts page link.

function previous_posts( $echo = true ) {
	$output = esc_url( get_previous_posts_page_link() );

	if ( $echo ) {
		echo $output;
	} else {
		return $output;
	}
}