wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes
get_previous_comments_link › WordPress Function
Depuis2.7.1
Dépréciéen/a
› get_previous_comments_link ( $label = '' )
Paramètres: |
|
Retourne: |
|
Défini(e) dans: |
|
Codex: |
Retrieves the link to the previous comments page.
Fonctions en relation: previous_comments_link, get_previous_posts_link, get_previous_post_link, get_previous_image_link, get_edit_comment_link
Source
function get_previous_comments_link( $label = '' ) { if ( ! is_singular() ) { return; } $page = get_query_var( 'cpage' ); if ( (int) $page <= 1 ) { return; } $previous_page = (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. */ $attr = apply_filters( 'previous_comments_link_attributes', '' ); return sprintf( '<a href="%1$s" %2$s>%3$s</a>', esc_url( get_comments_pagenum_link( $previous_page ) ), $attr, preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) ); }