WordPress.org

Ready to get started?Download WordPress

Codex

Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/updated (meta type) meta

Contents

Description

This hook is called after a call to update_metadata succeeds.

Usage

<?php add_action( "updated_{$meta_type}_meta", $function_name', 10, 4 ); ?>

where $function_name is the name of the function to be called and $meta_type is the type of metadata that was updated.

Parameters

$meta_id
(int) (required) ID of the row being updated
Default: None
$object_id
(int) (required) ID of the object the metadata applies to
Default: None
$meta_key
(string) (required) Metadata key
Default: None
$_meta_value
(mixed) (required) Metadata value. Must be serializable if non-scalar.
Default: None

Note that unlike updated_postmeta, the $_meta_value param is not serialized.

Examples

For example, to respond to updates to user metadata:

<?php
add_action( 'update_user_meta', 'my_update_user_meta', 10, 4 );

function my_update_user_meta($meta_id, $object_id, $meta_key, $_meta_value) {
	//do stuff
}
?>

Change Log

  • Since: unknown

Source

updated_(meta_type)_meta is located in wp-includes/meta.php.

Related

This page is marked as incomplete. You can help Codex by expanding it.