From 765714ac0b6c9d85831d65968014bcc915a6ee84 Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Thu, 23 Jul 2015 05:17:25 +0000 Subject: [PATCH] Switch to a more performant query in meta_form(). Props lumaraf, swissspidy, rarylson, pento Fixes #24498 Built from https://develop.svn.wordpress.org/trunk@33390 git-svn-id: http://core.svn.wordpress.org/trunk@33358 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 88c7155e95..6a457c54f9 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -677,9 +677,9 @@ function meta_form( $post = null ) { * @param int $limit Number of custom fields to retrieve. Default 30. */ $limit = apply_filters( 'postmeta_form_limit', 30 ); - $sql = "SELECT meta_key + $sql = "SELECT DISTINCT meta_key FROM $wpdb->postmeta - GROUP BY meta_key + WHERE meta_key NOT BETWEEN '_' AND '_z' HAVING meta_key NOT LIKE %s ORDER BY meta_key LIMIT %d"; diff --git a/wp-includes/version.php b/wp-includes/version.php index 0e3b43a502..b6068d2eff 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta4-33387'; +$wp_version = '4.3-beta4-33390'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.