Ticket #26937: 26937.12.patch
| File 26937.12.patch, 1.2 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/link-template.php
1436 1436 $clauses = array_merge( $clauses, $sort_clauses ); 1437 1437 } 1438 1438 1439 /** 1440 * Posts table was aliased as `p` for backwards compatibility during legacy filter application. 1441 * As `WP_Query` expects the posts table to be referenced as the value stored in `$wpdb->posts`, we must remove the aliasing. 1442 */ 1443 $clauses['join'] = str_replace( 'AS p ', '', $clauses['join'] ); 1444 $clauses = array_map( array( $this, 'restore_posts_table' ), $clauses ); 1445 1439 1446 return $clauses; 1440 1447 } 1441 1448 … … 1453 1460 } 1454 1461 1455 1462 /** 1463 * Restore posts table to the value from `$wpdb`, as expected by `WP_Query` 1464 * 1465 * @global $wpdb 1466 * @param string Clause to unalias 1467 * @return string 1468 */ 1469 protected function restore_posts_table( $clause ) { 1470 global $wpdb; 1471 1472 return preg_replace( '#\bp\b#', "{$wpdb->posts}", $clause ); 1473 } 1474 1475 /** 1456 1476 * Apply the deprecated `join` clause filter to the clause built by WP_Query. 1457 1477 * 1458 1478 * @param string $join
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)