Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: postmeta_form_limit

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
550  * Prints the form in the Custom Fields meta box.
551  *
552  * @since 1.2.0
553  *
554  * @param WP_Post $post Optional. The post being edited.
555  */
556 function meta_form( $post = null ) {
557      global $wpdb;
558      $post = get_post( $post );
559      $limit = (int) apply_filters( 'postmeta_form_limit', 30 );
560      $keys = $wpdb->get_col( "
561           SELECT meta_key
562           FROM $wpdb->postmeta
563           GROUP BY meta_key
564           HAVING meta_key NOT LIKE '\_%'
565           ORDER BY meta_key
566           LIMIT $limit" );
567      if ( $keys )
568           natcasesort($keys);