PluginProbe
Assistant – Every Day Productivity Apps / 0.3.1
Assistant – Every Day Productivity Apps v0.3.1
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / Hooks / Actions / OnEditUserProfile.php

OnEditUserProfile.php in Assistant – Every Day Productivity Apps 0.3.1, at backend/src/Hooks/Actions/OnEditUserProfile.php

51 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FL\Assistant\Hooks\Actions;
4
5 use FL\Assistant\Data\UserState;
6 use FL\Assistant\System\View;
7 /**
8 * Class OnEditUserProfile
9 * @package FL\Assistant\Hooks\Actions
10 *
11 */
12 class OnEditUserProfile {
13
14 /**
15 * @var View
16 */
17 protected $view;
18
19 /**
20 * OnEditUserProfile constructor.
21 *
22 * @param View $view
23 */
24 public function __construct( View $view ) {
25 $this->view = $view;
26 }
27
28
29 /**
30 * @param $user
31 */
32 public function __invoke( $user ) {
33
34 $state = get_user_meta( $user->ID, UserState::FL_ASSISTANT_STATE, true );
35 $state = $state ? $state : UserState::$default_state;
36 $window = $state['window'];
37
38 $this->view->render(
39 'user-profile', [
40 'show_in_admin' => $state['shouldShowInAdmin'],
41 'window' => $window,
42 'hidden_appearance' => isset( $window['hiddenAppearance'] ) ? $window['hiddenAppearance'] : '',
43 'hidden_appearances' => [
44 '' => __( 'Button (Default)', 'fl-assistant' ),
45 'admin_bar' => __( 'Admin Bar Item', 'fl-assistant' ),
46 ],
47 ]
48 );
49 }
50 }
51