A WordPress-centric search engine for devs and theme authors



update_meta ›

Since1.2.0
Deprecatedn/a
update_meta ( $meta_id, $meta_key, $meta_value )
Parameters: (3)
  • (int) $meta_id
    Required: Yes
  • (string) $meta_key Expect Slashed
    Required: Yes
  • (string) $meta_value Expect Slashed
    Required: Yes
Returns:
  • (bool)
Defined at:
Codex:

Update post meta data by meta ID.



Source

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 );
}