Changeset 28398 for trunk/src/wp-includes/post-template.php
- Timestamp:
- 05/15/2014 12:43:40 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-template.php
r28383 r28398 740 740 ); 741 741 742 $ r= wp_parse_args( $args, $defaults );742 $params = wp_parse_args( $args, $defaults ); 743 743 744 744 /** … … 747 747 * @since 3.0.0 748 748 * 749 * @param array $r An array of arguments for page links for paginated posts. 750 */ 751 $r = apply_filters( 'wp_link_pages_args', $r ); 752 extract( $r, EXTR_SKIP ); 749 * @param array $params An array of arguments for page links for paginated posts. 750 */ 751 $r = apply_filters( 'wp_link_pages_args', $params ); 753 752 754 753 global $page, $numpages, $multipage, $more; … … 756 755 $output = ''; 757 756 if ( $multipage ) { 758 if ( 'number' == $ next_or_number) {759 $output .= $ before;757 if ( 'number' == $r['next_or_number'] ) { 758 $output .= $r['before']; 760 759 for ( $i = 1; $i <= $numpages; $i++ ) { 761 $link = $ link_before . str_replace( '%', $i, $pagelink ) . $link_after;762 if ( $i != $page || ! $more && 1 == $page ) 760 $link = $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after']; 761 if ( $i != $page || ! $more && 1 == $page ) { 763 762 $link = _wp_link_page( $i ) . $link . '</a>'; 764 763 } 765 764 /** 766 765 * Filter the HTML output of individual page number links. … … 772 771 */ 773 772 $link = apply_filters( 'wp_link_pages_link', $link, $i ); 774 $output .= $ separator. $link;773 $output .= $r['separator'] . $link; 775 774 } 776 $output .= $ after;775 $output .= $r['after']; 777 776 } elseif ( $more ) { 778 $output .= $ before;779 $ i= $page - 1;780 if ( $ i) {781 $link = _wp_link_page( $ i ) . $link_before . $previouspagelink . $link_after. '</a>';777 $output .= $r['before']; 778 $prev = $page - 1; 779 if ( $prev ) { 780 $link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>'; 782 781 783 782 /** This filter is documented in wp-includes/post-template.php */ 784 $link = apply_filters( 'wp_link_pages_link', $link, $ i);785 $output .= $ separator. $link;783 $link = apply_filters( 'wp_link_pages_link', $link, $prev ); 784 $output .= $r['separator'] . $link; 786 785 } 787 $ i= $page + 1;788 if ( $ i<= $numpages ) {789 $link = _wp_link_page( $ i ) . $link_before . $nextpagelink . $link_after. '</a>';786 $next = $page + 1; 787 if ( $next <= $numpages ) { 788 $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>'; 790 789 791 790 /** This filter is documented in wp-includes/post-template.php */ 792 $link = apply_filters( 'wp_link_pages_link', $link, $ i);793 $output .= $ separator. $link;791 $link = apply_filters( 'wp_link_pages_link', $link, $next ); 792 $output .= $r['separator'] . $link; 794 793 } 795 $output .= $ after;794 $output .= $r['after']; 796 795 } 797 796 } … … 802 801 * @since 3.6.0 803 802 * 804 * @param string $ outputHTML output of paginated posts' page links.803 * @param string $html HTML output of paginated posts' page links. 805 804 * @param array $args An array of arguments. 806 805 */ 807 $ output= apply_filters( 'wp_link_pages', $output, $args );808 809 if ( $ echo )810 echo $ output;811 812 return $ output;806 $html = apply_filters( 'wp_link_pages', $output, $args ); 807 808 if ( $r['echo'] ) { 809 echo $html; 810 } 811 return $html; 813 812 } 814 813
Note: See TracChangeset
for help on using the changeset viewer.