Definition:
function meta_form() {}
Defined filters
- postmeta_form_limit
apply_filters( 'postmeta_form_limit', 30 )
Source code
function meta_form() { global $wpdb; $limit = (int) apply_filters( 'postmeta_form_limit', 30 ); $keys = $wpdb->get_col( " SELECT meta_key FROM $wpdb->postmeta GROUP BY meta_key HAVING meta_key NOT LIKE '\_%' ORDER BY meta_key LIMIT $limit" ); if ( $keys ) natcasesort($keys); ?> <p><strong><?php _e( 'Add New Custom Field:' ) ?></strong></p> <table id="newmeta"> <thead> <tr> <th class="left"><label for="metakeyselect"><?php _ex( 'Name', 'meta name' ) ?></label></th> <th><label for="metavalue"><?php _e( 'Value' ) ?></label></th> </tr> </thead> <tbody> <tr> <td id="newmetaleft" class="left"> <?php if ( $keys ) { ?> <select id="metakeyselect" name="metakeyselect" tabindex="7"> <option value="#NONE#"><?php _e( '— Select —' ); ?></option> <?php foreach ( $keys as $key ) { echo "\n<option value='" . esc_attr($key) . "'>" . esc_html($key) . "</option>"; } ?> </select> <input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" /> <a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;"> <span id="enternew"><?php _e('Enter new'); ?></span> <span id="cancelnew" class="hidden"><?php _e('Cancel'); ?></span></a> <?php } else { ?> <input type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" /> <?php } ?> </td> <td><textarea id="metavalue" name="metavalue" rows="2" cols="25" tabindex="8"></textarea></td> </tr> <tr><td colspan="2" class="submit"> <?php submit_button( __( 'Add Custom Field' ), 'add:the-list:newmeta', 'addmeta', false, array( 'id' => 'addmetasub', 'tabindex' => '9' ) ); ?> <?php wp_nonce_field( 'add-meta', '_ajax_nonce-add-meta', false ); ?> </td></tr> </tbody> </table> <?php }
2401
No comments yet... Be the first to leave a reply!