# assistant/1.5.4.2/backend/src/Hooks/Actions/OnEditUserProfile.php

Assistant – Every Day Productivity Apps, version 1.5.4.2. 60 lines.

- Page: https://pluginprobe.com/plugins/assistant/1.5.4.2/code/backend/src/Hooks/Actions/OnEditUserProfile.php
- Raw: https://pluginprobe.com/plugins/assistant/1.5.4.2/raw/backend/src/Hooks/Actions/OnEditUserProfile.php
- Modified: 2026-04-30T14:57:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/assistant/1.5.4.2/code/backend/src/Hooks/Actions/OnEditUserProfile.php#L10-L20`.

```php
<?php

namespace FL\Assistant\Hooks\Actions;

use FL\Assistant\Data\UserState;
use FL\Assistant\System\View;
use FL\Assistant\Helpers\BeaverBuilderHelper;
/**
 * Class OnEditUserProfile
 * @package FL\Assistant\Hooks\Actions
 *
 */
class OnEditUserProfile {

	/**
	 * @var View
	 */
	protected $view;

	/**
	 * OnEditUserProfile constructor.
	 *
	 * @param View $view
	 */
	public function __construct( View $view ) {
		$this->view = $view;
	}


	/**
	 * @param $user
	 */
	public function __invoke( $user ) {

		if ( ! current_user_can( 'edit_others_posts' ) || BeaverBuilderHelper::is_assistant_extension() ) {
			return false;
		}

		$state = get_user_meta( $user->ID, UserState::FL_ASSISTANT_STATE, true );
		$state = $state ? $state : UserState::$default_state;
		$window = $state['window'];

		if ( ! apply_filters( 'fl_assistant_should_enqueue', true ) ) {
			return false;
		}

		$this->view->render(
			'user-profile', [
				'show_in_admin'      => $state['shouldShowInAdmin'],
				'window'             => $window,
				'hidden_appearance'  => isset( $window['hiddenAppearance'] ) ? $window['hiddenAppearance'] : '',
				'hidden_appearances' => [
					''          => __( 'Button (Default)', 'assistant' ),
					'admin_bar' => __( 'Admin Bar Item', 'assistant' ),
				],
			]
		);
	}
}

```
