wpseek.com
A WordPress-centric search engine for devs and theme authors



update_meta › WordPress Function

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

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