Changeset 9097
- Timestamp:
- 10/07/2008 10:41:51 PM (17 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r9025 r9097 1634 1634 'mid_size' => 2, 1635 1635 'type' => 'plain', 1636 'add_args' => false // array of query args to add 1636 'add_args' => false, // array of query args to add 1637 'add_fragment' => '' 1637 1638 ); 1638 1639 … … 1658 1659 if ( $add_args ) 1659 1660 $link = add_query_arg( $add_args, $link ); 1661 $link .= $add_fragment; 1660 1662 $page_links[] = "<a class='prev page-numbers' href='" . clean_url($link) . "'>$prev_text</a>"; 1661 1663 endif; … … 1670 1672 if ( $add_args ) 1671 1673 $link = add_query_arg( $add_args, $link ); 1674 $link .= $add_fragment; 1672 1675 $page_links[] = "<a class='page-numbers' href='" . clean_url($link) . "'>$n</a>"; 1673 1676 $dots = true; … … 1683 1686 if ( $add_args ) 1684 1687 $link = add_query_arg( $add_args, $link ); 1688 $link .= $add_fragment; 1685 1689 $page_links[] = "<a class='next page-numbers' href='" . clean_url($link) . "'>$next_text</a>"; 1686 1690 endif; -
trunk/wp-includes/link-template.php
r8961 r9097 816 816 } 817 817 818 $result .= '#comments'; 819 818 820 $result = apply_filters('get_comments_pagenum_link', $result); 819 821 … … 832 834 $page = 1; 833 835 834 if ( !$page )835 $page = 1;836 837 836 $nextpage = intval($page) + 1; 838 837 … … 859 858 $page = get_query_var('cpage'); 860 859 860 if ( !$page ) 861 $page = 1; 862 861 863 if ( $page <= 1 ) 862 864 return; … … 870 872 $attr = apply_filters( 'previous_comments_link_attributes', '' ); 871 873 echo "\" $attr>". preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $label) .'</a>'; 874 } 875 876 /** Create pagination links for the comments on the current post 877 * 878 * @package WordPress 879 * @see paginate_links 880 * @since 2.7 881 * 882 * @param string|array $args Optional args. See paginate_links. 883 * @return string Markup for pagination links 884 */ 885 function paginate_comments_links($args = array()) { 886 global $wp_query; 887 888 if ( !is_singular() ) 889 return; 890 891 $page = get_query_var('cpage'); 892 if ( !$page ) 893 $page = 1; 894 $max_page = $wp_query->max_num_comment_pages; 895 $defaults = array( 896 'base' => add_query_arg( 'cpage', '%#%' ), 897 'format' => '', 898 'total' => $max_page, 899 'current' => $page, 900 'echo' => true, 901 'add_fragment' => '#comments' 902 ); 903 $args = wp_parse_args( $args, $defaults ); 904 $page_links = paginate_links( $args ); 905 906 if ( $args['echo'] ) 907 echo $page_links; 908 else 909 return $page_links; 872 910 } 873 911
Note: See TracChangeset
for help on using the changeset viewer.