@@ -7,97 +7,97 @@ |
||
7 | 7 | |
8 | 8 | class TaxonomyController |
9 | 9 | { |
10 | - /** |
|
11 | - * @return void |
|
12 | - * @action Application::TAXONOMY._add_form_fields |
|
13 | - * @action Application::TAXONOMY._edit_form |
|
14 | - */ |
|
15 | - public function disableParents() |
|
16 | - { |
|
17 | - global $wp_taxonomies; |
|
18 | - $wp_taxonomies[Application::TAXONOMY]->hierarchical = false; |
|
19 | - } |
|
10 | + /** |
|
11 | + * @return void |
|
12 | + * @action Application::TAXONOMY._add_form_fields |
|
13 | + * @action Application::TAXONOMY._edit_form |
|
14 | + */ |
|
15 | + public function disableParents() |
|
16 | + { |
|
17 | + global $wp_taxonomies; |
|
18 | + $wp_taxonomies[Application::TAXONOMY]->hierarchical = false; |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * @return void |
|
23 | - * @action Application::TAXONOMY._term_edit_form_top |
|
24 | - * @action Application::TAXONOMY._term_new_form_tag |
|
25 | - */ |
|
26 | - public function enableParents() |
|
27 | - { |
|
28 | - global $wp_taxonomies; |
|
29 | - $wp_taxonomies[Application::TAXONOMY]->hierarchical = true; |
|
30 | - } |
|
21 | + /** |
|
22 | + * @return void |
|
23 | + * @action Application::TAXONOMY._term_edit_form_top |
|
24 | + * @action Application::TAXONOMY._term_new_form_tag |
|
25 | + */ |
|
26 | + public function enableParents() |
|
27 | + { |
|
28 | + global $wp_taxonomies; |
|
29 | + $wp_taxonomies[Application::TAXONOMY]->hierarchical = true; |
|
30 | + } |
|
31 | 31 | |
32 | - /** |
|
33 | - * @return void |
|
34 | - * @action restrict_manage_posts |
|
35 | - */ |
|
36 | - public function renderTaxonomyFilter() |
|
37 | - { |
|
38 | - if (!is_object_in_taxonomy(glsr_current_screen()->post_type, Application::TAXONOMY)) { |
|
39 | - return; |
|
40 | - } |
|
41 | - echo glsr(Builder::class)->label(__('Filter by category', 'site-reviews'), [ |
|
42 | - 'class' => 'screen-reader-text', |
|
43 | - 'for' => Application::TAXONOMY, |
|
44 | - ]); |
|
45 | - wp_dropdown_categories([ |
|
46 | - 'depth' => 3, |
|
47 | - 'hide_empty' => true, |
|
48 | - 'hide_if_empty' => true, |
|
49 | - 'hierarchical' => true, |
|
50 | - 'name' => Application::TAXONOMY, |
|
51 | - 'orderby' => 'name', |
|
52 | - 'selected' => $this->getSelected(), |
|
53 | - 'show_count' => false, |
|
54 | - 'show_option_all' => $this->getShowOptionAll(), |
|
55 | - 'taxonomy' => Application::TAXONOMY, |
|
56 | - 'value_field' => 'slug', |
|
57 | - ]); |
|
58 | - } |
|
32 | + /** |
|
33 | + * @return void |
|
34 | + * @action restrict_manage_posts |
|
35 | + */ |
|
36 | + public function renderTaxonomyFilter() |
|
37 | + { |
|
38 | + if (!is_object_in_taxonomy(glsr_current_screen()->post_type, Application::TAXONOMY)) { |
|
39 | + return; |
|
40 | + } |
|
41 | + echo glsr(Builder::class)->label(__('Filter by category', 'site-reviews'), [ |
|
42 | + 'class' => 'screen-reader-text', |
|
43 | + 'for' => Application::TAXONOMY, |
|
44 | + ]); |
|
45 | + wp_dropdown_categories([ |
|
46 | + 'depth' => 3, |
|
47 | + 'hide_empty' => true, |
|
48 | + 'hide_if_empty' => true, |
|
49 | + 'hierarchical' => true, |
|
50 | + 'name' => Application::TAXONOMY, |
|
51 | + 'orderby' => 'name', |
|
52 | + 'selected' => $this->getSelected(), |
|
53 | + 'show_count' => false, |
|
54 | + 'show_option_all' => $this->getShowOptionAll(), |
|
55 | + 'taxonomy' => Application::TAXONOMY, |
|
56 | + 'value_field' => 'slug', |
|
57 | + ]); |
|
58 | + } |
|
59 | 59 | |
60 | - /** |
|
61 | - * @param int $postId |
|
62 | - * @param array $terms |
|
63 | - * @param array $newTTIds |
|
64 | - * @param string $taxonomy |
|
65 | - * @param bool $append |
|
66 | - * @param array $oldTTIds |
|
67 | - * @return void |
|
68 | - * @action set_object_terms |
|
69 | - */ |
|
70 | - public function restrictTermSelection($postId, $terms, $newTTIds, $taxonomy, $append, $oldTTIds) |
|
71 | - { |
|
72 | - if (Application::TAXONOMY != $taxonomy || count($newTTIds) <= 1) { |
|
73 | - return; |
|
74 | - } |
|
75 | - $diff = array_diff($newTTIds, $oldTTIds); |
|
76 | - if (empty($newTerm = array_shift($diff))) { |
|
77 | - $newTerm = array_shift($newTTIds); |
|
78 | - } |
|
79 | - if ($newTerm) { |
|
80 | - wp_set_object_terms($postId, intval($newTerm), $taxonomy); |
|
81 | - } |
|
82 | - } |
|
60 | + /** |
|
61 | + * @param int $postId |
|
62 | + * @param array $terms |
|
63 | + * @param array $newTTIds |
|
64 | + * @param string $taxonomy |
|
65 | + * @param bool $append |
|
66 | + * @param array $oldTTIds |
|
67 | + * @return void |
|
68 | + * @action set_object_terms |
|
69 | + */ |
|
70 | + public function restrictTermSelection($postId, $terms, $newTTIds, $taxonomy, $append, $oldTTIds) |
|
71 | + { |
|
72 | + if (Application::TAXONOMY != $taxonomy || count($newTTIds) <= 1) { |
|
73 | + return; |
|
74 | + } |
|
75 | + $diff = array_diff($newTTIds, $oldTTIds); |
|
76 | + if (empty($newTerm = array_shift($diff))) { |
|
77 | + $newTerm = array_shift($newTTIds); |
|
78 | + } |
|
79 | + if ($newTerm) { |
|
80 | + wp_set_object_terms($postId, intval($newTerm), $taxonomy); |
|
81 | + } |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @return string |
|
86 | - */ |
|
87 | - protected function getSelected() |
|
88 | - { |
|
89 | - global $wp_query; |
|
90 | - return glsr_get($wp_query->query, Application::TAXONOMY); |
|
91 | - } |
|
84 | + /** |
|
85 | + * @return string |
|
86 | + */ |
|
87 | + protected function getSelected() |
|
88 | + { |
|
89 | + global $wp_query; |
|
90 | + return glsr_get($wp_query->query, Application::TAXONOMY); |
|
91 | + } |
|
92 | 92 | |
93 | - /** |
|
94 | - * @return string |
|
95 | - */ |
|
96 | - protected function getShowOptionAll() |
|
97 | - { |
|
98 | - $taxonomy = get_taxonomy(Application::TAXONOMY); |
|
99 | - return $taxonomy |
|
100 | - ? ucfirst(strtolower($taxonomy->labels->all_items)) |
|
101 | - : ''; |
|
102 | - } |
|
93 | + /** |
|
94 | + * @return string |
|
95 | + */ |
|
96 | + protected function getShowOptionAll() |
|
97 | + { |
|
98 | + $taxonomy = get_taxonomy(Application::TAXONOMY); |
|
99 | + return $taxonomy |
|
100 | + ? ucfirst(strtolower($taxonomy->labels->all_items)) |
|
101 | + : ''; |
|
102 | + } |
|
103 | 103 | } |
@@ -35,14 +35,14 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function renderTaxonomyFilter() |
37 | 37 | { |
38 | - if (!is_object_in_taxonomy(glsr_current_screen()->post_type, Application::TAXONOMY)) { |
|
38 | + if( !is_object_in_taxonomy( glsr_current_screen()->post_type, Application::TAXONOMY ) ) { |
|
39 | 39 | return; |
40 | 40 | } |
41 | - echo glsr(Builder::class)->label(__('Filter by category', 'site-reviews'), [ |
|
41 | + echo glsr( Builder::class )->label( __( 'Filter by category', 'site-reviews' ), [ |
|
42 | 42 | 'class' => 'screen-reader-text', |
43 | 43 | 'for' => Application::TAXONOMY, |
44 | - ]); |
|
45 | - wp_dropdown_categories([ |
|
44 | + ] ); |
|
45 | + wp_dropdown_categories( [ |
|
46 | 46 | 'depth' => 3, |
47 | 47 | 'hide_empty' => true, |
48 | 48 | 'hide_if_empty' => true, |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'show_option_all' => $this->getShowOptionAll(), |
55 | 55 | 'taxonomy' => Application::TAXONOMY, |
56 | 56 | 'value_field' => 'slug', |
57 | - ]); |
|
57 | + ] ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -67,17 +67,17 @@ discard block |
||
67 | 67 | * @return void |
68 | 68 | * @action set_object_terms |
69 | 69 | */ |
70 | - public function restrictTermSelection($postId, $terms, $newTTIds, $taxonomy, $append, $oldTTIds) |
|
70 | + public function restrictTermSelection( $postId, $terms, $newTTIds, $taxonomy, $append, $oldTTIds ) |
|
71 | 71 | { |
72 | - if (Application::TAXONOMY != $taxonomy || count($newTTIds) <= 1) { |
|
72 | + if( Application::TAXONOMY != $taxonomy || count( $newTTIds ) <= 1 ) { |
|
73 | 73 | return; |
74 | 74 | } |
75 | - $diff = array_diff($newTTIds, $oldTTIds); |
|
76 | - if (empty($newTerm = array_shift($diff))) { |
|
77 | - $newTerm = array_shift($newTTIds); |
|
75 | + $diff = array_diff( $newTTIds, $oldTTIds ); |
|
76 | + if( empty($newTerm = array_shift( $diff )) ) { |
|
77 | + $newTerm = array_shift( $newTTIds ); |
|
78 | 78 | } |
79 | - if ($newTerm) { |
|
80 | - wp_set_object_terms($postId, intval($newTerm), $taxonomy); |
|
79 | + if( $newTerm ) { |
|
80 | + wp_set_object_terms( $postId, intval( $newTerm ), $taxonomy ); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | protected function getSelected() |
88 | 88 | { |
89 | 89 | global $wp_query; |
90 | - return glsr_get($wp_query->query, Application::TAXONOMY); |
|
90 | + return glsr_get( $wp_query->query, Application::TAXONOMY ); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -95,9 +95,9 @@ discard block |
||
95 | 95 | */ |
96 | 96 | protected function getShowOptionAll() |
97 | 97 | { |
98 | - $taxonomy = get_taxonomy(Application::TAXONOMY); |
|
98 | + $taxonomy = get_taxonomy( Application::TAXONOMY ); |
|
99 | 99 | return $taxonomy |
100 | - ? ucfirst(strtolower($taxonomy->labels->all_items)) |
|
100 | + ? ucfirst( strtolower( $taxonomy->labels->all_items ) ) |
|
101 | 101 | : ''; |
102 | 102 | } |
103 | 103 | } |
@@ -7,85 +7,85 @@ |
||
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 | } |
@@ -12,9 +12,9 @@ discard block |
||
12 | 12 | * @return array |
13 | 13 | * @filter block_categories |
14 | 14 | */ |
15 | - public function filterBlockCategories($categories) |
|
15 | + public function filterBlockCategories( $categories ) |
|
16 | 16 | { |
17 | - $categories = glsr(Helper::class)->consolidateArray($categories); |
|
17 | + $categories = glsr( Helper::class )->consolidateArray( $categories ); |
|
18 | 18 | $categories[] = [ |
19 | 19 | 'icon' => null, |
20 | 20 | 'slug' => Application::ID, |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @filter classic_editor_enabled_editors_for_post_type |
31 | 31 | * @plugin classic-editor/classic-editor.php |
32 | 32 | */ |
33 | - public function filterEnabledEditors($editors, $postType) |
|
33 | + public function filterEnabledEditors( $editors, $postType ) |
|
34 | 34 | { |
35 | 35 | return Application::POST_TYPE == $postType |
36 | 36 | ? ['block_editor' => false, 'classic_editor' => false] |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return bool |
44 | 44 | * @filter use_block_editor_for_post_type |
45 | 45 | */ |
46 | - public function filterUseBlockEditor($bool, $postType) |
|
46 | + public function filterUseBlockEditor( $bool, $postType ) |
|
47 | 47 | { |
48 | 48 | return Application::POST_TYPE == $postType |
49 | 49 | ? false |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | { |
58 | 58 | wp_register_style( |
59 | 59 | Application::ID.'/blocks', |
60 | - glsr()->url('assets/styles/'.Application::ID.'-blocks.css'), |
|
60 | + glsr()->url( 'assets/styles/'.Application::ID.'-blocks.css' ), |
|
61 | 61 | ['wp-edit-blocks'], |
62 | 62 | glsr()->version |
63 | 63 | ); |
64 | 64 | wp_register_script( |
65 | 65 | Application::ID.'/blocks', |
66 | - glsr()->url('assets/scripts/'.Application::ID.'-blocks.js'), |
|
66 | + glsr()->url( 'assets/scripts/'.Application::ID.'-blocks.js' ), |
|
67 | 67 | ['wp-api-fetch', 'wp-blocks', 'wp-i18n', 'wp-editor', 'wp-element', Application::ID], |
68 | 68 | glsr()->version |
69 | 69 | ); |
@@ -78,14 +78,14 @@ discard block |
||
78 | 78 | $blocks = [ |
79 | 79 | 'form', 'reviews', 'summary', |
80 | 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)); |
|
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 | 86 | continue; |
87 | 87 | } |
88 | - glsr($blockClass)->register($block); |
|
88 | + glsr( $blockClass )->register( $block ); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | } |
@@ -33,7 +33,8 @@ |
||
33 | 33 | protected $settings; |
34 | 34 | protected $taxonomy; |
35 | 35 | |
36 | - public function __construct(Application $app ) { |
|
36 | + public function __construct(Application $app ) |
|
37 | + { |
|
37 | 38 | $this->app = $app; |
38 | 39 | $this->admin = $app->make(AdminController::class); |
39 | 40 | $this->blocks = $app->make(BlocksController::class); |
@@ -18,100 +18,100 @@ |
||
18 | 18 | |
19 | 19 | class Actions implements HooksContract |
20 | 20 | { |
21 | - protected $admin; |
|
22 | - protected $app; |
|
23 | - protected $blocks; |
|
24 | - protected $console; |
|
25 | - protected $editor; |
|
26 | - protected $listtable; |
|
27 | - protected $menu; |
|
28 | - protected $main; |
|
29 | - protected $public; |
|
30 | - protected $rebusify; |
|
31 | - protected $review; |
|
32 | - protected $router; |
|
33 | - protected $settings; |
|
34 | - protected $taxonomy; |
|
21 | + protected $admin; |
|
22 | + protected $app; |
|
23 | + protected $blocks; |
|
24 | + protected $console; |
|
25 | + protected $editor; |
|
26 | + protected $listtable; |
|
27 | + protected $menu; |
|
28 | + protected $main; |
|
29 | + protected $public; |
|
30 | + protected $rebusify; |
|
31 | + protected $review; |
|
32 | + protected $router; |
|
33 | + protected $settings; |
|
34 | + protected $taxonomy; |
|
35 | 35 | |
36 | - public function __construct(Application $app ) { |
|
37 | - $this->app = $app; |
|
38 | - $this->admin = $app->make(AdminController::class); |
|
39 | - $this->blocks = $app->make(BlocksController::class); |
|
40 | - $this->console = $app->make(Console::class); |
|
41 | - $this->editor = $app->make(EditorController::class); |
|
42 | - $this->listtable = $app->make(ListTableController::class); |
|
43 | - $this->main = $app->make(MainController::class); |
|
44 | - $this->menu = $app->make(MenuController::class); |
|
45 | - $this->public = $app->make(PublicController::class); |
|
46 | - $this->rebusify = $app->make(RebusifyController::class); |
|
47 | - $this->review = $app->make(ReviewController::class); |
|
48 | - $this->router = $app->make(Router::class); |
|
49 | - $this->settings = $app->make(SettingsController::class); |
|
50 | - $this->taxonomy = $app->make(TaxonomyController::class); |
|
51 | - } |
|
36 | + public function __construct(Application $app ) { |
|
37 | + $this->app = $app; |
|
38 | + $this->admin = $app->make(AdminController::class); |
|
39 | + $this->blocks = $app->make(BlocksController::class); |
|
40 | + $this->console = $app->make(Console::class); |
|
41 | + $this->editor = $app->make(EditorController::class); |
|
42 | + $this->listtable = $app->make(ListTableController::class); |
|
43 | + $this->main = $app->make(MainController::class); |
|
44 | + $this->menu = $app->make(MenuController::class); |
|
45 | + $this->public = $app->make(PublicController::class); |
|
46 | + $this->rebusify = $app->make(RebusifyController::class); |
|
47 | + $this->review = $app->make(ReviewController::class); |
|
48 | + $this->router = $app->make(Router::class); |
|
49 | + $this->settings = $app->make(SettingsController::class); |
|
50 | + $this->taxonomy = $app->make(TaxonomyController::class); |
|
51 | + } |
|
52 | 52 | |
53 | - /** |
|
54 | - * @return void |
|
55 | - */ |
|
56 | - public function run() |
|
57 | - { |
|
58 | - add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
59 | - add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
60 | - add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
61 | - add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
62 | - add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
63 | - add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
64 | - add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
65 | - add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
66 | - add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
67 | - add_action('init', [$this->blocks, 'registerBlocks']); |
|
68 | - add_action('admin_footer', [$this->console, 'logOnce']); |
|
69 | - add_action('wp_footer', [$this->console, 'logOnce']); |
|
70 | - add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
71 | - add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
72 | - add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
73 | - add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
74 | - add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
75 | - add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
76 | - add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
77 | - add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
78 | - add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes']); |
|
79 | - add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
80 | - add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
81 | - add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
82 | - add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
83 | - add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
84 | - add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
85 | - add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
86 | - add_action('init', [$this->main, 'registerPostType'], 8); |
|
87 | - add_action('init', [$this->main, 'registerShortcodes']); |
|
88 | - add_action('init', [$this->main, 'registerTaxonomy']); |
|
89 | - add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
90 | - add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
91 | - add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
92 | - add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
93 | - add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
94 | - add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
95 | - add_action('wp_footer', [$this->public, 'renderSchema']); |
|
96 | - add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
97 | - add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
98 | - add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
99 | - add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 4); |
|
100 | - add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
101 | - add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
102 | - add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
103 | - add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
104 | - add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
105 | - add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
106 | - add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
107 | - add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
108 | - add_action('init', [$this->router, 'routePublicPostRequest']); |
|
109 | - add_action('admin_init', [$this->settings, 'registerSettings']); |
|
110 | - add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
111 | - add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
112 | - add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
113 | - add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
114 | - add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
115 | - add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
116 | - } |
|
53 | + /** |
|
54 | + * @return void |
|
55 | + */ |
|
56 | + public function run() |
|
57 | + { |
|
58 | + add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
59 | + add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
60 | + add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
61 | + add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
62 | + add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
63 | + add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
64 | + add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
65 | + add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
66 | + add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
67 | + add_action('init', [$this->blocks, 'registerBlocks']); |
|
68 | + add_action('admin_footer', [$this->console, 'logOnce']); |
|
69 | + add_action('wp_footer', [$this->console, 'logOnce']); |
|
70 | + add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
71 | + add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
72 | + add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
73 | + add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
74 | + add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
75 | + add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
76 | + add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
77 | + add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
78 | + add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes']); |
|
79 | + add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
80 | + add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
81 | + add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
82 | + add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
83 | + add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
84 | + add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
85 | + add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
86 | + add_action('init', [$this->main, 'registerPostType'], 8); |
|
87 | + add_action('init', [$this->main, 'registerShortcodes']); |
|
88 | + add_action('init', [$this->main, 'registerTaxonomy']); |
|
89 | + add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
90 | + add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
91 | + add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
92 | + add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
93 | + add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
94 | + add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
95 | + add_action('wp_footer', [$this->public, 'renderSchema']); |
|
96 | + add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
97 | + add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
98 | + add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
99 | + add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 4); |
|
100 | + add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
101 | + add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
102 | + add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
103 | + add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
104 | + add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
105 | + add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
106 | + add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
107 | + add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
108 | + add_action('init', [$this->router, 'routePublicPostRequest']); |
|
109 | + add_action('admin_init', [$this->settings, 'registerSettings']); |
|
110 | + add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
111 | + add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
112 | + add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
113 | + add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
114 | + add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
115 | + add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
116 | + } |
|
117 | 117 | } |
@@ -33,21 +33,21 @@ discard block |
||
33 | 33 | protected $settings; |
34 | 34 | protected $taxonomy; |
35 | 35 | |
36 | - public function __construct(Application $app ) { |
|
36 | + public function __construct( Application $app ) { |
|
37 | 37 | $this->app = $app; |
38 | - $this->admin = $app->make(AdminController::class); |
|
39 | - $this->blocks = $app->make(BlocksController::class); |
|
40 | - $this->console = $app->make(Console::class); |
|
41 | - $this->editor = $app->make(EditorController::class); |
|
42 | - $this->listtable = $app->make(ListTableController::class); |
|
43 | - $this->main = $app->make(MainController::class); |
|
44 | - $this->menu = $app->make(MenuController::class); |
|
45 | - $this->public = $app->make(PublicController::class); |
|
46 | - $this->rebusify = $app->make(RebusifyController::class); |
|
47 | - $this->review = $app->make(ReviewController::class); |
|
48 | - $this->router = $app->make(Router::class); |
|
49 | - $this->settings = $app->make(SettingsController::class); |
|
50 | - $this->taxonomy = $app->make(TaxonomyController::class); |
|
38 | + $this->admin = $app->make( AdminController::class ); |
|
39 | + $this->blocks = $app->make( BlocksController::class ); |
|
40 | + $this->console = $app->make( Console::class ); |
|
41 | + $this->editor = $app->make( EditorController::class ); |
|
42 | + $this->listtable = $app->make( ListTableController::class ); |
|
43 | + $this->main = $app->make( MainController::class ); |
|
44 | + $this->menu = $app->make( MenuController::class ); |
|
45 | + $this->public = $app->make( PublicController::class ); |
|
46 | + $this->rebusify = $app->make( RebusifyController::class ); |
|
47 | + $this->review = $app->make( ReviewController::class ); |
|
48 | + $this->router = $app->make( Router::class ); |
|
49 | + $this->settings = $app->make( SettingsController::class ); |
|
50 | + $this->taxonomy = $app->make( TaxonomyController::class ); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -55,63 +55,63 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function run() |
57 | 57 | { |
58 | - add_action('admin_enqueue_scripts', [$this->admin, 'enqueueAssets']); |
|
59 | - add_action('admin_init', [$this->admin, 'registerTinymcePopups']); |
|
60 | - add_action('media_buttons', [$this->admin, 'renderTinymceButton'], 11); |
|
61 | - add_action('plugins_loaded', [$this->app, 'getDefaults'], 11); |
|
62 | - add_action('plugins_loaded', [$this->app, 'registerAddons']); |
|
63 | - add_action('plugins_loaded', [$this->app, 'registerLanguages']); |
|
64 | - add_action('plugins_loaded', [$this->app, 'registerReviewTypes']); |
|
65 | - add_action('upgrader_process_complete', [$this->app, 'upgraded'], 10, 2); |
|
66 | - add_action('init', [$this->blocks, 'registerAssets'], 9); |
|
67 | - add_action('init', [$this->blocks, 'registerBlocks']); |
|
68 | - add_action('admin_footer', [$this->console, 'logOnce']); |
|
69 | - add_action('wp_footer', [$this->console, 'logOnce']); |
|
70 | - add_action('admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels']); |
|
71 | - add_action('add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes']); |
|
72 | - add_action('admin_print_scripts', [$this->editor, 'removeAutosave'], 999); |
|
73 | - add_action('admin_menu', [$this->editor, 'removeMetaBoxes']); |
|
74 | - add_action('current_screen', [$this->editor, 'removePostTypeSupport']); |
|
75 | - add_action('post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox']); |
|
76 | - add_action('admin_head', [$this->editor, 'renderReviewFields']); |
|
77 | - add_action('admin_action_revert', [$this->editor, 'revertReview']); |
|
78 | - add_action('save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes']); |
|
79 | - add_action('admin_action_approve', [$this->listtable, 'approve']); |
|
80 | - add_action('bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2); |
|
81 | - add_action('restrict_manage_posts', [$this->listtable, 'renderColumnFilters']); |
|
82 | - add_action('manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2); |
|
83 | - add_action('save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields']); |
|
84 | - add_action('pre_get_posts', [$this->listtable, 'setQueryForColumn']); |
|
85 | - add_action('admin_action_unapprove', [$this->listtable, 'unapprove']); |
|
86 | - add_action('init', [$this->main, 'registerPostType'], 8); |
|
87 | - add_action('init', [$this->main, 'registerShortcodes']); |
|
88 | - add_action('init', [$this->main, 'registerTaxonomy']); |
|
89 | - add_action('widgets_init', [$this->main, 'registerWidgets']); |
|
90 | - add_action('admin_menu', [$this->menu, 'registerMenuCount']); |
|
91 | - add_action('admin_menu', [$this->menu, 'registerSubMenus']); |
|
92 | - add_action('admin_init', [$this->menu, 'setCustomPermissions'], 999); |
|
93 | - add_action('wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999); |
|
94 | - add_filter('site-reviews/builder', [$this->public, 'modifyBuilder']); |
|
95 | - add_action('wp_footer', [$this->public, 'renderSchema']); |
|
96 | - add_action('site-reviews/review/created', [$this->rebusify, 'onCreated']); |
|
97 | - add_action('site-reviews/review/reverted', [$this->rebusify, 'onReverted']); |
|
98 | - add_action('site-reviews/review/saved', [$this->rebusify, 'onSaved']); |
|
99 | - add_action('updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 4); |
|
100 | - add_action('set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6); |
|
101 | - add_action('transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3); |
|
102 | - add_action('site-reviews/review/created', [$this->review, 'onAfterCreate']); |
|
103 | - add_action('before_delete_post', [$this->review, 'onBeforeDelete']); |
|
104 | - add_action('update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4); |
|
105 | - add_action('admin_init', [$this->router, 'routeAdminPostRequest']); |
|
106 | - add_action('wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
107 | - add_action('wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest']); |
|
108 | - add_action('init', [$this->router, 'routePublicPostRequest']); |
|
109 | - add_action('admin_init', [$this->settings, 'registerSettings']); |
|
110 | - add_action(Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents']); |
|
111 | - add_action(Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents']); |
|
112 | - add_action(Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents']); |
|
113 | - add_action(Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents']); |
|
114 | - add_action('restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9); |
|
115 | - add_action('set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6); |
|
58 | + add_action( 'admin_enqueue_scripts', [$this->admin, 'enqueueAssets'] ); |
|
59 | + add_action( 'admin_init', [$this->admin, 'registerTinymcePopups'] ); |
|
60 | + add_action( 'media_buttons', [$this->admin, 'renderTinymceButton'], 11 ); |
|
61 | + add_action( 'plugins_loaded', [$this->app, 'getDefaults'], 11 ); |
|
62 | + add_action( 'plugins_loaded', [$this->app, 'registerAddons'] ); |
|
63 | + add_action( 'plugins_loaded', [$this->app, 'registerLanguages'] ); |
|
64 | + add_action( 'plugins_loaded', [$this->app, 'registerReviewTypes'] ); |
|
65 | + add_action( 'upgrader_process_complete', [$this->app, 'upgraded'], 10, 2 ); |
|
66 | + add_action( 'init', [$this->blocks, 'registerAssets'], 9 ); |
|
67 | + add_action( 'init', [$this->blocks, 'registerBlocks'] ); |
|
68 | + add_action( 'admin_footer', [$this->console, 'logOnce'] ); |
|
69 | + add_action( 'wp_footer', [$this->console, 'logOnce'] ); |
|
70 | + add_action( 'admin_enqueue_scripts', [$this->editor, 'customizePostStatusLabels'] ); |
|
71 | + add_action( 'add_meta_boxes_'.Application::POST_TYPE, [$this->editor, 'registerMetaBoxes'] ); |
|
72 | + add_action( 'admin_print_scripts', [$this->editor, 'removeAutosave'], 999 ); |
|
73 | + add_action( 'admin_menu', [$this->editor, 'removeMetaBoxes'] ); |
|
74 | + add_action( 'current_screen', [$this->editor, 'removePostTypeSupport'] ); |
|
75 | + add_action( 'post_submitbox_misc_actions', [$this->editor, 'renderPinnedInPublishMetaBox'] ); |
|
76 | + add_action( 'admin_head', [$this->editor, 'renderReviewFields'] ); |
|
77 | + add_action( 'admin_action_revert', [$this->editor, 'revertReview'] ); |
|
78 | + add_action( 'save_post_'.Application::POST_TYPE, [$this->editor, 'saveMetaboxes'] ); |
|
79 | + add_action( 'admin_action_approve', [$this->listtable, 'approve'] ); |
|
80 | + add_action( 'bulk_edit_custom_box', [$this->listtable, 'renderBulkEditFields'], 10, 2 ); |
|
81 | + add_action( 'restrict_manage_posts', [$this->listtable, 'renderColumnFilters'] ); |
|
82 | + add_action( 'manage_'.Application::POST_TYPE.'_posts_custom_column', [$this->listtable, 'renderColumnValues'], 10, 2 ); |
|
83 | + add_action( 'save_post_'.Application::POST_TYPE, [$this->listtable, 'saveBulkEditFields'] ); |
|
84 | + add_action( 'pre_get_posts', [$this->listtable, 'setQueryForColumn'] ); |
|
85 | + add_action( 'admin_action_unapprove', [$this->listtable, 'unapprove'] ); |
|
86 | + add_action( 'init', [$this->main, 'registerPostType'], 8 ); |
|
87 | + add_action( 'init', [$this->main, 'registerShortcodes'] ); |
|
88 | + add_action( 'init', [$this->main, 'registerTaxonomy'] ); |
|
89 | + add_action( 'widgets_init', [$this->main, 'registerWidgets'] ); |
|
90 | + add_action( 'admin_menu', [$this->menu, 'registerMenuCount'] ); |
|
91 | + add_action( 'admin_menu', [$this->menu, 'registerSubMenus'] ); |
|
92 | + add_action( 'admin_init', [$this->menu, 'setCustomPermissions'], 999 ); |
|
93 | + add_action( 'wp_enqueue_scripts', [$this->public, 'enqueueAssets'], 999 ); |
|
94 | + add_filter( 'site-reviews/builder', [$this->public, 'modifyBuilder'] ); |
|
95 | + add_action( 'wp_footer', [$this->public, 'renderSchema'] ); |
|
96 | + add_action( 'site-reviews/review/created', [$this->rebusify, 'onCreated'] ); |
|
97 | + add_action( 'site-reviews/review/reverted', [$this->rebusify, 'onReverted'] ); |
|
98 | + add_action( 'site-reviews/review/saved', [$this->rebusify, 'onSaved'] ); |
|
99 | + add_action( 'updated_postmeta', [$this->rebusify, 'onUpdatedMeta'], 10, 4 ); |
|
100 | + add_action( 'set_object_terms', [$this->review, 'onAfterChangeCategory'], 10, 6 ); |
|
101 | + add_action( 'transition_post_status', [$this->review, 'onAfterChangeStatus'], 10, 3 ); |
|
102 | + add_action( 'site-reviews/review/created', [$this->review, 'onAfterCreate'] ); |
|
103 | + add_action( 'before_delete_post', [$this->review, 'onBeforeDelete'] ); |
|
104 | + add_action( 'update_postmeta', [$this->review, 'onBeforeUpdate'], 10, 4 ); |
|
105 | + add_action( 'admin_init', [$this->router, 'routeAdminPostRequest'] ); |
|
106 | + add_action( 'wp_ajax_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] ); |
|
107 | + add_action( 'wp_ajax_nopriv_'.Application::PREFIX.'action', [$this->router, 'routeAjaxRequest'] ); |
|
108 | + add_action( 'init', [$this->router, 'routePublicPostRequest'] ); |
|
109 | + add_action( 'admin_init', [$this->settings, 'registerSettings'] ); |
|
110 | + add_action( Application::TAXONOMY.'_term_edit_form_top', [$this->taxonomy, 'disableParents'] ); |
|
111 | + add_action( Application::TAXONOMY.'_term_new_form_tag', [$this->taxonomy, 'disableParents'] ); |
|
112 | + add_action( Application::TAXONOMY.'_add_form_fields', [$this->taxonomy, 'enableParents'] ); |
|
113 | + add_action( Application::TAXONOMY.'_edit_form', [$this->taxonomy, 'enableParents'] ); |
|
114 | + add_action( 'restrict_manage_posts', [$this->taxonomy, 'renderTaxonomyFilter'], 9 ); |
|
115 | + add_action( 'set_object_terms', [$this->taxonomy, 'restrictTermSelection'], 9, 6 ); |
|
116 | 116 | } |
117 | 117 | } |
@@ -4,14 +4,14 @@ |
||
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 | } |
@@ -7,11 +7,11 @@ |
||
7 | 7 | public $id; |
8 | 8 | public $pinned; |
9 | 9 | |
10 | - public function __construct($input) |
|
10 | + public function __construct( $input ) |
|
11 | 11 | { |
12 | 12 | $this->id = $input['id']; |
13 | 13 | $this->pinned = isset($input['pinned']) |
14 | - ? wp_validate_boolean($input['pinned']) |
|
14 | + ? wp_validate_boolean( $input['pinned'] ) |
|
15 | 15 | : null; |
16 | 16 | } |
17 | 17 | } |
@@ -4,10 +4,10 @@ |
||
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 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $widgets; |
8 | 8 | |
9 | - public function __construct($input) |
|
9 | + public function __construct( $input ) |
|
10 | 10 | { |
11 | 11 | $this->widgets = $input; |
12 | 12 | } |
@@ -4,14 +4,14 @@ |
||
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 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | public $id; |
8 | 8 | public $status; |
9 | 9 | |
10 | - public function __construct($input) |
|
10 | + public function __construct( $input ) |
|
11 | 11 | { |
12 | 12 | $this->id = $input['post_id']; |
13 | 13 | $this->status = 'approve' == $input['status'] |
@@ -4,10 +4,10 @@ |
||
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 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $popups; |
8 | 8 | |
9 | - public function __construct($input) |
|
9 | + public function __construct( $input ) |
|
10 | 10 | { |
11 | 11 | $this->popups = $input; |
12 | 12 | } |
@@ -4,10 +4,10 @@ |
||
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 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $args; |
8 | 8 | |
9 | - public function __construct($input) |
|
9 | + public function __construct( $input ) |
|
10 | 10 | { |
11 | 11 | $this->args = $input; |
12 | 12 | } |
@@ -4,131 +4,131 @@ |
||
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 | } |
@@ -25,37 +25,37 @@ discard block |
||
25 | 25 | public $title; |
26 | 26 | public $url; |
27 | 27 | |
28 | - public function __construct($input) |
|
28 | + public function __construct( $input ) |
|
29 | 29 | { |
30 | 30 | $this->request = $input; |
31 | 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')); |
|
32 | + $this->assigned_to = $this->getNumeric( 'assign_to' ); |
|
33 | + $this->author = sanitize_text_field( $this->getUser( 'name' ) ); |
|
34 | 34 | $this->avatar = $this->getAvatar(); |
35 | 35 | $this->blacklisted = isset($input['blacklisted']); |
36 | - $this->category = sanitize_key($this->get('category')); |
|
37 | - $this->content = sanitize_textarea_field($this->get('content')); |
|
36 | + $this->category = sanitize_key( $this->get( 'category' ) ); |
|
37 | + $this->content = sanitize_textarea_field( $this->get( 'content' ) ); |
|
38 | 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')); |
|
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 | 47 | $this->terms = !empty($input['terms']); |
48 | - $this->title = sanitize_text_field($this->get('title')); |
|
49 | - $this->url = esc_url_raw($this->get('url')); |
|
48 | + $this->title = sanitize_text_field( $this->get( 'title' ) ); |
|
49 | + $this->url = esc_url_raw( $this->get( 'url' ) ); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @param string $key |
54 | 54 | * @return string |
55 | 55 | */ |
56 | - protected function get($key) |
|
56 | + protected function get( $key ) |
|
57 | 57 | { |
58 | - return (string) glsr_get($this->request, $key); |
|
58 | + return (string)glsr_get( $this->request, $key ); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function getAvatar() |
65 | 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')) |
|
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 | 69 | : $avatar; |
70 | 70 | } |
71 | 71 | |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | '_referer', 'assign_to', 'category', 'content', 'date', 'email', 'excluded', 'form_id', |
80 | 80 | 'gotcha', 'ip_address', 'name', 'rating', 'response', 'terms', 'title', 'url', |
81 | 81 | ]; |
82 | - $unset = apply_filters('site-reviews/create/unset-keys-from-custom', $unset); |
|
82 | + $unset = apply_filters( 'site-reviews/create/unset-keys-from-custom', $unset ); |
|
83 | 83 | $custom = $this->request; |
84 | - foreach ($unset as $value) { |
|
84 | + foreach( $unset as $value ) { |
|
85 | 85 | unset($custom[$value]); |
86 | 86 | } |
87 | 87 | return $custom; |
@@ -91,29 +91,29 @@ discard block |
||
91 | 91 | * @param string $key |
92 | 92 | * @return string |
93 | 93 | */ |
94 | - protected function getDate($key) |
|
94 | + protected function getDate( $key ) |
|
95 | 95 | { |
96 | - $date = strtotime($this->get($key)); |
|
97 | - if (false === $date) { |
|
96 | + $date = strtotime( $this->get( $key ) ); |
|
97 | + if( false === $date ) { |
|
98 | 98 | $date = time(); |
99 | 99 | } |
100 | - return get_date_from_gmt(gmdate('Y-m-d H:i:s', $date)); |
|
100 | + return get_date_from_gmt( gmdate( 'Y-m-d H:i:s', $date ) ); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
104 | 104 | * @param string $key |
105 | 105 | * @return string |
106 | 106 | */ |
107 | - protected function getUser($key) |
|
107 | + protected function getUser( $key ) |
|
108 | 108 | { |
109 | - $value = $this->get($key); |
|
110 | - if (empty($value)) { |
|
109 | + $value = $this->get( $key ); |
|
110 | + if( empty($value) ) { |
|
111 | 111 | $user = wp_get_current_user(); |
112 | 112 | $userValues = [ |
113 | 113 | 'email' => 'user_email', |
114 | 114 | 'name' => 'display_name', |
115 | 115 | ]; |
116 | - if ($user->exists() && array_key_exists($key, $userValues)) { |
|
116 | + if( $user->exists() && array_key_exists( $key, $userValues ) ) { |
|
117 | 117 | return $user->{$userValues[$key]}; |
118 | 118 | } |
119 | 119 | } |
@@ -124,10 +124,10 @@ discard block |
||
124 | 124 | * @param string $key |
125 | 125 | * @return string |
126 | 126 | */ |
127 | - protected function getNumeric($key) |
|
127 | + protected function getNumeric( $key ) |
|
128 | 128 | { |
129 | - $value = $this->get($key); |
|
130 | - return is_numeric($value) |
|
129 | + $value = $this->get( $key ); |
|
130 | + return is_numeric( $value ) |
|
131 | 131 | ? $value |
132 | 132 | : ''; |
133 | 133 | } |