Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: added_postmeta

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
650           if ( $metakeyinput)
651                $metakey = $metakeyinput; // default
652
653           if ( in_array($metakey, $protected) )
654                return false;
655
656           wp_cache_delete($post_ID, 'post_meta');
657           $wpdb->insert( $wpdb->postmeta, array( 'post_id' => $post_ID, 'meta_key' => $metakey, 'meta_value' => $metavalue ) );
658           $meta_id = $wpdb->insert_id;
659           do_action( 'added_postmeta', $meta_id, $post_ID, $metakey, $metavalue );
660
661           return $meta_id;
662      }
663      return false;
664 } // add_meta
665
666 /**
667  * {@internal Missing Short Description}}
668  *