UserData::update( null $key = null, string $value = '' )
Parameters
- $value
-
(string) (Optional) Update User data
Default value: ''
- $key
-
(null) (Optional)
Default value: null
Source
File: classes/UserData.php
public function update( $key = null, $value = '' ) { if ( $key ) { $data = $this->get(); $data[ $key ] = $value; /** * Filter data before update user data * * @since DozentLMS 1.0.0 * * @param array $data User Data in array * @param int $user_id = $user_id */ $data = apply_filters( 'dozent/user_data/update', array_filter( $data ), $this->user_id ); update_user_meta( $this->user_id, '_dozent_user_data', $data ); } }
Changelog
Version | Description |
---|---|
DozentLMS 1.0.0 | Introduced. |