LLMS_Admin_User_Custom_Fields::get_fields_with_data( WP_User|int $user )
Load usermeta data into the array of fields retrieved from $this->get_fields
Description Description
Meta data is added to the array under the key "value" for each field.
If no data is found for a particular field the value is still added as an empty string.
Parameters Parameters
- $user
-
(WP_User|int) (Required) Instance of WP_User or WP User ID
Return Return
(array)
Source Source
File: includes/admin/class.llms.admin.user.custom.fields.php
public function get_fields_with_data( $user ) { if ( is_numeric( $user ) ) { $user = new WP_User( $user ); } $this->get_fields(); foreach ( $this->fields as $field => $data ) { $this->fields[ $field ]['value'] = apply_filters( 'lifterlms_get_user_custom_field_value_' . $field, $user->get( $field ), $user, $field ); } return $this->fields; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
2.7.0 | Introduced. |