get_previous_comments_link( string $label = '' )
Retrieves the link to the previous comments page.
描述
参数
- $label
-
(string)
(Optional)
Label for comments link text.Default value: ''
返回值
(string|void) HTML-formatted link for the previous page of comments.
源代码
File: wp-includes/link-template.php
function get_previous_comments_link( $label = '' ) {
if ( ! is_singular() )
return;
$page = get_query_var('cpage');
if ( intval($page) <= 1 )
return;
$prevpage = intval($page) - 1;
if ( empty($label) )
$label = __('« Older Comments');
/**
* Filters the anchor tag attributes for the previous comments page link.
*
* @since 2.7.0
*
* @param string $attributes Attributes for the anchor tag.
*/
return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace('/&([^#])(?![a-z]{1,8};)/i', '&$1', $label) .'</a>';
}
更新日志
Version | 描述 |
---|---|
2.7.1 | Introduced. |
相关函数
Uses
-
wp-includes/l10n.php:
__() -
wp-includes/formatting.php:
esc_url() -
wp-includes/query.php:
is_singular() -
wp-includes/query.php:
get_query_var() -
wp-includes/link-template.php:
get_comments_pagenum_link() -
wp-includes/link-template.php:
previous_comments_link_attributes -
wp-includes/plugin.php:
apply_filters()
Show 2 more uses
Used By
-
wp-includes/link-template.php:
get_the_comments_navigation() -
wp-includes/link-template.php:
previous_comments_link()
你可能对这些文章感兴趣:
- wordpress函数get_the_posts_navigation()用法示例
- wordpress函数get_the_title()用法示例
- wordpress函数get_the_terms()用法示例
- wordpress函数get_the_tags()用法示例
- wordpress函数get_the_taxonomies()用法示例
- wordpress函数get_the_posts_pagination()用法示例
- wordpress函数get_the_permalink()用法示例
- wordpress函数get_the_password_form()用法示例
- wordpress函数get_the_modified_date()用法示例
- wordpress函数get_the_modified_time()用法示例
- wordpress函数get_the_modified_author()用法示例
- wordpress函数get_the_guid()用法示例
- wordpress函数get_the_ID()用法示例
- wordpress函数get_the_excerpt()用法示例
如有疑问,请前往问答中心反馈!
反馈