Ticket #12507: pagination_base.3.diff
File pagination_base.3.diff, 3.7 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
2417 2417 $check_sql = "SELECT post_name FROM $wpdb->posts WHERE post_name = %s AND post_type IN ( '" . implode( "', '", esc_sql( $hierarchical_post_types ) ) . "' ) AND ID != %d AND post_parent = %d LIMIT 1"; 2418 2418 $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $slug, $post_ID, $post_parent ) ); 2419 2419 2420 if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( '@^(page)?\d+$@', $slug ) ) {2420 if ( $post_name_check || in_array( $slug, $feeds ) || preg_match( "@^($wp_rewrite->pagination_base)?\d+$@", $slug ) ) { 2421 2421 $suffix = 2; 2422 2422 do { 2423 2423 $alt_post_name = substr( $slug, 0, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; … … 4585 4585 4586 4586 add_filter('the_preview', '_set_preview'); 4587 4587 } 4588 } 4589 No newline at end of file 4588 } -
wp-includes/link-template.php
1387 1387 $query_string = ''; 1388 1388 } 1389 1389 1390 $request = preg_replace( '|page/\d+/?$|', '', $request);1390 $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request); 1391 1391 $request = preg_replace( '|^index\.php|', '', $request); 1392 1392 $request = ltrim($request, '/'); 1393 1393 … … 1397 1397 $base .= 'index.php/'; 1398 1398 1399 1399 if ( $pagenum > 1 ) { 1400 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/'. $pagenum, 'paged' );1400 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' ); 1401 1401 } 1402 1402 1403 1403 $result = $base . $request . $query_string; -
wp-includes/rewrite.php
480 480 var $comments_base = 'comments'; 481 481 482 482 /** 483 * Pagination permalink base. 484 * 485 * @since 3.1.0 486 * @access private 487 * @var string 488 */ 489 var $pagination_base = 'page'; 490 491 /** 483 492 * Feed permalink base. 484 493 * 485 494 * @since 1.5.0 … … 1279 1288 1280 1289 //build a regex to match the trackback and page/xx parts of URLs 1281 1290 $trackbackregex = 'trackback/?$'; 1282 $pageregex = 'page/?([0-9]{1,})/?$';1291 $pageregex = $this->pagination_base . '/?([0-9]{1,})/?$'; 1283 1292 $commentregex = 'comment-page-([0-9]{1,})/?$'; 1284 1293 1285 1294 //build up an array of endpoint regexes to append => queries to append -
wp-includes/canonical.php
178 178 $paged_redirect = @parse_url($redirect_url); 179 179 while ( preg_match( '#/page/?[0-9]+?(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/(comments/?)?(feed|rss|rdf|atom|rss2)(/+)?$#', $paged_redirect['path'] ) || preg_match( '#/comment-page-[0-9]+(/+)?$#', $paged_redirect['path'] ) ) { 180 180 // Strip off paging and feed 181 $paged_redirect['path'] = preg_replace( '#/page/?[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing paging181 $paged_redirect['path'] = preg_replace("#/$wp_rewrite->pagination_base/?[0-9]+?(/+)?$#", '/', $paged_redirect['path']); // strip off any existing paging 182 182 $paged_redirect['path'] = preg_replace('#/(comments/?)?(feed|rss2?|rdf|atom)(/+|$)#', '/', $paged_redirect['path']); // strip off feed endings 183 183 $paged_redirect['path'] = preg_replace('#/comment-page-[0-9]+?(/+)?$#', '/', $paged_redirect['path']); // strip off any existing comment paging 184 184 }