Changeset 55364
- Timestamp:
- 02/18/2023 03:07:12 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r55289 r55364 2482 2482 $paged = 1; 2483 2483 } 2484 $nextpage = (int) $paged + 1; 2485 if ( ! $max_page || $max_page >= $nextpage ) { 2486 return get_pagenum_link( $nextpage ); 2484 2485 $next_page = (int) $paged + 1; 2486 2487 if ( ! $max_page || $max_page >= $next_page ) { 2488 return get_pagenum_link( $next_page ); 2487 2489 } 2488 2490 } … … 2531 2533 } 2532 2534 2533 $next page = (int) $paged + 1;2535 $next_page = (int) $paged + 1; 2534 2536 2535 2537 if ( null === $label ) { … … 2537 2539 } 2538 2540 2539 if ( ! is_single() && ( $next page <= $max_page ) ) {2541 if ( ! is_single() && ( $next_page <= $max_page ) ) { 2540 2542 /** 2541 2543 * Filters the anchor tag attributes for the next posts page link. … … 2547 2549 $attr = apply_filters( 'next_posts_link_attributes', '' ); 2548 2550 2549 return '<a href="' . next_posts( $max_page, false ) . "\" $attr>" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . '</a>'; 2551 return sprintf( 2552 '<a href="%1$s" %2$s>%3$s</a>', 2553 next_posts( $max_page, false ), 2554 $attr, 2555 preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) 2556 ); 2550 2557 } 2551 2558 } … … 2580 2587 2581 2588 if ( ! is_single() ) { 2582 $nextpage = (int) $paged - 1; 2583 if ( $nextpage < 1 ) { 2584 $nextpage = 1; 2585 } 2586 return get_pagenum_link( $nextpage ); 2589 $previous_page = (int) $paged - 1; 2590 2591 if ( $previous_page < 1 ) { 2592 $previous_page = 1; 2593 } 2594 2595 return get_pagenum_link( $previous_page ); 2587 2596 } 2588 2597 } … … 2632 2641 */ 2633 2642 $attr = apply_filters( 'previous_posts_link_attributes', '' ); 2634 return '<a href="' . previous_posts( false ) . "\" $attr>" . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . '</a>'; 2643 2644 return sprintf( 2645 '<a href="%1$s" %2$s>%3$s</a>', 2646 previous_posts( false ), 2647 $attr, 2648 preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) 2649 ); 2635 2650 } 2636 2651 } … … 3080 3095 } 3081 3096 3082 $next page = (int) $page + 1;3097 $next_page = (int) $page + 1; 3083 3098 3084 3099 if ( empty( $max_page ) ) { … … 3090 3105 } 3091 3106 3092 if ( $next page > $max_page ) {3107 if ( $next_page > $max_page ) { 3093 3108 return; 3094 3109 } … … 3105 3120 * @param string $attributes Attributes for the anchor tag. 3106 3121 */ 3107 return '<a href="' . esc_url( get_comments_pagenum_link( $nextpage, $max_page ) ) . '" ' . apply_filters( 'next_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . '</a>'; 3122 $attr = apply_filters( 'next_comments_link_attributes', '' ); 3123 3124 return sprintf( 3125 '<a href="%1$s" %2$s>%3$s</a>', 3126 esc_url( get_comments_pagenum_link( $next_page, $max_page ) ), 3127 $attr, 3128 preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) 3129 ); 3108 3130 } 3109 3131 … … 3139 3161 } 3140 3162 3141 $prev page = (int) $page - 1;3163 $previous_page = (int) $page - 1; 3142 3164 3143 3165 if ( empty( $label ) ) { … … 3152 3174 * @param string $attributes Attributes for the anchor tag. 3153 3175 */ 3154 return '<a href="' . esc_url( get_comments_pagenum_link( $prevpage ) ) . '" ' . apply_filters( 'previous_comments_link_attributes', '' ) . '>' . preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) . '</a>'; 3176 $attr = apply_filters( 'previous_comments_link_attributes', '' ); 3177 3178 return sprintf( 3179 '<a href="%1$s" %2$s>%3$s</a>', 3180 esc_url( get_comments_pagenum_link( $previous_page ) ), 3181 $attr, 3182 preg_replace( '/&([^#])(?![a-z]{1,8};)/i', '&$1', $label ) 3183 ); 3155 3184 } 3156 3185
Note: See TracChangeset
for help on using the changeset viewer.