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.

Top ↑

Parameters Parameters


(WP_User|int) (Required) Instance of WP_User or WP User ID

Top ↑

Return Return


Top ↑

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 );


		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;


Top ↑

Changelog Changelog

Version Description
2.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.