Make WordPress Core

Ticket #33885: 33885.3.1.diff

File 33885.3.1.diff, 1.0 KB (added by lbenicio, 8 years ago)

Unit test for 33885.3

Line 
1@@ -629,6 +645,7 @@ function _list_meta_row( $entry, &$count ) {
2 * Prints the form in the Custom Fields meta box.
3 *
4 * @since 1.2.0
5+ * @since x.x.x The default list of meta keys used to populate the dropdown was removed.
6 *
7 * @global wpdb $wpdb WordPress database abstraction object.
8 *
9@@ -651,24 +668,7 @@ function meta_form( $post = null ) {
10 */
11 $keys = apply_filters( 'postmeta_form_keys', null, $post );
12
13- if ( null === $keys ) {
14- /**
15- * Filters the number of custom fields to retrieve for the drop-down
16- * in the Custom Fields meta box.
17- *
18- * @since 2.1.0
19- *
20- * @param int $limit Number of custom fields to retrieve. Default 30.
21- */
22- $limit = apply_filters( 'postmeta_form_limit', 30 );
23- $sql = "SELECT DISTINCT meta_key
24- FROM $wpdb->postmeta
25- WHERE meta_key NOT BETWEEN '_' AND '_z'
26- HAVING meta_key NOT LIKE %s
27- ORDER BY meta_key
28- LIMIT %d";
29- $keys = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
30- }
31+ assertNotEmpty($keys)