Changeset 9097 for trunk/wp-includes/link-template.php
- Timestamp:
- 10/07/2008 10:41:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.