WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 3 years ago

#10327 closed enhancement (duplicate)

update_user_meta Filter

Reported by: 5ubliminal Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Plugins Keywords:
Focuses: Cc:

Description

A filter on the update_usermeta would be great. It's a rather sensitive area but we could use it. It should go right under:

$meta_key = preg_replace('|[^a-z0-9_]|i', '', $meta_key);

like this:

$meta_value = apply_filters('update_user_meta', $meta_value, $meta_key, $user_id);

I use this to intercept changes on capabilities which are not filtered anywhere... afaik.

Change History (4)

comment:1 Denis-de-Bernardy5 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Unassigned to Future Release

comment:2 5ubliminal5 years ago

Sorry for the long delay. Been on a no-internet vacation :)

I need a hook to capture changes in user roles. When you use Change Role inside the user management screen ... it will remove Custom Roles I might have set for a user.

I need a way to hook into this action and make sure my special internal roles [hidden from the Change Role list] are kept between WP role changes.

I hope I make some sense. I need my special roles to help me inside the Users screen to list only those belonging to an internal role.

comment:3 scribu5 years ago

  • Keywords reporter-feedback removed

See #10837.

comment:4 scribu3 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

There are plenty of hooks in wp-includes/meta.php now. Closing as dup of #10837.

Note: See TracTickets for help on using tickets.