| @@ -689,20 +689,17 @@ | ||
| 689 | 689 | return self::$active_default_template_names; |
| 690 | 690 | } |
| 691 | 691 | |
| 692 | 692 | global $wpdb; |
| 693 | - $posts = $wpdb->prefix . self::POST_TABLE; | |
| 694 | - $post_meta = $wpdb->prefix . self::POST_META_TABLE; | |
| 695 | 693 | |
| 696 | 694 | $rows = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery |
| 697 | 695 | $wpdb->prepare( |
| 698 | - // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared | |
| 699 | 696 | "SELECT posts.ID, name.meta_value AS name, status.meta_value AS status, lang.meta_value AS language, variant.meta_value AS variant |
| 700 | - FROM $posts AS posts | |
| 701 | - JOIN $post_meta AS name ON ( posts.ID = name.post_id AND name.meta_key = %s ) | |
| 702 | - LEFT JOIN $post_meta AS status ON ( posts.ID = status.post_id AND status.meta_key = %s ) | |
| 703 | - LEFT JOIN $post_meta AS lang ON ( posts.ID = lang.post_id AND lang.meta_key = %s ) | |
| 704 | - LEFT JOIN $post_meta AS variant ON ( posts.ID = variant.post_id AND variant.meta_key = %s ) | |
| 697 | + FROM {$wpdb->posts} AS posts | |
| 698 | + JOIN {$wpdb->postmeta} AS name ON ( posts.ID = name.post_id AND name.meta_key = %s ) | |
| 699 | + LEFT JOIN {$wpdb->postmeta} AS status ON ( posts.ID = status.post_id AND status.meta_key = %s ) | |
| 700 | + LEFT JOIN {$wpdb->postmeta} AS lang ON ( posts.ID = lang.post_id AND lang.meta_key = %s ) | |
| 701 | + LEFT JOIN {$wpdb->postmeta} AS variant ON ( posts.ID = variant.post_id AND variant.meta_key = %s ) | |
| 705 | 702 | WHERE posts.post_type = %s AND posts.post_status IN ('publish', 'pending', 'future') |
| 706 | 703 | ORDER BY posts.ID ASC", |
| 707 | 704 | self::$meta_keys['name'], |
| 708 | 705 | self::$meta_keys['status'], |