update_meta() – Update post meta data by meta ID.

You appear to be a bot. Output may be restricted

Description

Updates post meta data by meta ID.

Usage

$bool = update_meta( $meta_id, $meta_key, $meta_value );

Parameters

$meta_id
( int ) required – Meta ID.
$meta_key
( string ) required – Meta key. Expect slashed.
$meta_value
( string ) required – Meta value. Expect slashed.

Returns

bool

Source

File name: wordpress/wp-admin/includes/post.php
Lines:

1 to 6 of 6
function update_meta( $meta_id, $meta_key, $meta_value ) {
  $meta_key   = wp_unslash( $meta_key );
  $meta_value = wp_unslash( $meta_value );

  return update_metadata_by_mid( 'post', $meta_id, $meta_value, $meta_key );
}
 

 View on GitHub View on Trac