Ticket #12507: pagination_base.diff
File pagination_base.diff, 1.6 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 $pagination_base = get_pagination_base(); 1386 1387 $request = preg_replace( "|$pagination_base/\d+/?$|", '', $request); 1386 1388 $request = preg_replace( '|^index\.php|', '', $request); 1387 1389 $request = ltrim($request, '/'); 1388 1390 … … 1392 1394 $base .= 'index.php/'; 1393 1395 1394 1396 if ( $pagenum > 1 ) { 1395 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/'. $pagenum, 'paged' );1397 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( "$pagination_base/" . $pagenum, 'paged' ); 1396 1398 } 1397 1399 1398 1400 $result = $base . $request . $query_string; … … 1403 1405 return $result; 1404 1406 } 1405 1407 1408 function get_pagination_base() { 1409 return apply_filters('pagination_base', 'page'); 1410 } 1411 1406 1412 /** 1407 1413 * Retrieve next posts pages link. 1408 1414 * -
wp-includes/rewrite.php
1293 1293 1294 1294 //build a regex to match the trackback and page/xx parts of URLs 1295 1295 $trackbackregex = 'trackback/?$'; 1296 $pageregex = 'page/?([0-9]{1,})/?$';1296 $pageregex = get_pagination_base() . '/?([0-9]{1,})/?$'; 1297 1297 $commentregex = 'comment-page-([0-9]{1,})/?$'; 1298 1298 1299 1299 //build up an array of endpoint regexes to append => queries to append