diff --git src/wp-includes/class-wp-meta-query.php src/wp-includes/class-wp-meta-query.php
index 3fb7956da..c848dd8cb 100644
|
|
class WP_Meta_Query { |
95 | 95 | protected $has_or_relation = false; |
96 | 96 | |
97 | 97 | /** |
| 98 | * The default meta table alias. |
| 99 | * |
| 100 | * @var string |
| 101 | */ |
| 102 | protected $default_meta_table_alias = 'mt'; |
| 103 | |
| 104 | /** |
98 | 105 | * Constructor. |
99 | 106 | * |
100 | 107 | * @since 3.2.0 |
… |
… |
class WP_Meta_Query { |
511 | 518 | $alias = $this->find_compatible_table_alias( $clause, $parent_query ); |
512 | 519 | if ( false === $alias ) { |
513 | 520 | $i = count( $this->table_aliases ); |
514 | | $alias = $i ? 'mt' . $i : $this->meta_table; |
| 521 | $alias = $i ? $this->default_meta_table_alias . $i : $this->meta_table; |
515 | 522 | |
516 | 523 | // JOIN clauses for NOT EXISTS have their own syntax. |
517 | 524 | if ( 'NOT EXISTS' === $meta_compare ) { |
… |
… |
class WP_Meta_Query { |
727 | 734 | public function has_or_relation() { |
728 | 735 | return $this->has_or_relation; |
729 | 736 | } |
| 737 | |
| 738 | /** |
| 739 | * Sets default meta table alias. |
| 740 | * |
| 741 | * @param string $default_meta_table_alias The default meta table alias. |
| 742 | * |
| 743 | * @return void |
| 744 | */ |
| 745 | public function set_default_meta_table_alias( $default_meta_table_alias ) { |
| 746 | $this->default_meta_table_alias = $default_meta_table_alias; |
| 747 | } |
730 | 748 | } |