Automattic\WooCommerce\Internal\Admin

WCAdminUser::register_user_data()publicWC 1.0

Registers WooCommerce specific user data to the WordPress user API.

Метод класса: WCAdminUser{}

No Hooks.

Return

null. Nothing.

Usage

$WCAdminUser = new WCAdminUser();
$WCAdminUser->register_user_data();

Code of WCAdminUser::register_user_data() WC 7.1.0

public function register_user_data() {
	register_rest_field(
		'user',
		'is_super_admin',
		array(
			'get_callback' => function() {
				return is_super_admin();
			},
			'schema'       => null,
		)
	);
	register_rest_field(
		'user',
		'woocommerce_meta',
		array(
			'get_callback'    => array( $this, 'get_user_data_values' ),
			'update_callback' => array( $this, 'update_user_data_values' ),
			'schema'          => null,
		)
	);
}