add_post_meta() & update_post_meta()
add_post_meta() : Adds a meta field to the given post. Below is the example, <?php $post_id = 1; $meta_key = ‘_test’; $meta_value=”this is a test”; $unique = true; add_post_meta( $post_id, $meta_key, $meta_value, $unique ); update_post_meta() : if the given key already exists among custom fields of the specified post, another custom field with the same … Read more