Changeset 31459
- Timestamp:
- 02/14/2015 03:47:02 AM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r31168 r31459 255 255 // paging and feeds 256 256 if ( get_query_var('paged') || is_feed() || get_query_var('cpage') ) { 257 while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $redirect['path'] ) ) {257 while ( preg_match( "#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", $redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $redirect['path'] ) || preg_match( "#/{$wp_rewrite->comments_pagination_base}-[0-9]+(/+)?$#", $redirect['path'] ) ) { 258 258 // Strip off paging and feed 259 259 $redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing paging 260 260 $redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $redirect['path']); // strip off feed endings 261 $redirect['path'] = preg_replace( '#/comment-page-[0-9]+?(/+)?$#', '/', $redirect['path']); // strip off any existing comment paging261 $redirect['path'] = preg_replace("#/{$wp_rewrite->comments_pagination_base}-[0-9]+?(/+)?$#", '/', $redirect['path']); // strip off any existing comment paging 262 262 } 263 263 … … 303 303 304 304 if ( get_option('page_comments') && ( ( 'newest' == get_option('default_comments_page') && get_query_var('cpage') > 0 ) || ( 'newest' != get_option('default_comments_page') && get_query_var('cpage') > 1 ) ) ) { 305 $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit( 'comment-page-' . get_query_var('cpage'), 'commentpaged' );305 $addl_path = ( !empty( $addl_path ) ? trailingslashit($addl_path) : '' ) . user_trailingslashit( $wp_rewrite->comments_pagination_base . '-' . get_query_var('cpage'), 'commentpaged' ); 306 306 $redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] ); 307 307 } -
trunk/src/wp-includes/comment-template.php
r31412 r31459 659 659 660 660 if ( $wp_rewrite->using_permalinks() ) 661 $link = user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . 'comment-page-' . $args['page'], 'comment' );661 $link = user_trailingslashit( trailingslashit( get_permalink( $comment->comment_post_ID ) ) . $wp_rewrite->comments_pagination_base . '-' . $args['page'], 'comment' ); 662 662 else 663 663 $link = add_query_arg( 'cpage', $args['page'], get_permalink( $comment->comment_post_ID ) ); -
trunk/src/wp-includes/link-template.php
r31302 r31459 2425 2425 if ( $pagenum != $max_page ) { 2426 2426 if ( $wp_rewrite->using_permalinks() ) 2427 $result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged');2427 $result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged'); 2428 2428 else 2429 2429 $result = add_query_arg( 'cpage', $pagenum, $result ); … … 2431 2431 } elseif ( $pagenum > 1 ) { 2432 2432 if ( $wp_rewrite->using_permalinks() ) 2433 $result = user_trailingslashit( trailingslashit($result) . 'comment-page-' . $pagenum, 'commentpaged');2433 $result = user_trailingslashit( trailingslashit($result) . $wp_rewrite->comments_pagination_base . '-' . $pagenum, 'commentpaged'); 2434 2434 else 2435 2435 $result = add_query_arg( 'cpage', $pagenum, $result ); … … 2574 2574 ); 2575 2575 if ( $wp_rewrite->using_permalinks() ) 2576 $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . 'comment-page-%#%', 'commentpaged');2576 $defaults['base'] = user_trailingslashit(trailingslashit(get_permalink()) . $wp_rewrite->comments_pagination_base . '-%#%', 'commentpaged'); 2577 2577 2578 2578 $args = wp_parse_args( $args, $defaults ); -
trunk/src/wp-includes/rewrite.php
r31126 r31459 505 505 506 506 /** 507 * Comments pagination permalink base. 508 * 509 * @since 4.2.0 510 * @access private 511 * @var string 512 */ 513 var $comments_pagination_base = 'comment-page'; 514 515 /** 507 516 * Feed permalink base. 508 517 * … … 1257 1266 $trackbackregex = 'trackback/?$'; 1258 1267 $pageregex = $this->pagination_base . '/?([0-9]{1,})/?$'; 1259 $commentregex = 'comment-page-([0-9]{1,})/?$';1268 $commentregex = $this->comments_pagination_base . '-([0-9]{1,})/?$'; 1260 1269 1261 1270 //build up an array of endpoint regexes to append => queries to append
Note: See TracChangeset
for help on using the changeset viewer.