add_meta [ WordPress Function ]
add_meta ( $post_ID )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
{@internal Missing Short Description}}
Source
<?php
function add_meta( $post_ID ) {
global $wpdb;
$post_ID = (int) $post_ID;
$metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( $_POST['metakeyselect'] ) ) : '';
$metakeyinput = isset($_POST['metakeyinput']) ? stripslashes( 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_meta
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- PHPXRef 0.7 : WordPress : Function Reference: add_meta()
Function and Method Cross Reference. add_meta(). Defined at: /wp-admin/ includes/post.php -> line 617. Referenced 4 times: /wp-admin/includes/post.php ...
phpxref.ftwr.co.uk - Meta Tags for Web Sites - Add Meta Tags to Your Web Site
Get higher search engine rankings for your Web page with meta tags. Meta tags help search engines know what your Web site is about. Without meta tags your ...
personalweb.about.com - add_meta() WordPress function reference, arguments and source at ...
Source. function add_meta( $post_ID ) { global $wpdb; $post_ID = (int) $post_ID; $metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( ...
queryposts.com - add_meta | A HitchHackers guide through WordPress
Feb 11, 2011 ... function add_meta( $post_ID ) { global $wpdb; $post_ID = (int) $post_ID; $ metakeyselect = isset($_POST['metakeyselect']) ? stripslashes( trim( ...
hitchhackerguide.com