Changeset 62036 for trunk/src/wp-includes/general-template.php
- Timestamp:
- 03/17/2026 01:33:03 AM (6 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/general-template.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/general-template.php
r61768 r62036 4670 4670 $current = get_query_var( 'paged' ) ? (int) get_query_var( 'paged' ) : 1; 4671 4671 4672 // Append the format placeholder to the base URL. 4673 $pagenum_link = trailingslashit( $url_parts[0] ) . '%_%'; 4672 /* 4673 * Ensures sites not using trailing slashes get links in the form 4674 * `/page/2` rather than `/page/2/`. On these sites, linking to the 4675 * URL with a trailing slash will result in a 301 redirect from the 4676 * incorrect URL to the correctly formatted one. This presents an 4677 * unnecessary performance hit. 4678 */ 4679 if ( $wp_rewrite->using_permalinks() && ! $wp_rewrite->use_trailing_slashes ) { 4680 $pagenum_link = untrailingslashit( $url_parts[0] ); 4681 } else { 4682 $pagenum_link = trailingslashit( $url_parts[0] ); 4683 } 4684 $pagenum_link .= '%_%'; 4674 4685 4675 4686 // URL base depends on permalink settings. 4676 4687 $format = $wp_rewrite->using_index_permalinks() && ! strpos( $pagenum_link, 'index.php' ) ? 'index.php/' : ''; 4677 4688 $format .= $wp_rewrite->using_permalinks() ? user_trailingslashit( $wp_rewrite->pagination_base . '/%#%', 'paged' ) : '?paged=%#%'; 4689 if ( $wp_rewrite->using_permalinks() && ! $wp_rewrite->use_trailing_slashes ) { 4690 $format = '/' . ltrim( $format, '/' ); 4691 } 4678 4692 4679 4693 $defaults = array(
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)