
如何使用Poedit翻译WordPress主题
get_previous_comments_link ( $label = '' )
get_previous_comments_link函数是一个WordPress函数,用于检索指向前一个评论页面的链接的HTML标记: 这个函数接受一个可选的参数作为链接文本,并返回到上一个评论页面的链接的HTML标记。
检索到前一个评论页面的链接。
function get_previous_comments_link( $label = '' ) { if ( ! is_singular() ) { return; } $page = get_query_var( 'cpage' ); if ( (int) $page <= 1 ) { return; } $prevpage = (int) $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>'; }