Ticket #12507: pagination_base.2.diff
File pagination_base.2.diff, 1.7 KB (added by , 15 years ago) |
---|
-
wp-includes/link-template.php
1382 1382 $query_string = ''; 1383 1383 } 1384 1384 1385 $request = preg_replace( '|page/\d+/?$|', '', $request);1385 $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request); 1386 1386 $request = preg_replace( '|^index\.php|', '', $request); 1387 1387 $request = ltrim($request, '/'); 1388 1388 … … 1392 1392 $base .= 'index.php/'; 1393 1393 1394 1394 if ( $pagenum > 1 ) { 1395 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/'. $pagenum, 'paged' );1395 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' ); 1396 1396 } 1397 1397 1398 1398 $result = $base . $request . $query_string; -
wp-includes/rewrite.php
481 481 var $comments_base = 'comments'; 482 482 483 483 /** 484 * Pagination permalink base. 485 * 486 * @since 3.1.0 487 * @access private 488 * @var string 489 */ 490 var $pagination_base = 'page'; 491 492 /** 484 493 * Feed permalink base. 485 494 * 486 495 * @since 1.5.0 … … 1293 1302 1294 1303 //build a regex to match the trackback and page/xx parts of URLs 1295 1304 $trackbackregex = 'trackback/?$'; 1296 $pageregex = 'page/?([0-9]{1,})/?$';1305 $pageregex = $this->pagination_base . '/?([0-9]{1,})/?$'; 1297 1306 $commentregex = 'comment-page-([0-9]{1,})/?$'; 1298 1307 1299 1308 //build up an array of endpoint regexes to append => queries to append