add_meta() wordpress function and usage This text is not used because the data attribute has a value

add_meta() wordpress function and usage

Home / WordPress / WordPress Wiki / add_meta() wordpress function and usage

add_meta( int $post_ID )
Add post meta data defined in $_POST superglobal for post with given ID.

Parameters

$post_ID

(int) (Required)

Return

(int|bool)

More Information

  • The information used is POSTed from the “Custom Fields” form on the Edit Post Administration screen.
  • Data used for the added metadata is taken from $_POST['metakeyselect']$_POST['metakeyinput']$_POST['metavalue']. Either the select or input fields are used for the meta key. If both are present, input field is used.

Sample Usage

Example

/*
 * Unless you developed a custom post form that uses the custom field widget,
 * there is little reason to use this function 
 */
add_meta( $post_ID );

 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments