WordPress.org

Make WordPress Core

Ticket #33885: 33885.3.diff

File 33885.3.diff, 1.3 KB (added by johnbillion, 4 years ago)
  • src/wp-admin/includes/template.php

    diff --git a/src/wp-admin/includes/template.php b/src/wp-admin/includes/template.php
    index 87236d4846..a0e433a5e9 100644
    a b function _list_meta_row( $entry, &$count ) { 
    573573 * Prints the form in the Custom Fields meta box.
    574574 *
    575575 * @since 1.2.0
     576 * @since x.x.x The default list of meta keys used to populate the dropdown was removed.
    576577 *
    577578 * @global wpdb $wpdb WordPress database abstraction object.
    578579 *
    function meta_form( $post = null ) { 
    595596         */
    596597        $keys = apply_filters( 'postmeta_form_keys', null, $post );
    597598
    598         if ( null === $keys ) {
    599                 /**
    600                  * Filters the number of custom fields to retrieve for the drop-down
    601                  * in the Custom Fields meta box.
    602                  *
    603                  * @since 2.1.0
    604                  *
    605                  * @param int $limit Number of custom fields to retrieve. Default 30.
    606                  */
    607                 $limit = apply_filters( 'postmeta_form_limit', 30 );
    608                 $sql = "SELECT DISTINCT meta_key
    609                         FROM $wpdb->postmeta
    610                         WHERE meta_key NOT BETWEEN '_' AND '_z'
    611                         HAVING meta_key NOT LIKE %s
    612                         ORDER BY meta_key
    613                         LIMIT %d";
    614                 $keys = $wpdb->get_col( $wpdb->prepare( $sql, $wpdb->esc_like( '_' ) . '%', $limit ) );
    615         }
    616 
    617599        if ( $keys ) {
    618600                natcasesort( $keys );
    619601                $meta_key_input_id = 'metakeyselect';