GB_User::update_meta
Update user meta field based on user ID.
Use the $prev_value parameter to differentiate between meta fields with the same key and user ID. If the meta field for the user does not exist, it will be added.
Signature
public function update_meta(int
$user_id,
string
$meta_key,
mixed
$meta_value,
[string
$prev_value = ''] )
Parameters
$user_id
— int
User ID.$meta_key
— string
Metadata key.$meta_value
— mixed
Metadata value.$prev_value
— string
Optional. Previous value to check before removing.
Returns
- int|bool
- Meta ID if the key didn't exist, true on successful update, false on failure.
Violations
Checkstyle
Line | Column | Severity | Message |
---|---|---|---|
801 | 12 | error | Method name "GB_User::update_meta" is not in camel caps format |
801 | 12 | error | Visibility must be declared on method "update_meta" |