Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




meta_form [ WordPress Function ]

meta_form ( No parameters )
Defined at:



{@internal Missing Short Description}}

Source


<?php
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'&mdash; Select &mdash;' ); ?></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

}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics