WordPress.org

Ready to get started?Download WordPress

Ideas

Action Hook for Post Meta Add/Update

  1. Josh Levinson
    Member

    I suggest an action hook be implemented for the update_post_meta and add_post_meta functions that will allow other plugins to be aware of this action and perform needed functions on or relating to the post meta.

    Posted: 1 year ago #
  2. Josh Levinson
    Member

    Apparently I did not read enough.
    There exists such an action:

    do_action( "updated_{$meta_type}_meta", $meta_id, $object_id, $meta_key, $_meta_value );

    in the function update_metadata in /wp-includes/meta.php.

    For posts, there exists a more specific hook:

    if ( 'post' == $meta_type )
    do_action( 'update_postmeta', $meta_id, $object_id, $meta_key, $meta_value );
    Posted: 1 year ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    0 Votes
  • Status

    This idea is under consideration