WordPress Version: 6.2
/**
* Displays or retrieves the previous posts page link.
*
* @since 0.71
*
* @param bool $display Optional. Whether to echo the link. Default true.
* @return string|void The previous posts page link if `$display = false`.
*/
function previous_posts($display = true)
{
$output = esc_url(get_previous_posts_page_link());
if ($display) {
echo $output;
} else {
return $output;
}
}