605 | | * 'next_or_number' - Default is 'number' (string). Indicates whether page |
606 | | * numbers should be used. Valid values are number and next. |
607 | | * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page. |
608 | | * of the bookmark. |
609 | | * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to |
610 | | * previous page, if available. |
611 | | * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in |
612 | | * the parameter string will be replaced with the page number, so Page % |
613 | | * generates "Page 1", "Page 2", etc. Defaults to %, just the page number. |
| 615 | * 'next_or_number' - Default is 'number' (string). Indicates whether page |
| 616 | * numbers should be used. Valid values are number and next. |
| 617 | * 'separator' - Default is ' ' (string). Text used between pagination links. |
| 618 | * 'nextpagelink' - Default is 'Next Page' (string). Text for link to next page. |
| 619 | * of the bookmark. |
| 620 | * 'previouspagelink' - Default is 'Previous Page' (string). Text for link to |
| 621 | * previous page, if available. |
| 622 | * 'pagelink' - Default is '%' (String).Format string for page numbers. The % in |
| 623 | * the parameter string will be replaced with the page number, so Page % |
| 624 | * generates "Page 1", "Page 2", etc. Defaults to %, just the page number. |
| 625 | * 'echo' - Default is 1 (integer). When not 0, this triggers the HTML to be |
| 626 | * echoed and then returned. |
633 | | 'before' => '<p>' . __('Pages:'), 'after' => '</p>', |
634 | | 'link_before' => '', 'link_after' => '', |
635 | | 'next_or_number' => 'number', 'nextpagelink' => __('Next page'), |
636 | | 'previouspagelink' => __('Previous page'), 'pagelink' => '%', |
637 | | 'echo' => 1 |
| 635 | 'before' => '<p>' . __( 'Pages:' ), |
| 636 | 'after' => '</p>', |
| 637 | 'link_before' => '', |
| 638 | 'link_after' => '', |
| 639 | 'next_or_number' => 'number', |
| 640 | 'separator' => ' ', |
| 641 | 'nextpagelink' => __( 'Next page' ), |
| 642 | 'previouspagelink' => __( 'Previous page' ), |
| 643 | 'pagelink' => '%', |
| 644 | 'echo' => 1 |
650 | | for ( $i = 1; $i < ($numpages+1); $i = $i + 1 ) { |
651 | | $j = str_replace('%',$i,$pagelink); |
652 | | $output .= ' '; |
653 | | if ( ($i != $page) || ((!$more) && ($page==1)) ) { |
654 | | $output .= _wp_link_page($i); |
655 | | } |
656 | | $output .= $link_before . $j . $link_after; |
657 | | if ( ($i != $page) || ((!$more) && ($page==1)) ) |
658 | | $output .= '</a>'; |
| 657 | for ( $i = 1; $i <= $numpages; $i++ ) { |
| 658 | $link = $link_before . str_replace( '%', $i, $pagelink ) . $link_after; |
| 659 | if ( $i != $page || ! $more && 1 == $page ) |
| 660 | $link = _wp_link_page( $i ) . $link . '</a>'; |
| 661 | $link = apply_filters( 'wp_link_pages_link', $link, $i ); |
| 662 | $output .= $separator . $link; |
661 | | } else { |
662 | | if ( $more ) { |
663 | | $output .= $before; |
664 | | $i = $page - 1; |
665 | | if ( $i && $more ) { |
666 | | $output .= _wp_link_page($i); |
667 | | $output .= $link_before. $previouspagelink . $link_after . '</a>'; |
668 | | } |
669 | | $i = $page + 1; |
670 | | if ( $i <= $numpages && $more ) { |
671 | | $output .= _wp_link_page($i); |
672 | | $output .= $link_before. $nextpagelink . $link_after . '</a>'; |
673 | | } |
674 | | $output .= $after; |
| 665 | } elseif ( $more ) { |
| 666 | $output .= $before; |
| 667 | $i = $page - 1; |
| 668 | if ( $i && $more ) { |
| 669 | $link = _wp_link_page( $i ) . $link_before . $previouspagelink . $link_after . '</a>'; |
| 670 | $link = apply_filters( 'wp_link_pages_link', $link, $i ); |
| 671 | $output .= $separator . $link; |