LLMS_Admin_Profile::add_user_meta_fields( WP_User $user )

Add user meta fields to the profile screens


Parameters Parameters

$user

(WP_User) (Required) Instance of WP_User for the user being updated.


Top ↑

Return Return

(bool) true if fields were added, false otherwise.


Top ↑

Source Source

File: includes/admin/class-llms-admin-profile.php

	public function add_user_meta_fields( $user ) {

		if ( ! $this->current_user_can_edit_admin_custom_fields() ) {
			return false;
		}

		$fields = $this->get_fields();

		if ( empty( $fields ) ) {
			return false;
		}

		/**
		 * Enqueue select2 scripts and styles.
		 */
		wp_enqueue_script( 'llms-metaboxes' );
		wp_enqueue_script( 'llms-select2' );
		llms()->assets->enqueue_style( 'llms-select2-styles' );
		wp_add_inline_script(
			'llms',
			"window.llms.address_info = '" . wp_json_encode( llms_get_countries_address_info() ) . "';"
		);

		include_once LLMS_PLUGIN_DIR . 'includes/admin/views/user-edit-fields.php';

		return true;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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