@@ -9,77 +9,77 @@ |
||
9 | 9 | |
10 | 10 | class RegisterPostType |
11 | 11 | { |
12 | - public $args; |
|
13 | - public $columns; |
|
14 | - public $plural; |
|
15 | - public $postType; |
|
16 | - public $single; |
|
12 | + public $args; |
|
13 | + public $columns; |
|
14 | + public $plural; |
|
15 | + public $postType; |
|
16 | + public $single; |
|
17 | 17 | |
18 | - public function __construct($input) |
|
19 | - { |
|
20 | - $args = glsr(PostTypeDefaults::class)->merge($input); |
|
21 | - $this->normalize($args); |
|
22 | - $this->normalizeColumns(); |
|
23 | - $this->normalizeLabels(); |
|
24 | - } |
|
18 | + public function __construct($input) |
|
19 | + { |
|
20 | + $args = glsr(PostTypeDefaults::class)->merge($input); |
|
21 | + $this->normalize($args); |
|
22 | + $this->normalizeColumns(); |
|
23 | + $this->normalizeLabels(); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * @return void |
|
28 | - */ |
|
29 | - protected function normalize(array $args) |
|
30 | - { |
|
31 | - foreach ($args as $key => $value) { |
|
32 | - $property = glsr(Helper::class)->buildPropertyName($key); |
|
33 | - if (!property_exists($this, $property)) { |
|
34 | - continue; |
|
35 | - } |
|
36 | - $this->$property = $value; |
|
37 | - unset($args[$key]); |
|
38 | - } |
|
39 | - $this->args = wp_parse_args($args, [ |
|
40 | - 'menu_name' => $this->plural, |
|
41 | - ]); |
|
42 | - } |
|
26 | + /** |
|
27 | + * @return void |
|
28 | + */ |
|
29 | + protected function normalize(array $args) |
|
30 | + { |
|
31 | + foreach ($args as $key => $value) { |
|
32 | + $property = glsr(Helper::class)->buildPropertyName($key); |
|
33 | + if (!property_exists($this, $property)) { |
|
34 | + continue; |
|
35 | + } |
|
36 | + $this->$property = $value; |
|
37 | + unset($args[$key]); |
|
38 | + } |
|
39 | + $this->args = wp_parse_args($args, [ |
|
40 | + 'menu_name' => $this->plural, |
|
41 | + ]); |
|
42 | + } |
|
43 | 43 | |
44 | - /** |
|
45 | - * @return void |
|
46 | - */ |
|
47 | - protected function normalizeLabels() |
|
48 | - { |
|
49 | - $this->args['labels'] = wp_parse_args($this->args['labels'], [ |
|
50 | - 'add_new_item' => sprintf(_x('Add New %s', 'Add New Post', 'site-reviews'), $this->plural), |
|
51 | - 'all_items' => sprintf(_x('All %s', 'All Posts', 'site-reviews'), $this->plural), |
|
52 | - 'archives' => sprintf(_x('%s Archives', 'Post Archives', 'site-reviews'), $this->single), |
|
53 | - 'edit_item' => sprintf(_x('Edit %s', 'Edit Post', 'site-reviews'), $this->single), |
|
54 | - 'insert_into_item' => sprintf(_x('Insert into %s', 'Insert into Post', 'site-reviews'), $this->single), |
|
55 | - 'menu_name' => $this->args['menu_name'], |
|
56 | - 'name' => $this->plural, |
|
57 | - 'new_item' => sprintf(_x('New %s', 'New Post', 'site-reviews'), $this->single), |
|
58 | - 'not_found' => sprintf(_x('No %s found', 'No Posts found', 'site-reviews'), $this->plural), |
|
59 | - 'not_found_in_trash' => sprintf(_x('No %s found in Trash', 'No Posts found in Trash', 'site-reviews'), $this->plural), |
|
60 | - 'search_items' => sprintf(_x('Search %s', 'Search Posts', 'site-reviews'), $this->plural), |
|
61 | - 'singular_name' => $this->single, |
|
62 | - 'uploaded_to_this_item' => sprintf(_x('Uploaded to this %s', 'Uploaded to this Post', 'site-reviews'), $this->single), |
|
63 | - 'view_item' => sprintf(_x('View %s', 'View Post', 'site-reviews'), $this->single), |
|
64 | - ]); |
|
65 | - unset($this->args['menu_name']); |
|
66 | - } |
|
44 | + /** |
|
45 | + * @return void |
|
46 | + */ |
|
47 | + protected function normalizeLabels() |
|
48 | + { |
|
49 | + $this->args['labels'] = wp_parse_args($this->args['labels'], [ |
|
50 | + 'add_new_item' => sprintf(_x('Add New %s', 'Add New Post', 'site-reviews'), $this->plural), |
|
51 | + 'all_items' => sprintf(_x('All %s', 'All Posts', 'site-reviews'), $this->plural), |
|
52 | + 'archives' => sprintf(_x('%s Archives', 'Post Archives', 'site-reviews'), $this->single), |
|
53 | + 'edit_item' => sprintf(_x('Edit %s', 'Edit Post', 'site-reviews'), $this->single), |
|
54 | + 'insert_into_item' => sprintf(_x('Insert into %s', 'Insert into Post', 'site-reviews'), $this->single), |
|
55 | + 'menu_name' => $this->args['menu_name'], |
|
56 | + 'name' => $this->plural, |
|
57 | + 'new_item' => sprintf(_x('New %s', 'New Post', 'site-reviews'), $this->single), |
|
58 | + 'not_found' => sprintf(_x('No %s found', 'No Posts found', 'site-reviews'), $this->plural), |
|
59 | + 'not_found_in_trash' => sprintf(_x('No %s found in Trash', 'No Posts found in Trash', 'site-reviews'), $this->plural), |
|
60 | + 'search_items' => sprintf(_x('Search %s', 'Search Posts', 'site-reviews'), $this->plural), |
|
61 | + 'singular_name' => $this->single, |
|
62 | + 'uploaded_to_this_item' => sprintf(_x('Uploaded to this %s', 'Uploaded to this Post', 'site-reviews'), $this->single), |
|
63 | + 'view_item' => sprintf(_x('View %s', 'View Post', 'site-reviews'), $this->single), |
|
64 | + ]); |
|
65 | + unset($this->args['menu_name']); |
|
66 | + } |
|
67 | 67 | |
68 | - /** |
|
69 | - * @return void |
|
70 | - */ |
|
71 | - protected function normalizeColumns() |
|
72 | - { |
|
73 | - $this->columns = ['cb' => ''] + $this->columns; |
|
74 | - if (array_key_exists('category', $this->columns)) { |
|
75 | - $keys = array_keys($this->columns); |
|
76 | - $keys[array_search('category', $keys)] = 'taxonomy-'.Application::TAXONOMY; |
|
77 | - $this->columns = array_combine($keys, $this->columns); |
|
78 | - } |
|
79 | - if (array_key_exists('pinned', $this->columns)) { |
|
80 | - $this->columns['pinned'] = glsr(Builder::class)->span('<span>'.$this->columns['pinned'].'</span>', |
|
81 | - ['class' => 'pinned-icon'] |
|
82 | - ); |
|
83 | - } |
|
84 | - } |
|
68 | + /** |
|
69 | + * @return void |
|
70 | + */ |
|
71 | + protected function normalizeColumns() |
|
72 | + { |
|
73 | + $this->columns = ['cb' => ''] + $this->columns; |
|
74 | + if (array_key_exists('category', $this->columns)) { |
|
75 | + $keys = array_keys($this->columns); |
|
76 | + $keys[array_search('category', $keys)] = 'taxonomy-'.Application::TAXONOMY; |
|
77 | + $this->columns = array_combine($keys, $this->columns); |
|
78 | + } |
|
79 | + if (array_key_exists('pinned', $this->columns)) { |
|
80 | + $this->columns['pinned'] = glsr(Builder::class)->span('<span>'.$this->columns['pinned'].'</span>', |
|
81 | + ['class' => 'pinned-icon'] |
|
82 | + ); |
|
83 | + } |
|
84 | + } |
|
85 | 85 | } |
@@ -15,10 +15,10 @@ discard block |
||
15 | 15 | public $postType; |
16 | 16 | public $single; |
17 | 17 | |
18 | - public function __construct($input) |
|
18 | + public function __construct( $input ) |
|
19 | 19 | { |
20 | - $args = glsr(PostTypeDefaults::class)->merge($input); |
|
21 | - $this->normalize($args); |
|
20 | + $args = glsr( PostTypeDefaults::class )->merge( $input ); |
|
21 | + $this->normalize( $args ); |
|
22 | 22 | $this->normalizeColumns(); |
23 | 23 | $this->normalizeLabels(); |
24 | 24 | } |
@@ -26,19 +26,19 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * @return void |
28 | 28 | */ |
29 | - protected function normalize(array $args) |
|
29 | + protected function normalize( array $args ) |
|
30 | 30 | { |
31 | - foreach ($args as $key => $value) { |
|
32 | - $property = glsr(Helper::class)->buildPropertyName($key); |
|
33 | - if (!property_exists($this, $property)) { |
|
31 | + foreach( $args as $key => $value ) { |
|
32 | + $property = glsr( Helper::class )->buildPropertyName( $key ); |
|
33 | + if( !property_exists( $this, $property ) ) { |
|
34 | 34 | continue; |
35 | 35 | } |
36 | 36 | $this->$property = $value; |
37 | 37 | unset($args[$key]); |
38 | 38 | } |
39 | - $this->args = wp_parse_args($args, [ |
|
39 | + $this->args = wp_parse_args( $args, [ |
|
40 | 40 | 'menu_name' => $this->plural, |
41 | - ]); |
|
41 | + ] ); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -46,22 +46,22 @@ discard block |
||
46 | 46 | */ |
47 | 47 | protected function normalizeLabels() |
48 | 48 | { |
49 | - $this->args['labels'] = wp_parse_args($this->args['labels'], [ |
|
50 | - 'add_new_item' => sprintf(_x('Add New %s', 'Add New Post', 'site-reviews'), $this->plural), |
|
51 | - 'all_items' => sprintf(_x('All %s', 'All Posts', 'site-reviews'), $this->plural), |
|
52 | - 'archives' => sprintf(_x('%s Archives', 'Post Archives', 'site-reviews'), $this->single), |
|
53 | - 'edit_item' => sprintf(_x('Edit %s', 'Edit Post', 'site-reviews'), $this->single), |
|
54 | - 'insert_into_item' => sprintf(_x('Insert into %s', 'Insert into Post', 'site-reviews'), $this->single), |
|
49 | + $this->args['labels'] = wp_parse_args( $this->args['labels'], [ |
|
50 | + 'add_new_item' => sprintf( _x( 'Add New %s', 'Add New Post', 'site-reviews' ), $this->plural ), |
|
51 | + 'all_items' => sprintf( _x( 'All %s', 'All Posts', 'site-reviews' ), $this->plural ), |
|
52 | + 'archives' => sprintf( _x( '%s Archives', 'Post Archives', 'site-reviews' ), $this->single ), |
|
53 | + 'edit_item' => sprintf( _x( 'Edit %s', 'Edit Post', 'site-reviews' ), $this->single ), |
|
54 | + 'insert_into_item' => sprintf( _x( 'Insert into %s', 'Insert into Post', 'site-reviews' ), $this->single ), |
|
55 | 55 | 'menu_name' => $this->args['menu_name'], |
56 | 56 | 'name' => $this->plural, |
57 | - 'new_item' => sprintf(_x('New %s', 'New Post', 'site-reviews'), $this->single), |
|
58 | - 'not_found' => sprintf(_x('No %s found', 'No Posts found', 'site-reviews'), $this->plural), |
|
59 | - 'not_found_in_trash' => sprintf(_x('No %s found in Trash', 'No Posts found in Trash', 'site-reviews'), $this->plural), |
|
60 | - 'search_items' => sprintf(_x('Search %s', 'Search Posts', 'site-reviews'), $this->plural), |
|
57 | + 'new_item' => sprintf( _x( 'New %s', 'New Post', 'site-reviews' ), $this->single ), |
|
58 | + 'not_found' => sprintf( _x( 'No %s found', 'No Posts found', 'site-reviews' ), $this->plural ), |
|
59 | + 'not_found_in_trash' => sprintf( _x( 'No %s found in Trash', 'No Posts found in Trash', 'site-reviews' ), $this->plural ), |
|
60 | + 'search_items' => sprintf( _x( 'Search %s', 'Search Posts', 'site-reviews' ), $this->plural ), |
|
61 | 61 | 'singular_name' => $this->single, |
62 | - 'uploaded_to_this_item' => sprintf(_x('Uploaded to this %s', 'Uploaded to this Post', 'site-reviews'), $this->single), |
|
63 | - 'view_item' => sprintf(_x('View %s', 'View Post', 'site-reviews'), $this->single), |
|
64 | - ]); |
|
62 | + 'uploaded_to_this_item' => sprintf( _x( 'Uploaded to this %s', 'Uploaded to this Post', 'site-reviews' ), $this->single ), |
|
63 | + 'view_item' => sprintf( _x( 'View %s', 'View Post', 'site-reviews' ), $this->single ), |
|
64 | + ] ); |
|
65 | 65 | unset($this->args['menu_name']); |
66 | 66 | } |
67 | 67 | |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | protected function normalizeColumns() |
72 | 72 | { |
73 | 73 | $this->columns = ['cb' => ''] + $this->columns; |
74 | - if (array_key_exists('category', $this->columns)) { |
|
75 | - $keys = array_keys($this->columns); |
|
76 | - $keys[array_search('category', $keys)] = 'taxonomy-'.Application::TAXONOMY; |
|
77 | - $this->columns = array_combine($keys, $this->columns); |
|
74 | + if( array_key_exists( 'category', $this->columns ) ) { |
|
75 | + $keys = array_keys( $this->columns ); |
|
76 | + $keys[array_search( 'category', $keys )] = 'taxonomy-'.Application::TAXONOMY; |
|
77 | + $this->columns = array_combine( $keys, $this->columns ); |
|
78 | 78 | } |
79 | - if (array_key_exists('pinned', $this->columns)) { |
|
80 | - $this->columns['pinned'] = glsr(Builder::class)->span('<span>'.$this->columns['pinned'].'</span>', |
|
79 | + if( array_key_exists( 'pinned', $this->columns ) ) { |
|
80 | + $this->columns['pinned'] = glsr( Builder::class )->span( '<span>'.$this->columns['pinned'].'</span>', |
|
81 | 81 | ['class' => 'pinned-icon'] |
82 | 82 | ); |
83 | 83 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class RegisterShortcodes |
6 | 6 | { |
7 | - public $shortcodes; |
|
7 | + public $shortcodes; |
|
8 | 8 | |
9 | - public function __construct($input) |
|
10 | - { |
|
11 | - $this->shortcodes = $input; |
|
12 | - } |
|
9 | + public function __construct($input) |
|
10 | + { |
|
11 | + $this->shortcodes = $input; |
|
12 | + } |
|
13 | 13 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $shortcodes; |
8 | 8 | |
9 | - public function __construct($input) |
|
9 | + public function __construct( $input ) |
|
10 | 10 | { |
11 | 11 | $this->shortcodes = $input; |
12 | 12 | } |
@@ -116,7 +116,8 @@ |
||
116 | 116 | ]; |
117 | 117 | if (is_numeric($searchTerm)) { |
118 | 118 | $args['post__in'] = [$searchTerm]; |
119 | - } else { |
|
119 | + } |
|
120 | + else { |
|
120 | 121 | $args['orderby'] = 'relevance'; |
121 | 122 | $args['posts_per_page'] = 10; |
122 | 123 | $args['s'] = $searchTerm; |
@@ -11,160 +11,160 @@ |
||
11 | 11 | |
12 | 12 | class Database |
13 | 13 | { |
14 | - /** |
|
15 | - * @param int $postId |
|
16 | - * @param string $key |
|
17 | - * @param bool $single |
|
18 | - * @return mixed |
|
19 | - */ |
|
20 | - public function get($postId, $key, $single = true) |
|
21 | - { |
|
22 | - $key = glsr(Helper::class)->prefix('_', $key); |
|
23 | - return get_post_meta(intval($postId), $key, $single); |
|
24 | - } |
|
14 | + /** |
|
15 | + * @param int $postId |
|
16 | + * @param string $key |
|
17 | + * @param bool $single |
|
18 | + * @return mixed |
|
19 | + */ |
|
20 | + public function get($postId, $key, $single = true) |
|
21 | + { |
|
22 | + $key = glsr(Helper::class)->prefix('_', $key); |
|
23 | + return get_post_meta(intval($postId), $key, $single); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * @param int $postId |
|
28 | - * @param string $assignedTo |
|
29 | - * @return void|WP_Post |
|
30 | - */ |
|
31 | - public function getAssignedToPost($postId, $assignedTo = '') |
|
32 | - { |
|
33 | - if (empty($assignedTo)) { |
|
34 | - $assignedTo = $this->get($postId, 'assigned_to'); |
|
35 | - } |
|
36 | - if (empty($assignedTo)) { |
|
37 | - return; |
|
38 | - } |
|
39 | - $assignedPost = get_post($assignedTo); |
|
40 | - if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) { |
|
41 | - return $assignedPost; |
|
42 | - } |
|
43 | - } |
|
26 | + /** |
|
27 | + * @param int $postId |
|
28 | + * @param string $assignedTo |
|
29 | + * @return void|WP_Post |
|
30 | + */ |
|
31 | + public function getAssignedToPost($postId, $assignedTo = '') |
|
32 | + { |
|
33 | + if (empty($assignedTo)) { |
|
34 | + $assignedTo = $this->get($postId, 'assigned_to'); |
|
35 | + } |
|
36 | + if (empty($assignedTo)) { |
|
37 | + return; |
|
38 | + } |
|
39 | + $assignedPost = get_post($assignedTo); |
|
40 | + if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) { |
|
41 | + return $assignedPost; |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - /** |
|
46 | - * @param string $metaKey |
|
47 | - * @param string $metaValue |
|
48 | - * @return array|int |
|
49 | - */ |
|
50 | - public function getReviewCount($metaKey = '', $metaValue = '') |
|
51 | - { |
|
52 | - if (!$metaKey) { |
|
53 | - return (array) wp_count_posts(Application::POST_TYPE); |
|
54 | - } |
|
55 | - $counts = glsr(Cache::class)->getReviewCountsFor($metaKey); |
|
56 | - if (!$metaValue) { |
|
57 | - return $counts; |
|
58 | - } |
|
59 | - return glsr_get($counts, $metaValue, 0); |
|
60 | - } |
|
45 | + /** |
|
46 | + * @param string $metaKey |
|
47 | + * @param string $metaValue |
|
48 | + * @return array|int |
|
49 | + */ |
|
50 | + public function getReviewCount($metaKey = '', $metaValue = '') |
|
51 | + { |
|
52 | + if (!$metaKey) { |
|
53 | + return (array) wp_count_posts(Application::POST_TYPE); |
|
54 | + } |
|
55 | + $counts = glsr(Cache::class)->getReviewCountsFor($metaKey); |
|
56 | + if (!$metaValue) { |
|
57 | + return $counts; |
|
58 | + } |
|
59 | + return glsr_get($counts, $metaValue, 0); |
|
60 | + } |
|
61 | 61 | |
62 | - /** |
|
63 | - * @param string $metaReviewType |
|
64 | - * @return array |
|
65 | - */ |
|
66 | - public function getReviewIdsByType($metaReviewType) |
|
67 | - { |
|
68 | - return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType); |
|
69 | - } |
|
62 | + /** |
|
63 | + * @param string $metaReviewType |
|
64 | + * @return array |
|
65 | + */ |
|
66 | + public function getReviewIdsByType($metaReviewType) |
|
67 | + { |
|
68 | + return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType); |
|
69 | + } |
|
70 | 70 | |
71 | - /** |
|
72 | - * @param string $key |
|
73 | - * @param string $status |
|
74 | - * @return array |
|
75 | - */ |
|
76 | - public function getReviewsMeta($key, $status = 'publish') |
|
77 | - { |
|
78 | - if ('all' == $status || empty($status)) { |
|
79 | - $status = get_post_stati(['exclude_from_search' => false]); |
|
80 | - } |
|
81 | - return glsr(SqlQueries::class)->getReviewsMeta($key, $status); |
|
82 | - } |
|
71 | + /** |
|
72 | + * @param string $key |
|
73 | + * @param string $status |
|
74 | + * @return array |
|
75 | + */ |
|
76 | + public function getReviewsMeta($key, $status = 'publish') |
|
77 | + { |
|
78 | + if ('all' == $status || empty($status)) { |
|
79 | + $status = get_post_stati(['exclude_from_search' => false]); |
|
80 | + } |
|
81 | + return glsr(SqlQueries::class)->getReviewsMeta($key, $status); |
|
82 | + } |
|
83 | 83 | |
84 | - /** |
|
85 | - * @param string $field |
|
86 | - * @return array |
|
87 | - */ |
|
88 | - public function getTermIds(array $values, $field) |
|
89 | - { |
|
90 | - $termIds = []; |
|
91 | - foreach ($values as $value) { |
|
92 | - $term = get_term_by($field, $value, Application::TAXONOMY); |
|
93 | - if (!isset($term->term_id)) { |
|
94 | - continue; |
|
95 | - } |
|
96 | - $termIds[] = $term->term_id; |
|
97 | - } |
|
98 | - return $termIds; |
|
99 | - } |
|
84 | + /** |
|
85 | + * @param string $field |
|
86 | + * @return array |
|
87 | + */ |
|
88 | + public function getTermIds(array $values, $field) |
|
89 | + { |
|
90 | + $termIds = []; |
|
91 | + foreach ($values as $value) { |
|
92 | + $term = get_term_by($field, $value, Application::TAXONOMY); |
|
93 | + if (!isset($term->term_id)) { |
|
94 | + continue; |
|
95 | + } |
|
96 | + $termIds[] = $term->term_id; |
|
97 | + } |
|
98 | + return $termIds; |
|
99 | + } |
|
100 | 100 | |
101 | - /** |
|
102 | - * @return array |
|
103 | - */ |
|
104 | - public function getTerms(array $args = []) |
|
105 | - { |
|
106 | - $args = wp_parse_args($args, [ |
|
107 | - 'count' => false, |
|
108 | - 'fields' => 'id=>name', |
|
109 | - 'hide_empty' => false, |
|
110 | - 'taxonomy' => Application::TAXONOMY, |
|
111 | - ]); |
|
112 | - $terms = get_terms($args); |
|
113 | - if (is_wp_error($terms)) { |
|
114 | - glsr_log()->error($terms->get_error_message()); |
|
115 | - return []; |
|
116 | - } |
|
117 | - return $terms; |
|
118 | - } |
|
101 | + /** |
|
102 | + * @return array |
|
103 | + */ |
|
104 | + public function getTerms(array $args = []) |
|
105 | + { |
|
106 | + $args = wp_parse_args($args, [ |
|
107 | + 'count' => false, |
|
108 | + 'fields' => 'id=>name', |
|
109 | + 'hide_empty' => false, |
|
110 | + 'taxonomy' => Application::TAXONOMY, |
|
111 | + ]); |
|
112 | + $terms = get_terms($args); |
|
113 | + if (is_wp_error($terms)) { |
|
114 | + glsr_log()->error($terms->get_error_message()); |
|
115 | + return []; |
|
116 | + } |
|
117 | + return $terms; |
|
118 | + } |
|
119 | 119 | |
120 | - /** |
|
121 | - * @param string $searchTerm |
|
122 | - * @return void|string |
|
123 | - */ |
|
124 | - public function searchPosts($searchTerm) |
|
125 | - { |
|
126 | - $args = [ |
|
127 | - 'post_status' => 'publish', |
|
128 | - 'post_type' => 'any', |
|
129 | - ]; |
|
130 | - if (is_numeric($searchTerm)) { |
|
131 | - $args['post__in'] = [$searchTerm]; |
|
132 | - } else { |
|
133 | - $args['orderby'] = 'relevance'; |
|
134 | - $args['posts_per_page'] = 10; |
|
135 | - $args['s'] = $searchTerm; |
|
136 | - } |
|
137 | - $queryBuilder = glsr(QueryBuilder::class); |
|
138 | - add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2); |
|
139 | - $search = new WP_Query($args); |
|
140 | - remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500); |
|
141 | - if (!$search->have_posts()) { |
|
142 | - return; |
|
143 | - } |
|
144 | - $results = ''; |
|
145 | - while ($search->have_posts()) { |
|
146 | - $search->the_post(); |
|
147 | - ob_start(); |
|
148 | - glsr()->render('partials/editor/search-result', [ |
|
149 | - 'ID' => get_the_ID(), |
|
150 | - 'permalink' => esc_url((string) get_permalink()), |
|
151 | - 'title' => esc_attr(get_the_title()), |
|
152 | - ]); |
|
153 | - $results.= ob_get_clean(); |
|
154 | - } |
|
155 | - wp_reset_postdata(); |
|
156 | - return $results; |
|
157 | - } |
|
120 | + /** |
|
121 | + * @param string $searchTerm |
|
122 | + * @return void|string |
|
123 | + */ |
|
124 | + public function searchPosts($searchTerm) |
|
125 | + { |
|
126 | + $args = [ |
|
127 | + 'post_status' => 'publish', |
|
128 | + 'post_type' => 'any', |
|
129 | + ]; |
|
130 | + if (is_numeric($searchTerm)) { |
|
131 | + $args['post__in'] = [$searchTerm]; |
|
132 | + } else { |
|
133 | + $args['orderby'] = 'relevance'; |
|
134 | + $args['posts_per_page'] = 10; |
|
135 | + $args['s'] = $searchTerm; |
|
136 | + } |
|
137 | + $queryBuilder = glsr(QueryBuilder::class); |
|
138 | + add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2); |
|
139 | + $search = new WP_Query($args); |
|
140 | + remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500); |
|
141 | + if (!$search->have_posts()) { |
|
142 | + return; |
|
143 | + } |
|
144 | + $results = ''; |
|
145 | + while ($search->have_posts()) { |
|
146 | + $search->the_post(); |
|
147 | + ob_start(); |
|
148 | + glsr()->render('partials/editor/search-result', [ |
|
149 | + 'ID' => get_the_ID(), |
|
150 | + 'permalink' => esc_url((string) get_permalink()), |
|
151 | + 'title' => esc_attr(get_the_title()), |
|
152 | + ]); |
|
153 | + $results.= ob_get_clean(); |
|
154 | + } |
|
155 | + wp_reset_postdata(); |
|
156 | + return $results; |
|
157 | + } |
|
158 | 158 | |
159 | - /** |
|
160 | - * @param int $postId |
|
161 | - * @param string $key |
|
162 | - * @param mixed $value |
|
163 | - * @return int|bool |
|
164 | - */ |
|
165 | - public function update($postId, $key, $value) |
|
166 | - { |
|
167 | - $key = glsr(Helper::class)->prefix('_', $key); |
|
168 | - return update_post_meta($postId, $key, $value); |
|
169 | - } |
|
159 | + /** |
|
160 | + * @param int $postId |
|
161 | + * @param string $key |
|
162 | + * @param mixed $value |
|
163 | + * @return int|bool |
|
164 | + */ |
|
165 | + public function update($postId, $key, $value) |
|
166 | + { |
|
167 | + $key = glsr(Helper::class)->prefix('_', $key); |
|
168 | + return update_post_meta($postId, $key, $value); |
|
169 | + } |
|
170 | 170 | } |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | * @param bool $single |
18 | 18 | * @return mixed |
19 | 19 | */ |
20 | - public function get($postId, $key, $single = true) |
|
20 | + public function get( $postId, $key, $single = true ) |
|
21 | 21 | { |
22 | - $key = glsr(Helper::class)->prefix('_', $key); |
|
23 | - return get_post_meta(intval($postId), $key, $single); |
|
22 | + $key = glsr( Helper::class )->prefix( '_', $key ); |
|
23 | + return get_post_meta( intval( $postId ), $key, $single ); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -28,16 +28,16 @@ discard block |
||
28 | 28 | * @param string $assignedTo |
29 | 29 | * @return void|WP_Post |
30 | 30 | */ |
31 | - public function getAssignedToPost($postId, $assignedTo = '') |
|
31 | + public function getAssignedToPost( $postId, $assignedTo = '' ) |
|
32 | 32 | { |
33 | - if (empty($assignedTo)) { |
|
34 | - $assignedTo = $this->get($postId, 'assigned_to'); |
|
33 | + if( empty($assignedTo) ) { |
|
34 | + $assignedTo = $this->get( $postId, 'assigned_to' ); |
|
35 | 35 | } |
36 | - if (empty($assignedTo)) { |
|
36 | + if( empty($assignedTo) ) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | - $assignedPost = get_post($assignedTo); |
|
40 | - if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) { |
|
39 | + $assignedPost = get_post( $assignedTo ); |
|
40 | + if( $assignedPost instanceof WP_Post && $assignedPost->ID != $postId ) { |
|
41 | 41 | return $assignedPost; |
42 | 42 | } |
43 | 43 | } |
@@ -47,25 +47,25 @@ discard block |
||
47 | 47 | * @param string $metaValue |
48 | 48 | * @return array|int |
49 | 49 | */ |
50 | - public function getReviewCount($metaKey = '', $metaValue = '') |
|
50 | + public function getReviewCount( $metaKey = '', $metaValue = '' ) |
|
51 | 51 | { |
52 | - if (!$metaKey) { |
|
53 | - return (array) wp_count_posts(Application::POST_TYPE); |
|
52 | + if( !$metaKey ) { |
|
53 | + return (array)wp_count_posts( Application::POST_TYPE ); |
|
54 | 54 | } |
55 | - $counts = glsr(Cache::class)->getReviewCountsFor($metaKey); |
|
56 | - if (!$metaValue) { |
|
55 | + $counts = glsr( Cache::class )->getReviewCountsFor( $metaKey ); |
|
56 | + if( !$metaValue ) { |
|
57 | 57 | return $counts; |
58 | 58 | } |
59 | - return glsr_get($counts, $metaValue, 0); |
|
59 | + return glsr_get( $counts, $metaValue, 0 ); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
63 | 63 | * @param string $metaReviewType |
64 | 64 | * @return array |
65 | 65 | */ |
66 | - public function getReviewIdsByType($metaReviewType) |
|
66 | + public function getReviewIdsByType( $metaReviewType ) |
|
67 | 67 | { |
68 | - return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType); |
|
68 | + return glsr( SqlQueries::class )->getReviewIdsByType( $metaReviewType ); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -73,24 +73,24 @@ discard block |
||
73 | 73 | * @param string $status |
74 | 74 | * @return array |
75 | 75 | */ |
76 | - public function getReviewsMeta($key, $status = 'publish') |
|
76 | + public function getReviewsMeta( $key, $status = 'publish' ) |
|
77 | 77 | { |
78 | - if ('all' == $status || empty($status)) { |
|
79 | - $status = get_post_stati(['exclude_from_search' => false]); |
|
78 | + if( 'all' == $status || empty($status) ) { |
|
79 | + $status = get_post_stati( ['exclude_from_search' => false] ); |
|
80 | 80 | } |
81 | - return glsr(SqlQueries::class)->getReviewsMeta($key, $status); |
|
81 | + return glsr( SqlQueries::class )->getReviewsMeta( $key, $status ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
85 | 85 | * @param string $field |
86 | 86 | * @return array |
87 | 87 | */ |
88 | - public function getTermIds(array $values, $field) |
|
88 | + public function getTermIds( array $values, $field ) |
|
89 | 89 | { |
90 | 90 | $termIds = []; |
91 | - foreach ($values as $value) { |
|
92 | - $term = get_term_by($field, $value, Application::TAXONOMY); |
|
93 | - if (!isset($term->term_id)) { |
|
91 | + foreach( $values as $value ) { |
|
92 | + $term = get_term_by( $field, $value, Application::TAXONOMY ); |
|
93 | + if( !isset($term->term_id) ) { |
|
94 | 94 | continue; |
95 | 95 | } |
96 | 96 | $termIds[] = $term->term_id; |
@@ -101,17 +101,17 @@ discard block |
||
101 | 101 | /** |
102 | 102 | * @return array |
103 | 103 | */ |
104 | - public function getTerms(array $args = []) |
|
104 | + public function getTerms( array $args = [] ) |
|
105 | 105 | { |
106 | - $args = wp_parse_args($args, [ |
|
106 | + $args = wp_parse_args( $args, [ |
|
107 | 107 | 'count' => false, |
108 | 108 | 'fields' => 'id=>name', |
109 | 109 | 'hide_empty' => false, |
110 | 110 | 'taxonomy' => Application::TAXONOMY, |
111 | - ]); |
|
112 | - $terms = get_terms($args); |
|
113 | - if (is_wp_error($terms)) { |
|
114 | - glsr_log()->error($terms->get_error_message()); |
|
111 | + ] ); |
|
112 | + $terms = get_terms( $args ); |
|
113 | + if( is_wp_error( $terms ) ) { |
|
114 | + glsr_log()->error( $terms->get_error_message() ); |
|
115 | 115 | return []; |
116 | 116 | } |
117 | 117 | return $terms; |
@@ -121,36 +121,36 @@ discard block |
||
121 | 121 | * @param string $searchTerm |
122 | 122 | * @return void|string |
123 | 123 | */ |
124 | - public function searchPosts($searchTerm) |
|
124 | + public function searchPosts( $searchTerm ) |
|
125 | 125 | { |
126 | 126 | $args = [ |
127 | 127 | 'post_status' => 'publish', |
128 | 128 | 'post_type' => 'any', |
129 | 129 | ]; |
130 | - if (is_numeric($searchTerm)) { |
|
130 | + if( is_numeric( $searchTerm ) ) { |
|
131 | 131 | $args['post__in'] = [$searchTerm]; |
132 | 132 | } else { |
133 | 133 | $args['orderby'] = 'relevance'; |
134 | 134 | $args['posts_per_page'] = 10; |
135 | 135 | $args['s'] = $searchTerm; |
136 | 136 | } |
137 | - $queryBuilder = glsr(QueryBuilder::class); |
|
138 | - add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2); |
|
139 | - $search = new WP_Query($args); |
|
140 | - remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500); |
|
141 | - if (!$search->have_posts()) { |
|
137 | + $queryBuilder = glsr( QueryBuilder::class ); |
|
138 | + add_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2 ); |
|
139 | + $search = new WP_Query( $args ); |
|
140 | + remove_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500 ); |
|
141 | + if( !$search->have_posts() ) { |
|
142 | 142 | return; |
143 | 143 | } |
144 | 144 | $results = ''; |
145 | - while ($search->have_posts()) { |
|
145 | + while( $search->have_posts() ) { |
|
146 | 146 | $search->the_post(); |
147 | 147 | ob_start(); |
148 | - glsr()->render('partials/editor/search-result', [ |
|
148 | + glsr()->render( 'partials/editor/search-result', [ |
|
149 | 149 | 'ID' => get_the_ID(), |
150 | - 'permalink' => esc_url((string) get_permalink()), |
|
151 | - 'title' => esc_attr(get_the_title()), |
|
152 | - ]); |
|
153 | - $results.= ob_get_clean(); |
|
150 | + 'permalink' => esc_url( (string)get_permalink() ), |
|
151 | + 'title' => esc_attr( get_the_title() ), |
|
152 | + ] ); |
|
153 | + $results .= ob_get_clean(); |
|
154 | 154 | } |
155 | 155 | wp_reset_postdata(); |
156 | 156 | return $results; |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | * @param mixed $value |
163 | 163 | * @return int|bool |
164 | 164 | */ |
165 | - public function update($postId, $key, $value) |
|
165 | + public function update( $postId, $key, $value ) |
|
166 | 166 | { |
167 | - $key = glsr(Helper::class)->prefix('_', $key); |
|
168 | - return update_post_meta($postId, $key, $value); |
|
167 | + $key = glsr( Helper::class )->prefix( '_', $key ); |
|
168 | + return update_post_meta( $postId, $key, $value ); |
|
169 | 169 | } |
170 | 170 | } |
@@ -1,33 +1,33 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'rating' => [ |
|
5 | - 'label' => __('Your overall rating', 'site-reviews'), |
|
6 | - 'type' => 'rating', |
|
7 | - ], |
|
8 | - 'title' => [ |
|
9 | - 'label' => __('Title of your review', 'site-reviews'), |
|
10 | - 'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'), |
|
11 | - 'type' => 'text', |
|
12 | - ], |
|
13 | - 'content' => [ |
|
14 | - 'label' => __('Your review', 'site-reviews'), |
|
15 | - 'placeholder' => __('Tell people your review', 'site-reviews'), |
|
16 | - 'rows' => 5, |
|
17 | - 'type' => 'textarea', |
|
18 | - ], |
|
19 | - 'name' => [ |
|
20 | - 'label' => __('Your name', 'site-reviews'), |
|
21 | - 'placeholder' => __('Tell us your name', 'site-reviews'), |
|
22 | - 'type' => 'text', |
|
23 | - ], |
|
24 | - 'email' => [ |
|
25 | - 'label' => __('Your email', 'site-reviews'), |
|
26 | - 'placeholder' => __('Tell us your email', 'site-reviews'), |
|
27 | - 'type' => 'email', |
|
28 | - ], |
|
29 | - 'terms' => [ |
|
30 | - 'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'), |
|
31 | - 'type' => 'checkbox', |
|
32 | - ], |
|
4 | + 'rating' => [ |
|
5 | + 'label' => __('Your overall rating', 'site-reviews'), |
|
6 | + 'type' => 'rating', |
|
7 | + ], |
|
8 | + 'title' => [ |
|
9 | + 'label' => __('Title of your review', 'site-reviews'), |
|
10 | + 'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'), |
|
11 | + 'type' => 'text', |
|
12 | + ], |
|
13 | + 'content' => [ |
|
14 | + 'label' => __('Your review', 'site-reviews'), |
|
15 | + 'placeholder' => __('Tell people your review', 'site-reviews'), |
|
16 | + 'rows' => 5, |
|
17 | + 'type' => 'textarea', |
|
18 | + ], |
|
19 | + 'name' => [ |
|
20 | + 'label' => __('Your name', 'site-reviews'), |
|
21 | + 'placeholder' => __('Tell us your name', 'site-reviews'), |
|
22 | + 'type' => 'text', |
|
23 | + ], |
|
24 | + 'email' => [ |
|
25 | + 'label' => __('Your email', 'site-reviews'), |
|
26 | + 'placeholder' => __('Tell us your email', 'site-reviews'), |
|
27 | + 'type' => 'email', |
|
28 | + ], |
|
29 | + 'terms' => [ |
|
30 | + 'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'), |
|
31 | + 'type' => 'checkbox', |
|
32 | + ], |
|
33 | 33 | ]; |
@@ -2,32 +2,32 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | 'rating' => [ |
5 | - 'label' => __('Your overall rating', 'site-reviews'), |
|
5 | + 'label' => __( 'Your overall rating', 'site-reviews' ), |
|
6 | 6 | 'type' => 'rating', |
7 | 7 | ], |
8 | 8 | 'title' => [ |
9 | - 'label' => __('Title of your review', 'site-reviews'), |
|
10 | - 'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'), |
|
9 | + 'label' => __( 'Title of your review', 'site-reviews' ), |
|
10 | + 'placeholder' => __( 'Summarize your review or highlight an interesting detail', 'site-reviews' ), |
|
11 | 11 | 'type' => 'text', |
12 | 12 | ], |
13 | 13 | 'content' => [ |
14 | - 'label' => __('Your review', 'site-reviews'), |
|
15 | - 'placeholder' => __('Tell people your review', 'site-reviews'), |
|
14 | + 'label' => __( 'Your review', 'site-reviews' ), |
|
15 | + 'placeholder' => __( 'Tell people your review', 'site-reviews' ), |
|
16 | 16 | 'rows' => 5, |
17 | 17 | 'type' => 'textarea', |
18 | 18 | ], |
19 | 19 | 'name' => [ |
20 | - 'label' => __('Your name', 'site-reviews'), |
|
21 | - 'placeholder' => __('Tell us your name', 'site-reviews'), |
|
20 | + 'label' => __( 'Your name', 'site-reviews' ), |
|
21 | + 'placeholder' => __( 'Tell us your name', 'site-reviews' ), |
|
22 | 22 | 'type' => 'text', |
23 | 23 | ], |
24 | 24 | 'email' => [ |
25 | - 'label' => __('Your email', 'site-reviews'), |
|
26 | - 'placeholder' => __('Tell us your email', 'site-reviews'), |
|
25 | + 'label' => __( 'Your email', 'site-reviews' ), |
|
26 | + 'placeholder' => __( 'Tell us your email', 'site-reviews' ), |
|
27 | 27 | 'type' => 'email', |
28 | 28 | ], |
29 | 29 | 'terms' => [ |
30 | - 'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'), |
|
30 | + 'label' => __( 'This review is based on my own experience and is my genuine opinion.', 'site-reviews' ), |
|
31 | 31 | 'type' => 'checkbox', |
32 | 32 | ], |
33 | 33 | ]; |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'ninja-forms-field nf-element', |
|
6 | - 'textarea' => 'ninja-forms-field nf-element', |
|
7 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'ninja-forms-field nf-element', |
|
6 | + 'textarea' => 'ninja-forms-field nf-element', |
|
7 | + ], |
|
8 | 8 | ]; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'wpcf7-form-control', |
|
6 | - 'input_text' => 'wpcf7-form-control wpcf7-text', |
|
7 | - 'input_email' => 'wpcf7-form-control wpcf7-text wpcf7-email', |
|
8 | - 'select' => 'wpcf7-form-control wpcf7-select', |
|
9 | - 'textarea' => 'wpcf7-form-control wpcf7-textarea', |
|
10 | - ], |
|
11 | - 'validation' => [ |
|
12 | - 'error_tag' => 'span', |
|
13 | - 'error_tag_class' => 'wpcf7-not-valid-tip', |
|
14 | - 'input_error_class' => 'wpcf7-not-valid', |
|
15 | - 'message_initial_class' => 'wpcf7-display-none', |
|
16 | - 'message_success_class' => 'wpcf7-mail-sent-ok', |
|
17 | - 'message_tag_class' => 'wpcf7-response-output', |
|
18 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'wpcf7-form-control', |
|
6 | + 'input_text' => 'wpcf7-form-control wpcf7-text', |
|
7 | + 'input_email' => 'wpcf7-form-control wpcf7-text wpcf7-email', |
|
8 | + 'select' => 'wpcf7-form-control wpcf7-select', |
|
9 | + 'textarea' => 'wpcf7-form-control wpcf7-textarea', |
|
10 | + ], |
|
11 | + 'validation' => [ |
|
12 | + 'error_tag' => 'span', |
|
13 | + 'error_tag_class' => 'wpcf7-not-valid-tip', |
|
14 | + 'input_error_class' => 'wpcf7-not-valid', |
|
15 | + 'message_initial_class' => 'wpcf7-display-none', |
|
16 | + 'message_success_class' => 'wpcf7-mail-sent-ok', |
|
17 | + 'message_tag_class' => 'wpcf7-response-output', |
|
18 | + ], |
|
19 | 19 | ]; |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'wpforms-field-large', |
|
6 | - 'label' => 'wpforms-field-label', |
|
7 | - 'label_checkbox' => 'wpforms-field-label-inline', |
|
8 | - 'label_radio' => 'wpforms-field-label-inline', |
|
9 | - 'select' => 'wpforms-field-large', |
|
10 | - 'textarea' => 'wpforms-field-large', |
|
11 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'wpforms-field-large', |
|
6 | + 'label' => 'wpforms-field-label', |
|
7 | + 'label_checkbox' => 'wpforms-field-label-inline', |
|
8 | + 'label_radio' => 'wpforms-field-label-inline', |
|
9 | + 'select' => 'wpforms-field-large', |
|
10 | + 'textarea' => 'wpforms-field-large', |
|
11 | + ], |
|
12 | 12 | ]; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'form-control', |
|
6 | - 'input_checkbox' => 'custom-control-input', |
|
7 | - 'input_radio' => 'custom-control-input', |
|
8 | - 'label_checkbox' => 'custom-control-label', |
|
9 | - 'label_radio' => 'custom-control-label', |
|
10 | - 'select' => 'form-control', |
|
11 | - 'textarea' => 'form-control', |
|
12 | - ], |
|
13 | - 'validation' => [ |
|
14 | - 'error_tag' => 'div', |
|
15 | - 'error_tag_class' => 'invalid-feedback', |
|
16 | - 'field_class' => 'form-group', |
|
17 | - 'input_error_class' => 'is-invalid', |
|
18 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'form-control', |
|
6 | + 'input_checkbox' => 'custom-control-input', |
|
7 | + 'input_radio' => 'custom-control-input', |
|
8 | + 'label_checkbox' => 'custom-control-label', |
|
9 | + 'label_radio' => 'custom-control-label', |
|
10 | + 'select' => 'form-control', |
|
11 | + 'textarea' => 'form-control', |
|
12 | + ], |
|
13 | + 'validation' => [ |
|
14 | + 'error_tag' => 'div', |
|
15 | + 'error_tag_class' => 'invalid-feedback', |
|
16 | + 'field_class' => 'form-group', |
|
17 | + 'input_error_class' => 'is-invalid', |
|
18 | + ], |
|
19 | 19 | ]; |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'label' => 'et_pb_contact_form_label', |
|
6 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'label' => 'et_pb_contact_form_label', |
|
6 | + ], |
|
7 | 7 | ]; |