add_meta [ WordPress-Funktionen ]
add_meta ( $post_ID )
| Parameter: |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex |
{@internal Missing Short Description}}
Quellcode
function add_meta( $post_ID ) {
global $wpdb;
$post_ID = (int) $post_ID;
$metakeyselect = isset($_POST['metakeyselect']) ? wp_unslash( trim( $_POST['metakeyselect'] ) ) : '';
$metakeyinput = isset($_POST['metakeyinput']) ? wp_unslash( trim( $_POST['metakeyinput'] ) ) : '';
$metavalue = isset($_POST['metavalue']) ? $_POST['metavalue'] : '';
if ( is_string( $metavalue ) )
$metavalue = trim( $metavalue );
if ( ('0' === $metavalue || ! empty ( $metavalue ) ) && ( ( ( '#NONE#' != $metakeyselect ) && !empty ( $metakeyselect) ) || !empty ( $metakeyinput ) ) ) {
// We have a key/value pair. If both the select and the
// input for the key have data, the input takes precedence:
if ( '#NONE#' != $metakeyselect )
$metakey = $metakeyselect;
if ( $metakeyinput )
$metakey = $metakeyinput; // default
if ( is_protected_meta( $metakey, 'post' ) || ! current_user_can( 'add_post_meta', $post_ID, $metakey ) )
return false;
$metakey = esc_sql( $metakey );
return add_post_meta( $post_ID, $metakey, $metavalue );
}
return false;
} // add_metaBeispiele [ wp-snippets.com ]
Top Google Suchergebnisse
- Function Reference/add meta « WordPress Codex
Description. Adds metadata for a particular post. The information used is POSTed from the "Custom Fields" form on the Edit Post Administration screen.
codex.wordpress.org - Function Reference/add meta box « WordPress Codex
Description. The add_meta_box() function was introduced in Version 2.5. It allows plugin developers to add meta boxes to the administrative interface.
codex.wordpress.org - add_meta (WordPress Function) - WPSeek.com
4 days ago ... internal Missing Short Description}} WordPress lookup for add_meta, a WordPress Function.
wpseek.com - PHPXRef 0.7 : WordPress : Function Reference: add_meta()
Function and Method Cross Reference. add_meta(). Defined at: /wp-admin/ includes/post.php -> line 607. Referenced 4 times: /wp-admin/includes/post.php ...
phpxref.ftwr.co.uk
