Passed
Push — feature/rebusify ( 289185...639d49 )
by Paul
04:02
created
plugin/Controllers/SettingsController.php 1 patch
Indentation   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -9,103 +9,103 @@
 block discarded – undo
9 9
 
10 10
 class SettingsController extends Controller
11 11
 {
12
-    /**
13
-     * @param mixed $input
14
-     * @return array
15
-     * @callback register_setting
16
-     */
17
-    public function callbackRegisterSettings($input)
18
-    {
19
-        if (!is_array($input)) {
20
-            $input = ['settings' => []];
21
-        }
22
-        if ('settings' == key($input)) {
23
-            $options = array_replace_recursive(glsr(OptionManager::class)->all(), $input);
24
-            $options = $this->sanitizeGeneral($input, $options);
25
-            $options = $this->sanitizeSubmissions($input, $options);
26
-            $options = $this->sanitizeTranslations($input, $options);
27
-            if (filter_input(INPUT_POST, 'option_page') == Application::ID.'-settings') {
28
-                glsr(Notice::class)->addSuccess(__('Settings updated.', 'site-reviews'));
29
-            }
30
-            return $options;
31
-        }
32
-        return $input;
33
-    }
12
+	/**
13
+	 * @param mixed $input
14
+	 * @return array
15
+	 * @callback register_setting
16
+	 */
17
+	public function callbackRegisterSettings($input)
18
+	{
19
+		if (!is_array($input)) {
20
+			$input = ['settings' => []];
21
+		}
22
+		if ('settings' == key($input)) {
23
+			$options = array_replace_recursive(glsr(OptionManager::class)->all(), $input);
24
+			$options = $this->sanitizeGeneral($input, $options);
25
+			$options = $this->sanitizeSubmissions($input, $options);
26
+			$options = $this->sanitizeTranslations($input, $options);
27
+			if (filter_input(INPUT_POST, 'option_page') == Application::ID.'-settings') {
28
+				glsr(Notice::class)->addSuccess(__('Settings updated.', 'site-reviews'));
29
+			}
30
+			return $options;
31
+		}
32
+		return $input;
33
+	}
34 34
 
35
-    /**
36
-     * @return void
37
-     * @action admin_init
38
-     */
39
-    public function registerSettings()
40
-    {
41
-        register_setting(Application::ID.'-settings', OptionManager::databaseKey(), [
42
-            'sanitize_callback' => [$this, 'callbackRegisterSettings'],
43
-        ]);
44
-    }
35
+	/**
36
+	 * @return void
37
+	 * @action admin_init
38
+	 */
39
+	public function registerSettings()
40
+	{
41
+		register_setting(Application::ID.'-settings', OptionManager::databaseKey(), [
42
+			'sanitize_callback' => [$this, 'callbackRegisterSettings'],
43
+		]);
44
+	}
45 45
 
46
-    /**
47
-     * @return array
48
-     */
49
-    protected function sanitizeGeneral(array $input, array $options)
50
-    {
51
-        $inputForm = $input['settings']['general'];
52
-        if ('yes' == $inputForm['support']['polylang'] && !$this->isPolylangActiveAndSupported()) {
53
-            $options['settings']['general']['support']['polylang'] = 'no';
54
-        }
55
-        if ('' == trim($inputForm['notification_message'])) {
56
-            $options['settings']['general']['notification_message'] = glsr()->defaults['settings']['general']['notification_message'];
57
-        }
58
-        $options['settings']['general']['notifications'] = glsr_get($inputForm, 'notifications', []);
59
-        return $options;
60
-    }
46
+	/**
47
+	 * @return array
48
+	 */
49
+	protected function sanitizeGeneral(array $input, array $options)
50
+	{
51
+		$inputForm = $input['settings']['general'];
52
+		if ('yes' == $inputForm['support']['polylang'] && !$this->isPolylangActiveAndSupported()) {
53
+			$options['settings']['general']['support']['polylang'] = 'no';
54
+		}
55
+		if ('' == trim($inputForm['notification_message'])) {
56
+			$options['settings']['general']['notification_message'] = glsr()->defaults['settings']['general']['notification_message'];
57
+		}
58
+		$options['settings']['general']['notifications'] = glsr_get($inputForm, 'notifications', []);
59
+		return $options;
60
+	}
61 61
 
62
-    /**
63
-     * @return array
64
-     */
65
-    protected function sanitizeSubmissions(array $input, array $options)
66
-    {
67
-        $inputForm = $input['settings']['submissions'];
68
-        $options['settings']['submissions']['required'] = isset($inputForm['required'])
69
-            ? $inputForm['required']
70
-            : [];
71
-        return $options;
72
-    }
62
+	/**
63
+	 * @return array
64
+	 */
65
+	protected function sanitizeSubmissions(array $input, array $options)
66
+	{
67
+		$inputForm = $input['settings']['submissions'];
68
+		$options['settings']['submissions']['required'] = isset($inputForm['required'])
69
+			? $inputForm['required']
70
+			: [];
71
+		return $options;
72
+	}
73 73
 
74
-    /**
75
-     * @return array
76
-     */
77
-    protected function sanitizeTranslations(array $input, array $options)
78
-    {
79
-        if (isset($input['settings']['strings'])) {
80
-            $options['settings']['strings'] = array_values(array_filter($input['settings']['strings']));
81
-            $allowedTags = [
82
-                'a' => ['class' => [], 'href' => [], 'target' => []],
83
-                'span' => ['class' => []],
84
-            ];
85
-            array_walk($options['settings']['strings'], function (&$string) use ($allowedTags) {
86
-                if (isset($string['s2'])) {
87
-                    $string['s2'] = wp_kses($string['s2'], $allowedTags);
88
-                }
89
-                if (isset($string['p2'])) {
90
-                    $string['p2'] = wp_kses($string['p2'], $allowedTags);
91
-                }
92
-            });
93
-        }
94
-        return $options;
95
-    }
74
+	/**
75
+	 * @return array
76
+	 */
77
+	protected function sanitizeTranslations(array $input, array $options)
78
+	{
79
+		if (isset($input['settings']['strings'])) {
80
+			$options['settings']['strings'] = array_values(array_filter($input['settings']['strings']));
81
+			$allowedTags = [
82
+				'a' => ['class' => [], 'href' => [], 'target' => []],
83
+				'span' => ['class' => []],
84
+			];
85
+			array_walk($options['settings']['strings'], function (&$string) use ($allowedTags) {
86
+				if (isset($string['s2'])) {
87
+					$string['s2'] = wp_kses($string['s2'], $allowedTags);
88
+				}
89
+				if (isset($string['p2'])) {
90
+					$string['p2'] = wp_kses($string['p2'], $allowedTags);
91
+				}
92
+			});
93
+		}
94
+		return $options;
95
+	}
96 96
 
97
-    /**
98
-     * @return bool
99
-     */
100
-    protected function isPolylangActiveAndSupported()
101
-    {
102
-        if (!glsr(Polylang::class)->isActive()) {
103
-            glsr(Notice::class)->addError(__('Please install/activate the Polylang plugin to enable integration.', 'site-reviews'));
104
-            return false;
105
-        } elseif (!glsr(Polylang::class)->isSupported()) {
106
-            glsr(Notice::class)->addError(__('Please update the Polylang plugin to v2.3.0 or greater to enable integration.', 'site-reviews'));
107
-            return false;
108
-        }
109
-        return true;
110
-    }
97
+	/**
98
+	 * @return bool
99
+	 */
100
+	protected function isPolylangActiveAndSupported()
101
+	{
102
+		if (!glsr(Polylang::class)->isActive()) {
103
+			glsr(Notice::class)->addError(__('Please install/activate the Polylang plugin to enable integration.', 'site-reviews'));
104
+			return false;
105
+		} elseif (!glsr(Polylang::class)->isSupported()) {
106
+			glsr(Notice::class)->addError(__('Please update the Polylang plugin to v2.3.0 or greater to enable integration.', 'site-reviews'));
107
+			return false;
108
+		}
109
+		return true;
110
+	}
111 111
 }
Please login to merge, or discard this patch.
plugin/Controllers/BlocksController.php 1 patch
Indentation   +77 added lines, -77 removed lines patch added patch discarded remove patch
@@ -7,85 +7,85 @@
 block discarded – undo
7 7
 
8 8
 class BlocksController extends Controller
9 9
 {
10
-    /**
11
-     * @param array $categories
12
-     * @return array
13
-     * @filter block_categories
14
-     */
15
-    public function filterBlockCategories($categories)
16
-    {
17
-        $categories = glsr(Helper::class)->consolidateArray($categories);
18
-        $categories[] = [
19
-            'icon' => null,
20
-            'slug' => Application::ID,
21
-            'title' => glsr()->name,
22
-        ];
23
-        return $categories;
24
-    }
10
+	/**
11
+	 * @param array $categories
12
+	 * @return array
13
+	 * @filter block_categories
14
+	 */
15
+	public function filterBlockCategories($categories)
16
+	{
17
+		$categories = glsr(Helper::class)->consolidateArray($categories);
18
+		$categories[] = [
19
+			'icon' => null,
20
+			'slug' => Application::ID,
21
+			'title' => glsr()->name,
22
+		];
23
+		return $categories;
24
+	}
25 25
 
26
-    /**
27
-     * @param array $editors
28
-     * @param string $postType
29
-     * @return array
30
-     * @filter classic_editor_enabled_editors_for_post_type
31
-     * @plugin classic-editor/classic-editor.php
32
-     */
33
-    public function filterEnabledEditors($editors, $postType)
34
-    {
35
-        return Application::POST_TYPE == $postType
36
-            ? ['block_editor' => false, 'classic_editor' => false]
37
-            : $editors;
38
-    }
26
+	/**
27
+	 * @param array $editors
28
+	 * @param string $postType
29
+	 * @return array
30
+	 * @filter classic_editor_enabled_editors_for_post_type
31
+	 * @plugin classic-editor/classic-editor.php
32
+	 */
33
+	public function filterEnabledEditors($editors, $postType)
34
+	{
35
+		return Application::POST_TYPE == $postType
36
+			? ['block_editor' => false, 'classic_editor' => false]
37
+			: $editors;
38
+	}
39 39
 
40
-    /**
41
-     * @param bool $bool
42
-     * @param string $postType
43
-     * @return bool
44
-     * @filter use_block_editor_for_post_type
45
-     */
46
-    public function filterUseBlockEditor($bool, $postType)
47
-    {
48
-        return Application::POST_TYPE == $postType
49
-            ? false
50
-            : $bool;
51
-    }
40
+	/**
41
+	 * @param bool $bool
42
+	 * @param string $postType
43
+	 * @return bool
44
+	 * @filter use_block_editor_for_post_type
45
+	 */
46
+	public function filterUseBlockEditor($bool, $postType)
47
+	{
48
+		return Application::POST_TYPE == $postType
49
+			? false
50
+			: $bool;
51
+	}
52 52
 
53
-    /**
54
-     * @return void
55
-     */
56
-    public function registerAssets()
57
-    {
58
-        wp_register_style(
59
-            Application::ID.'/blocks',
60
-            glsr()->url('assets/styles/'.Application::ID.'-blocks.css'),
61
-            ['wp-edit-blocks'],
62
-            glsr()->version
63
-        );
64
-        wp_register_script(
65
-            Application::ID.'/blocks',
66
-            glsr()->url('assets/scripts/'.Application::ID.'-blocks.js'),
67
-            ['wp-api-fetch', 'wp-blocks', 'wp-i18n', 'wp-editor', 'wp-element', Application::ID],
68
-            glsr()->version
69
-        );
70
-    }
53
+	/**
54
+	 * @return void
55
+	 */
56
+	public function registerAssets()
57
+	{
58
+		wp_register_style(
59
+			Application::ID.'/blocks',
60
+			glsr()->url('assets/styles/'.Application::ID.'-blocks.css'),
61
+			['wp-edit-blocks'],
62
+			glsr()->version
63
+		);
64
+		wp_register_script(
65
+			Application::ID.'/blocks',
66
+			glsr()->url('assets/scripts/'.Application::ID.'-blocks.js'),
67
+			['wp-api-fetch', 'wp-blocks', 'wp-i18n', 'wp-editor', 'wp-element', Application::ID],
68
+			glsr()->version
69
+		);
70
+	}
71 71
 
72
-    /**
73
-     * @return void
74
-     * @action init
75
-     */
76
-    public function registerBlocks()
77
-    {
78
-        $blocks = [
79
-            'form', 'reviews', 'summary',
80
-        ];
81
-        foreach ($blocks as $block) {
82
-            $id = str_replace('_reviews', '', Application::ID.'_'.$block);
83
-            $blockClass = glsr(Helper::class)->buildClassName($id.'-block', 'Blocks');
84
-            if (!class_exists($blockClass)) {
85
-                glsr_log()->error(sprintf('Class missing (%s)', $blockClass));
86
-                continue;
87
-            }
88
-            glsr($blockClass)->register($block);
89
-        }
90
-    }
72
+	/**
73
+	 * @return void
74
+	 * @action init
75
+	 */
76
+	public function registerBlocks()
77
+	{
78
+		$blocks = [
79
+			'form', 'reviews', 'summary',
80
+		];
81
+		foreach ($blocks as $block) {
82
+			$id = str_replace('_reviews', '', Application::ID.'_'.$block);
83
+			$blockClass = glsr(Helper::class)->buildClassName($id.'-block', 'Blocks');
84
+			if (!class_exists($blockClass)) {
85
+				glsr_log()->error(sprintf('Class missing (%s)', $blockClass));
86
+				continue;
87
+			}
88
+			glsr($blockClass)->register($block);
89
+		}
90
+	}
91 91
 }
Please login to merge, or discard this patch.
plugin/Commands/TogglePinned.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 
5 5
 class TogglePinned
6 6
 {
7
-    public $id;
8
-    public $pinned;
7
+	public $id;
8
+	public $pinned;
9 9
 
10
-    public function __construct($input)
11
-    {
12
-        $this->id = $input['id'];
13
-        $this->pinned = isset($input['pinned'])
14
-            ? wp_validate_boolean($input['pinned'])
15
-            : null;
16
-    }
10
+	public function __construct($input)
11
+	{
12
+		$this->id = $input['id'];
13
+		$this->pinned = isset($input['pinned'])
14
+			? wp_validate_boolean($input['pinned'])
15
+			: null;
16
+	}
17 17
 }
Please login to merge, or discard this patch.
plugin/Commands/RegisterWidgets.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterWidgets
6 6
 {
7
-    public $widgets;
7
+	public $widgets;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->widgets = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->widgets = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
plugin/Commands/ChangeStatus.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@
 block discarded – undo
4 4
 
5 5
 class ChangeStatus
6 6
 {
7
-    public $id;
8
-    public $status;
7
+	public $id;
8
+	public $status;
9 9
 
10
-    public function __construct($input)
11
-    {
12
-        $this->id = $input['post_id'];
13
-        $this->status = 'approve' == $input['status']
14
-            ? 'publish'
15
-            : 'pending';
16
-    }
10
+	public function __construct($input)
11
+	{
12
+		$this->id = $input['post_id'];
13
+		$this->status = 'approve' == $input['status']
14
+			? 'publish'
15
+			: 'pending';
16
+	}
17 17
 }
Please login to merge, or discard this patch.
plugin/Commands/RegisterTinymcePopups.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterTinymcePopups
6 6
 {
7
-    public $popups;
7
+	public $popups;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->popups = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->popups = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
plugin/Commands/RegisterTaxonomy.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class RegisterTaxonomy
6 6
 {
7
-    public $args;
7
+	public $args;
8 8
 
9
-    public function __construct($input)
10
-    {
11
-        $this->args = $input;
12
-    }
9
+	public function __construct($input)
10
+	{
11
+		$this->args = $input;
12
+	}
13 13
 }
Please login to merge, or discard this patch.
plugin/Commands/CreateReview.php 1 patch
Indentation   +120 added lines, -120 removed lines patch added patch discarded remove patch
@@ -4,131 +4,131 @@
 block discarded – undo
4 4
 
5 5
 class CreateReview
6 6
 {
7
-    public $ajax_request;
8
-    public $assigned_to;
9
-    public $author;
10
-    public $avatar;
11
-    public $blacklisted;
12
-    public $category;
13
-    public $content;
14
-    public $custom;
15
-    public $date;
16
-    public $email;
17
-    public $form_id;
18
-    public $ip_address;
19
-    public $post_id;
20
-    public $rating;
21
-    public $referer;
22
-    public $request;
23
-    public $response;
24
-    public $terms;
25
-    public $title;
26
-    public $url;
7
+	public $ajax_request;
8
+	public $assigned_to;
9
+	public $author;
10
+	public $avatar;
11
+	public $blacklisted;
12
+	public $category;
13
+	public $content;
14
+	public $custom;
15
+	public $date;
16
+	public $email;
17
+	public $form_id;
18
+	public $ip_address;
19
+	public $post_id;
20
+	public $rating;
21
+	public $referer;
22
+	public $request;
23
+	public $response;
24
+	public $terms;
25
+	public $title;
26
+	public $url;
27 27
 
28
-    public function __construct($input)
29
-    {
30
-        $this->request = $input;
31
-        $this->ajax_request = isset($input['_ajax_request']);
32
-        $this->assigned_to = $this->getNumeric('assign_to');
33
-        $this->author = sanitize_text_field($this->getUser('name'));
34
-        $this->avatar = $this->getAvatar();
35
-        $this->blacklisted = isset($input['blacklisted']);
36
-        $this->category = sanitize_key($this->get('category'));
37
-        $this->content = sanitize_textarea_field($this->get('content'));
38
-        $this->custom = $this->getCustom();
39
-        $this->date = $this->getDate('date');
40
-        $this->email = sanitize_email($this->getUser('email'));
41
-        $this->form_id = sanitize_key($this->get('form_id'));
42
-        $this->ip_address = $this->get('ip_address');
43
-        $this->post_id = intval($this->get('_post_id'));
44
-        $this->rating = intval($this->get('rating'));
45
-        $this->referer = $this->get('_referer');
46
-        $this->response = sanitize_textarea_field($this->get('response'));
47
-        $this->terms = !empty($input['terms']);
48
-        $this->title = sanitize_text_field($this->get('title'));
49
-        $this->url = esc_url_raw($this->get('url'));
50
-    }
28
+	public function __construct($input)
29
+	{
30
+		$this->request = $input;
31
+		$this->ajax_request = isset($input['_ajax_request']);
32
+		$this->assigned_to = $this->getNumeric('assign_to');
33
+		$this->author = sanitize_text_field($this->getUser('name'));
34
+		$this->avatar = $this->getAvatar();
35
+		$this->blacklisted = isset($input['blacklisted']);
36
+		$this->category = sanitize_key($this->get('category'));
37
+		$this->content = sanitize_textarea_field($this->get('content'));
38
+		$this->custom = $this->getCustom();
39
+		$this->date = $this->getDate('date');
40
+		$this->email = sanitize_email($this->getUser('email'));
41
+		$this->form_id = sanitize_key($this->get('form_id'));
42
+		$this->ip_address = $this->get('ip_address');
43
+		$this->post_id = intval($this->get('_post_id'));
44
+		$this->rating = intval($this->get('rating'));
45
+		$this->referer = $this->get('_referer');
46
+		$this->response = sanitize_textarea_field($this->get('response'));
47
+		$this->terms = !empty($input['terms']);
48
+		$this->title = sanitize_text_field($this->get('title'));
49
+		$this->url = esc_url_raw($this->get('url'));
50
+	}
51 51
 
52
-    /**
53
-     * @param string $key
54
-     * @return string
55
-     */
56
-    protected function get($key)
57
-    {
58
-        return (string) glsr_get($this->request, $key);
59
-    }
52
+	/**
53
+	 * @param string $key
54
+	 * @return string
55
+	 */
56
+	protected function get($key)
57
+	{
58
+		return (string) glsr_get($this->request, $key);
59
+	}
60 60
 
61
-    /**
62
-     * @return string
63
-     */
64
-    protected function getAvatar()
65
-    {
66
-        $avatar = $this->get('avatar');
67
-        return !filter_var($avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
68
-            ? (string) get_avatar_url($this->get('email'))
69
-            : $avatar;
70
-    }
61
+	/**
62
+	 * @return string
63
+	 */
64
+	protected function getAvatar()
65
+	{
66
+		$avatar = $this->get('avatar');
67
+		return !filter_var($avatar, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)
68
+			? (string) get_avatar_url($this->get('email'))
69
+			: $avatar;
70
+	}
71 71
 
72
-    /**
73
-     * @return array
74
-     */
75
-    protected function getCustom()
76
-    {
77
-        $unset = [
78
-            '_action', '_ajax_request', '_counter', '_nonce', '_post_id', '_recaptcha-token',
79
-            '_referer', 'assign_to', 'category', 'content', 'date', 'email', 'excluded', 'form_id',
80
-            'gotcha', 'ip_address', 'name', 'rating', 'response', 'terms', 'title', 'url',
81
-        ];
82
-        $unset = apply_filters('site-reviews/create/unset-keys-from-custom', $unset);
83
-        $custom = $this->request;
84
-        foreach ($unset as $value) {
85
-            unset($custom[$value]);
86
-        }
87
-        return $custom;
88
-    }
72
+	/**
73
+	 * @return array
74
+	 */
75
+	protected function getCustom()
76
+	{
77
+		$unset = [
78
+			'_action', '_ajax_request', '_counter', '_nonce', '_post_id', '_recaptcha-token',
79
+			'_referer', 'assign_to', 'category', 'content', 'date', 'email', 'excluded', 'form_id',
80
+			'gotcha', 'ip_address', 'name', 'rating', 'response', 'terms', 'title', 'url',
81
+		];
82
+		$unset = apply_filters('site-reviews/create/unset-keys-from-custom', $unset);
83
+		$custom = $this->request;
84
+		foreach ($unset as $value) {
85
+			unset($custom[$value]);
86
+		}
87
+		return $custom;
88
+	}
89 89
 
90
-    /**
91
-     * @param string $key
92
-     * @return string
93
-     */
94
-    protected function getDate($key)
95
-    {
96
-        $date = strtotime($this->get($key));
97
-        if (false === $date) {
98
-            $date = time();
99
-        }
100
-        return get_date_from_gmt(gmdate('Y-m-d H:i:s', $date));
101
-    }
90
+	/**
91
+	 * @param string $key
92
+	 * @return string
93
+	 */
94
+	protected function getDate($key)
95
+	{
96
+		$date = strtotime($this->get($key));
97
+		if (false === $date) {
98
+			$date = time();
99
+		}
100
+		return get_date_from_gmt(gmdate('Y-m-d H:i:s', $date));
101
+	}
102 102
 
103
-    /**
104
-     * @param string $key
105
-     * @return string
106
-     */
107
-    protected function getUser($key)
108
-    {
109
-        $value = $this->get($key);
110
-        if (empty($value)) {
111
-            $user = wp_get_current_user();
112
-            $userValues = [
113
-                'email' => 'user_email',
114
-                'name' => 'display_name',
115
-            ];
116
-            if ($user->exists() && array_key_exists($key, $userValues)) {
117
-                return $user->{$userValues[$key]};
118
-            }
119
-        }
120
-        return $value;
121
-    }
103
+	/**
104
+	 * @param string $key
105
+	 * @return string
106
+	 */
107
+	protected function getUser($key)
108
+	{
109
+		$value = $this->get($key);
110
+		if (empty($value)) {
111
+			$user = wp_get_current_user();
112
+			$userValues = [
113
+				'email' => 'user_email',
114
+				'name' => 'display_name',
115
+			];
116
+			if ($user->exists() && array_key_exists($key, $userValues)) {
117
+				return $user->{$userValues[$key]};
118
+			}
119
+		}
120
+		return $value;
121
+	}
122 122
 
123
-    /**
124
-     * @param string $key
125
-     * @return string
126
-     */
127
-    protected function getNumeric($key)
128
-    {
129
-        $value = $this->get($key);
130
-        return is_numeric($value)
131
-            ? $value
132
-            : '';
133
-    }
123
+	/**
124
+	 * @param string $key
125
+	 * @return string
126
+	 */
127
+	protected function getNumeric($key)
128
+	{
129
+		$value = $this->get($key);
130
+		return is_numeric($value)
131
+			? $value
132
+			: '';
133
+	}
134 134
 }
Please login to merge, or discard this patch.
plugin/Commands/EnqueueAdminAssets.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,10 +4,10 @@
 block discarded – undo
4 4
 
5 5
 class EnqueueAdminAssets
6 6
 {
7
-    public $pointers;
7
+	public $pointers;
8 8
 
9
-    public function __construct(array $input)
10
-    {
11
-        $this->pointers = $input['pointers'];
12
-    }
9
+	public function __construct(array $input)
10
+	{
11
+		$this->pointers = $input['pointers'];
12
+	}
13 13
 }
Please login to merge, or discard this patch.