@@ -6,19 +6,19 @@ |
||
| 6 | 6 | |
| 7 | 7 | class RegisterTaxonomy implements Contract |
| 8 | 8 | { |
| 9 | - public $args; |
|
| 9 | + public $args; |
|
| 10 | 10 | |
| 11 | - public function __construct($input) |
|
| 12 | - { |
|
| 13 | - $this->args = $input; |
|
| 14 | - } |
|
| 11 | + public function __construct($input) |
|
| 12 | + { |
|
| 13 | + $this->args = $input; |
|
| 14 | + } |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @return void |
|
| 18 | - */ |
|
| 19 | - public function handle() |
|
| 20 | - { |
|
| 21 | - register_taxonomy(glsr()->taxonomy, glsr()->post_type, $this->args); |
|
| 22 | - register_taxonomy_for_object_type(glsr()->taxonomy, glsr()->post_type); |
|
| 23 | - } |
|
| 16 | + /** |
|
| 17 | + * @return void |
|
| 18 | + */ |
|
| 19 | + public function handle() |
|
| 20 | + { |
|
| 21 | + register_taxonomy(glsr()->taxonomy, glsr()->post_type, $this->args); |
|
| 22 | + register_taxonomy_for_object_type(glsr()->taxonomy, glsr()->post_type); |
|
| 23 | + } |
|
| 24 | 24 | } |
@@ -7,31 +7,31 @@ |
||
| 7 | 7 | |
| 8 | 8 | class RegisterWidgets implements Contract |
| 9 | 9 | { |
| 10 | - public $widgets; |
|
| 10 | + public $widgets; |
|
| 11 | 11 | |
| 12 | - public function __construct(array $input) |
|
| 13 | - { |
|
| 14 | - array_walk($input, function (&$args) { |
|
| 15 | - $args = wp_parse_args($args, [ |
|
| 16 | - 'description' => '', |
|
| 17 | - 'name' => '', |
|
| 18 | - ]); |
|
| 19 | - }); |
|
| 20 | - $this->widgets = $input; |
|
| 21 | - } |
|
| 12 | + public function __construct(array $input) |
|
| 13 | + { |
|
| 14 | + array_walk($input, function (&$args) { |
|
| 15 | + $args = wp_parse_args($args, [ |
|
| 16 | + 'description' => '', |
|
| 17 | + 'name' => '', |
|
| 18 | + ]); |
|
| 19 | + }); |
|
| 20 | + $this->widgets = $input; |
|
| 21 | + } |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * @return void |
|
| 25 | - */ |
|
| 26 | - public function handle() |
|
| 27 | - { |
|
| 28 | - foreach ($this->widgets as $baseId => $args) { |
|
| 29 | - $widgetClass = Helper::buildClassName($baseId.'-widget', 'Widgets'); |
|
| 30 | - if (!class_exists($widgetClass)) { |
|
| 31 | - glsr_log()->error(sprintf('Widget class missing (%s)', $widgetClass)); |
|
| 32 | - continue; |
|
| 33 | - } |
|
| 34 | - register_widget(new $widgetClass(glsr()->prefix.$baseId, $args['name'], $args)); |
|
| 35 | - } |
|
| 36 | - } |
|
| 23 | + /** |
|
| 24 | + * @return void |
|
| 25 | + */ |
|
| 26 | + public function handle() |
|
| 27 | + { |
|
| 28 | + foreach ($this->widgets as $baseId => $args) { |
|
| 29 | + $widgetClass = Helper::buildClassName($baseId.'-widget', 'Widgets'); |
|
| 30 | + if (!class_exists($widgetClass)) { |
|
| 31 | + glsr_log()->error(sprintf('Widget class missing (%s)', $widgetClass)); |
|
| 32 | + continue; |
|
| 33 | + } |
|
| 34 | + register_widget(new $widgetClass(glsr()->prefix.$baseId, $args['name'], $args)); |
|
| 35 | + } |
|
| 36 | + } |
|
| 37 | 37 | } |
@@ -7,22 +7,22 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AssignUsers implements Contract |
| 9 | 9 | { |
| 10 | - public $ratingId; |
|
| 11 | - public $userIds; |
|
| 10 | + public $ratingId; |
|
| 11 | + public $userIds; |
|
| 12 | 12 | |
| 13 | - public function __construct($ratingId, array $userIds) |
|
| 14 | - { |
|
| 15 | - $this->ratingId = $ratingId; |
|
| 16 | - $this->userIds = $userIds; |
|
| 17 | - } |
|
| 13 | + public function __construct($ratingId, array $userIds) |
|
| 14 | + { |
|
| 15 | + $this->ratingId = $ratingId; |
|
| 16 | + $this->userIds = $userIds; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * @return void |
|
| 21 | - */ |
|
| 22 | - public function handle() |
|
| 23 | - { |
|
| 24 | - foreach ($this->userIds as $userId) { |
|
| 25 | - glsr(RatingManager::class)->assignUser($this->ratingId, $userId); |
|
| 26 | - } |
|
| 27 | - } |
|
| 19 | + /** |
|
| 20 | + * @return void |
|
| 21 | + */ |
|
| 22 | + public function handle() |
|
| 23 | + { |
|
| 24 | + foreach ($this->userIds as $userId) { |
|
| 25 | + glsr(RatingManager::class)->assignUser($this->ratingId, $userId); |
|
| 26 | + } |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -7,25 +7,25 @@ |
||
| 7 | 7 | |
| 8 | 8 | class RegisterShortcodes implements Contract |
| 9 | 9 | { |
| 10 | - public $shortcodes; |
|
| 10 | + public $shortcodes; |
|
| 11 | 11 | |
| 12 | - public function __construct($input) |
|
| 13 | - { |
|
| 14 | - $this->shortcodes = $input; |
|
| 15 | - } |
|
| 12 | + public function __construct($input) |
|
| 13 | + { |
|
| 14 | + $this->shortcodes = $input; |
|
| 15 | + } |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * @return void |
|
| 19 | - */ |
|
| 20 | - public function handle() |
|
| 21 | - { |
|
| 22 | - foreach ($this->shortcodes as $shortcode) { |
|
| 23 | - $shortcodeClass = Helper::buildClassName($shortcode.'-shortcode', 'Shortcodes'); |
|
| 24 | - if (!class_exists($shortcodeClass)) { |
|
| 25 | - glsr_log()->error(sprintf('Shortcode class missing (%s)', $shortcodeClass)); |
|
| 26 | - continue; |
|
| 27 | - } |
|
| 28 | - add_shortcode($shortcode, [glsr($shortcodeClass), 'buildShortcode']); |
|
| 29 | - } |
|
| 30 | - } |
|
| 17 | + /** |
|
| 18 | + * @return void |
|
| 19 | + */ |
|
| 20 | + public function handle() |
|
| 21 | + { |
|
| 22 | + foreach ($this->shortcodes as $shortcode) { |
|
| 23 | + $shortcodeClass = Helper::buildClassName($shortcode.'-shortcode', 'Shortcodes'); |
|
| 24 | + if (!class_exists($shortcodeClass)) { |
|
| 25 | + glsr_log()->error(sprintf('Shortcode class missing (%s)', $shortcodeClass)); |
|
| 26 | + continue; |
|
| 27 | + } |
|
| 28 | + add_shortcode($shortcode, [glsr($shortcodeClass), 'buildShortcode']); |
|
| 29 | + } |
|
| 30 | + } |
|
| 31 | 31 | } |
@@ -7,22 +7,22 @@ |
||
| 7 | 7 | |
| 8 | 8 | class AssignTerms implements Contract |
| 9 | 9 | { |
| 10 | - public $ratingId; |
|
| 11 | - public $termIds; |
|
| 10 | + public $ratingId; |
|
| 11 | + public $termIds; |
|
| 12 | 12 | |
| 13 | - public function __construct($ratingId, array $termIds) |
|
| 14 | - { |
|
| 15 | - $this->ratingId = $ratingId; |
|
| 16 | - $this->termIds = $termIds; |
|
| 17 | - } |
|
| 13 | + public function __construct($ratingId, array $termIds) |
|
| 14 | + { |
|
| 15 | + $this->ratingId = $ratingId; |
|
| 16 | + $this->termIds = $termIds; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * @return void |
|
| 21 | - */ |
|
| 22 | - public function handle() |
|
| 23 | - { |
|
| 24 | - foreach ($this->termIds as $termId) { |
|
| 25 | - glsr(RatingManager::class)->assignTerm($this->ratingId, $termId); |
|
| 26 | - } |
|
| 27 | - } |
|
| 19 | + /** |
|
| 20 | + * @return void |
|
| 21 | + */ |
|
| 22 | + public function handle() |
|
| 23 | + { |
|
| 24 | + foreach ($this->termIds as $termId) { |
|
| 25 | + glsr(RatingManager::class)->assignTerm($this->ratingId, $termId); |
|
| 26 | + } |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface CommandContract |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * @return mixed |
|
| 9 | - */ |
|
| 10 | - public function handle(); |
|
| 7 | + /** |
|
| 8 | + * @return mixed |
|
| 9 | + */ |
|
| 10 | + public function handle(); |
|
| 11 | 11 | } |
@@ -8,39 +8,39 @@ discard block |
||
| 8 | 8 | * @see https://wordpress.org/plugins/members/ |
| 9 | 9 | */ |
| 10 | 10 | add_action('members_register_caps', function () { |
| 11 | - members_register_cap('delete_others_site-reviews', [ |
|
| 12 | - 'label' => _x("Delete Others' Reviews", 'admin-text', 'site-reviews'), |
|
| 13 | - ]); |
|
| 14 | - members_register_cap('delete_site-reviews', [ |
|
| 15 | - 'label' => _x('Delete Reviews', 'admin-text', 'site-reviews'), |
|
| 16 | - ]); |
|
| 17 | - members_register_cap('delete_private_site-reviews', [ |
|
| 18 | - 'label' => _x('Delete Private Reviews', 'admin-text', 'site-reviews'), |
|
| 19 | - ]); |
|
| 20 | - members_register_cap('delete_published_site-reviews', [ |
|
| 21 | - 'label' => _x('Delete Approved Reviews', 'admin-text', 'site-reviews'), |
|
| 22 | - ]); |
|
| 23 | - members_register_cap('edit_others_site-reviews', [ |
|
| 24 | - 'label' => _x("Edit Others' Reviews", 'admin-text', 'site-reviews'), |
|
| 25 | - ]); |
|
| 26 | - members_register_cap('edit_site-reviews', [ |
|
| 27 | - 'label' => _x('Edit Reviews', 'admin-text', 'site-reviews'), |
|
| 28 | - ]); |
|
| 29 | - members_register_cap('edit_private_site-reviews', [ |
|
| 30 | - 'label' => _x('Edit Private Reviews', 'admin-text', 'site-reviews'), |
|
| 31 | - ]); |
|
| 32 | - members_register_cap('edit_published_site-reviews', [ |
|
| 33 | - 'label' => _x('Edit Approved Reviews', 'admin-text', 'site-reviews'), |
|
| 34 | - ]); |
|
| 35 | - members_register_cap('publish_site-reviews', [ |
|
| 36 | - 'label' => _x('Approve Reviews', 'admin-text', 'site-reviews'), |
|
| 37 | - ]); |
|
| 38 | - members_register_cap('read_private_site-reviews', [ |
|
| 39 | - 'label' => _x('Read Private Reviews', 'admin-text', 'site-reviews'), |
|
| 40 | - ]); |
|
| 41 | - members_register_cap('create_site-review', [ |
|
| 42 | - 'label' => _x('Create Review (inactive)', 'admin-text', 'site-reviews'), |
|
| 43 | - ]); |
|
| 11 | + members_register_cap('delete_others_site-reviews', [ |
|
| 12 | + 'label' => _x("Delete Others' Reviews", 'admin-text', 'site-reviews'), |
|
| 13 | + ]); |
|
| 14 | + members_register_cap('delete_site-reviews', [ |
|
| 15 | + 'label' => _x('Delete Reviews', 'admin-text', 'site-reviews'), |
|
| 16 | + ]); |
|
| 17 | + members_register_cap('delete_private_site-reviews', [ |
|
| 18 | + 'label' => _x('Delete Private Reviews', 'admin-text', 'site-reviews'), |
|
| 19 | + ]); |
|
| 20 | + members_register_cap('delete_published_site-reviews', [ |
|
| 21 | + 'label' => _x('Delete Approved Reviews', 'admin-text', 'site-reviews'), |
|
| 22 | + ]); |
|
| 23 | + members_register_cap('edit_others_site-reviews', [ |
|
| 24 | + 'label' => _x("Edit Others' Reviews", 'admin-text', 'site-reviews'), |
|
| 25 | + ]); |
|
| 26 | + members_register_cap('edit_site-reviews', [ |
|
| 27 | + 'label' => _x('Edit Reviews', 'admin-text', 'site-reviews'), |
|
| 28 | + ]); |
|
| 29 | + members_register_cap('edit_private_site-reviews', [ |
|
| 30 | + 'label' => _x('Edit Private Reviews', 'admin-text', 'site-reviews'), |
|
| 31 | + ]); |
|
| 32 | + members_register_cap('edit_published_site-reviews', [ |
|
| 33 | + 'label' => _x('Edit Approved Reviews', 'admin-text', 'site-reviews'), |
|
| 34 | + ]); |
|
| 35 | + members_register_cap('publish_site-reviews', [ |
|
| 36 | + 'label' => _x('Approve Reviews', 'admin-text', 'site-reviews'), |
|
| 37 | + ]); |
|
| 38 | + members_register_cap('read_private_site-reviews', [ |
|
| 39 | + 'label' => _x('Read Private Reviews', 'admin-text', 'site-reviews'), |
|
| 40 | + ]); |
|
| 41 | + members_register_cap('create_site-review', [ |
|
| 42 | + 'label' => _x('Create Review (inactive)', 'admin-text', 'site-reviews'), |
|
| 43 | + ]); |
|
| 44 | 44 | }); |
| 45 | 45 | |
| 46 | 46 | /* |
@@ -50,10 +50,10 @@ discard block |
||
| 50 | 50 | * @see https://www.elegantthemes.com/gallery/divi/ |
| 51 | 51 | */ |
| 52 | 52 | add_action('site-reviews/customize/divi', function ($instance) { |
| 53 | - if ('label' != $instance->tag || 'checkbox' != $instance->args['type']) { |
|
| 54 | - return; |
|
| 55 | - } |
|
| 56 | - $instance->args['text'] = '<i></i>'.$instance->args['text']; |
|
| 53 | + if ('label' != $instance->tag || 'checkbox' != $instance->args['type']) { |
|
| 54 | + return; |
|
| 55 | + } |
|
| 56 | + $instance->args['text'] = '<i></i>'.$instance->args['text']; |
|
| 57 | 57 | }); |
| 58 | 58 | |
| 59 | 59 | /* |
@@ -64,14 +64,14 @@ discard block |
||
| 64 | 64 | * @see https://wordpress.org/plugins/wp-super-cache/ |
| 65 | 65 | */ |
| 66 | 66 | add_action('site-reviews/review/created', function ($review, $request) { |
| 67 | - if (!function_exists('wp_cache_post_change')) { |
|
| 68 | - return; |
|
| 69 | - } |
|
| 70 | - wp_cache_post_change($request->post_id); |
|
| 71 | - if (empty($review->assigned_to) || $review->assigned_to == $request->post_id) { |
|
| 72 | - return; |
|
| 73 | - } |
|
| 74 | - wp_cache_post_change($review->assigned_to); |
|
| 67 | + if (!function_exists('wp_cache_post_change')) { |
|
| 68 | + return; |
|
| 69 | + } |
|
| 70 | + wp_cache_post_change($request->post_id); |
|
| 71 | + if (empty($review->assigned_to) || $review->assigned_to == $request->post_id) { |
|
| 72 | + return; |
|
| 73 | + } |
|
| 74 | + wp_cache_post_change($review->assigned_to); |
|
| 75 | 75 | }, 10, 2); |
| 76 | 76 | |
| 77 | 77 | /* |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | * @see https://wordpress.org/plugins/speed-booster-pack/ |
| 82 | 82 | */ |
| 83 | 83 | add_filter('sbp_exclude_defer_scripts', function ($scriptHandles) { |
| 84 | - $scriptHandles[] = 'site-reviews/google-recaptcha'; |
|
| 85 | - return array_keys(array_flip($scriptHandles)); |
|
| 84 | + $scriptHandles[] = 'site-reviews/google-recaptcha'; |
|
| 85 | + return array_keys(array_flip($scriptHandles)); |
|
| 86 | 86 | }); |
| 87 | 87 | |
| 88 | 88 | /* |
@@ -92,15 +92,15 @@ discard block |
||
| 92 | 92 | * @see https://searchandfilter.com/ |
| 93 | 93 | */ |
| 94 | 94 | add_filter('sf_edit_query_args', function ($query) { |
| 95 | - if (!empty($query['meta_key']) && '_glsr_ranking' == $query['meta_key']) { |
|
| 96 | - unset($query['meta_key']); |
|
| 97 | - $query['meta_query'] = [ |
|
| 98 | - 'relation' => 'OR', |
|
| 99 | - ['key' => '_glsr_ranking', 'compare' => 'NOT EXISTS'], // this comes first! |
|
| 100 | - ['key' => '_glsr_ranking', 'compare' => 'EXISTS'], |
|
| 101 | - ]; |
|
| 102 | - } |
|
| 103 | - return $query; |
|
| 95 | + if (!empty($query['meta_key']) && '_glsr_ranking' == $query['meta_key']) { |
|
| 96 | + unset($query['meta_key']); |
|
| 97 | + $query['meta_query'] = [ |
|
| 98 | + 'relation' => 'OR', |
|
| 99 | + ['key' => '_glsr_ranking', 'compare' => 'NOT EXISTS'], // this comes first! |
|
| 100 | + ['key' => '_glsr_ranking', 'compare' => 'EXISTS'], |
|
| 101 | + ]; |
|
| 102 | + } |
|
| 103 | + return $query; |
|
| 104 | 104 | }, 20); |
| 105 | 105 | |
| 106 | 106 | /* |
@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | * @see https://wordpress.org/plugins/elementor/ |
| 110 | 110 | */ |
| 111 | 111 | add_action('wp_enqueue_scripts', function () { |
| 112 | - if (defined('ELEMENTOR_VERSION')) { |
|
| 113 | - wp_add_inline_script(glsr()->id, |
|
| 114 | - '"undefined"!==typeof jQuery&&jQuery(document).on("elementor/popup/show",function(){GLSR.forms.forEach(function(f){f.initStarRatings()})})' |
|
| 115 | - ); |
|
| 116 | - } |
|
| 112 | + if (defined('ELEMENTOR_VERSION')) { |
|
| 113 | + wp_add_inline_script(glsr()->id, |
|
| 114 | + '"undefined"!==typeof jQuery&&jQuery(document).on("elementor/popup/show",function(){GLSR.forms.forEach(function(f){f.initStarRatings()})})' |
|
| 115 | + ); |
|
| 116 | + } |
|
| 117 | 117 | }, 1000); |
@@ -4,49 +4,49 @@ |
||
| 4 | 4 | |
| 5 | 5 | class SiteReviewsSummaryTinymce extends SiteReviewsTinymce |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * @return array |
|
| 9 | - */ |
|
| 10 | - public function fields() |
|
| 11 | - { |
|
| 12 | - return [[ |
|
| 13 | - 'html' => sprintf('<p class="strong">%s</p>', _x('All settings are optional.', 'admin-text', 'site-reviews')), |
|
| 14 | - 'minWidth' => 320, |
|
| 15 | - 'type' => 'container', |
|
| 16 | - ], [ |
|
| 17 | - 'label' => _x('Title', 'admin-text', 'site-reviews'), |
|
| 18 | - 'name' => 'title', |
|
| 19 | - 'tooltip' => esc_attr_x('Enter a custom shortcode heading.', 'admin-text', 'site-reviews'), |
|
| 20 | - 'type' => 'textbox', |
|
| 21 | - ], |
|
| 22 | - $this->getTypes(_x('Which type of review would you like to use?', 'admin-text', 'site-reviews')), |
|
| 23 | - $this->getCategories(_x('Limit reviews to this category.', 'admin-text', 'site-reviews')), |
|
| 24 | - [ |
|
| 25 | - 'label' => _x('Assigned To', 'admin-text', 'site-reviews'), |
|
| 26 | - 'name' => 'assigned_to', |
|
| 27 | - 'tooltip' => esc_attr_x('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'admin-text', 'site-reviews'), |
|
| 28 | - 'type' => 'textbox', |
|
| 29 | - ], [ |
|
| 30 | - 'label' => _x('Schema', 'admin-text', 'site-reviews'), |
|
| 31 | - 'name' => 'schema', |
|
| 32 | - 'options' => [ |
|
| 33 | - 'true' => _x('Enable rich snippets', 'admin-text', 'site-reviews'), |
|
| 34 | - 'false' => _x('Disable rich snippets', 'admin-text', 'site-reviews'), |
|
| 35 | - ], |
|
| 36 | - 'tooltip' => esc_attr_x('Rich snippets are disabled by default.', 'admin-text', 'site-reviews'), |
|
| 37 | - 'type' => 'listbox', |
|
| 38 | - ], [ |
|
| 39 | - 'label' => _x('Classes', 'admin-text', 'site-reviews'), |
|
| 40 | - 'name' => 'class', |
|
| 41 | - 'tooltip' => esc_attr_x('Add custom CSS classes to the shortcode.', 'admin-text', 'site-reviews'), |
|
| 42 | - 'type' => 'textbox', |
|
| 43 | - ], [ |
|
| 44 | - 'columns' => 2, |
|
| 45 | - 'items' => $this->getHideOptions(), |
|
| 46 | - 'label' => _x('Hide', 'admin-text', 'site-reviews'), |
|
| 47 | - 'layout' => 'grid', |
|
| 48 | - 'spacing' => 5, |
|
| 49 | - 'type' => 'container', |
|
| 50 | - ], ]; |
|
| 51 | - } |
|
| 7 | + /** |
|
| 8 | + * @return array |
|
| 9 | + */ |
|
| 10 | + public function fields() |
|
| 11 | + { |
|
| 12 | + return [[ |
|
| 13 | + 'html' => sprintf('<p class="strong">%s</p>', _x('All settings are optional.', 'admin-text', 'site-reviews')), |
|
| 14 | + 'minWidth' => 320, |
|
| 15 | + 'type' => 'container', |
|
| 16 | + ], [ |
|
| 17 | + 'label' => _x('Title', 'admin-text', 'site-reviews'), |
|
| 18 | + 'name' => 'title', |
|
| 19 | + 'tooltip' => esc_attr_x('Enter a custom shortcode heading.', 'admin-text', 'site-reviews'), |
|
| 20 | + 'type' => 'textbox', |
|
| 21 | + ], |
|
| 22 | + $this->getTypes(_x('Which type of review would you like to use?', 'admin-text', 'site-reviews')), |
|
| 23 | + $this->getCategories(_x('Limit reviews to this category.', 'admin-text', 'site-reviews')), |
|
| 24 | + [ |
|
| 25 | + 'label' => _x('Assigned To', 'admin-text', 'site-reviews'), |
|
| 26 | + 'name' => 'assigned_to', |
|
| 27 | + 'tooltip' => esc_attr_x('Limit reviews to those assigned to this post ID (separate multiple IDs with a comma). You can also enter "post_id" to use the ID of the current page, or "parent_id" to use the ID of the parent page.', 'admin-text', 'site-reviews'), |
|
| 28 | + 'type' => 'textbox', |
|
| 29 | + ], [ |
|
| 30 | + 'label' => _x('Schema', 'admin-text', 'site-reviews'), |
|
| 31 | + 'name' => 'schema', |
|
| 32 | + 'options' => [ |
|
| 33 | + 'true' => _x('Enable rich snippets', 'admin-text', 'site-reviews'), |
|
| 34 | + 'false' => _x('Disable rich snippets', 'admin-text', 'site-reviews'), |
|
| 35 | + ], |
|
| 36 | + 'tooltip' => esc_attr_x('Rich snippets are disabled by default.', 'admin-text', 'site-reviews'), |
|
| 37 | + 'type' => 'listbox', |
|
| 38 | + ], [ |
|
| 39 | + 'label' => _x('Classes', 'admin-text', 'site-reviews'), |
|
| 40 | + 'name' => 'class', |
|
| 41 | + 'tooltip' => esc_attr_x('Add custom CSS classes to the shortcode.', 'admin-text', 'site-reviews'), |
|
| 42 | + 'type' => 'textbox', |
|
| 43 | + ], [ |
|
| 44 | + 'columns' => 2, |
|
| 45 | + 'items' => $this->getHideOptions(), |
|
| 46 | + 'label' => _x('Hide', 'admin-text', 'site-reviews'), |
|
| 47 | + 'layout' => 'grid', |
|
| 48 | + 'spacing' => 5, |
|
| 49 | + 'type' => 'container', |
|
| 50 | + ], ]; |
|
| 51 | + } |
|
| 52 | 52 | } |
@@ -4,50 +4,50 @@ |
||
| 4 | 4 | |
| 5 | 5 | class SiteReviewsFormTinymce extends TinymceGenerator |
| 6 | 6 | { |
| 7 | - /** |
|
| 8 | - * @return array |
|
| 9 | - */ |
|
| 10 | - public function fields() |
|
| 11 | - { |
|
| 12 | - return [[ |
|
| 13 | - 'type' => 'container', |
|
| 14 | - 'html' => '<p class="strong">'._x('All settings are optional.', 'admin-text', 'site-reviews').'</p>', |
|
| 15 | - ], [ |
|
| 16 | - 'label' => _x('Title', 'admin-text', 'site-reviews'), |
|
| 17 | - 'name' => 'title', |
|
| 18 | - 'tooltip' => esc_attr_x('Enter a custom shortcode heading.', 'admin-text', 'site-reviews'), |
|
| 19 | - 'type' => 'textbox', |
|
| 20 | - ], [ |
|
| 21 | - 'label' => _x('Description', 'admin-text', 'site-reviews'), |
|
| 22 | - 'minHeight' => 60, |
|
| 23 | - 'minWidth' => 240, |
|
| 24 | - 'multiline' => true, |
|
| 25 | - 'name' => 'description', |
|
| 26 | - 'tooltip' => esc_attr_x('Enter a custom shortcode description.', 'admin-text', 'site-reviews'), |
|
| 27 | - 'type' => 'textbox', |
|
| 28 | - ], |
|
| 29 | - $this->getCategories(_x('Automatically assign a category to reviews submitted with this shortcode.', 'admin-text', 'site-reviews')), |
|
| 30 | - [ |
|
| 31 | - 'label' => _x('Assign To', 'admin-text', 'site-reviews'), |
|
| 32 | - 'name' => 'assign_to', |
|
| 33 | - 'tooltip' => esc_attr_x('Assign submitted reviews to a custom page/post ID. You can also enter "post_id" to assign reviews to the ID of the current page.', 'admin-text', 'site-reviews'), |
|
| 34 | - 'type' => 'textbox', |
|
| 35 | - ], [ |
|
| 36 | - 'label' => _x('Classes', 'admin-text', 'site-reviews'), |
|
| 37 | - 'name' => 'class', |
|
| 38 | - 'tooltip' => esc_attr_x('Add custom CSS classes to the shortcode.', 'admin-text', 'site-reviews'), |
|
| 39 | - 'type' => 'textbox', |
|
| 40 | - ], [ |
|
| 41 | - 'columns' => 2, |
|
| 42 | - 'items' => $this->getHideOptions(), |
|
| 43 | - 'label' => _x('Hide', 'admin-text', 'site-reviews'), |
|
| 44 | - 'layout' => 'grid', |
|
| 45 | - 'spacing' => 5, |
|
| 46 | - 'type' => 'container', |
|
| 47 | - ], [ |
|
| 48 | - 'hidden' => true, |
|
| 49 | - 'name' => 'id', |
|
| 50 | - 'type' => 'textbox', |
|
| 51 | - ], ]; |
|
| 52 | - } |
|
| 7 | + /** |
|
| 8 | + * @return array |
|
| 9 | + */ |
|
| 10 | + public function fields() |
|
| 11 | + { |
|
| 12 | + return [[ |
|
| 13 | + 'type' => 'container', |
|
| 14 | + 'html' => '<p class="strong">'._x('All settings are optional.', 'admin-text', 'site-reviews').'</p>', |
|
| 15 | + ], [ |
|
| 16 | + 'label' => _x('Title', 'admin-text', 'site-reviews'), |
|
| 17 | + 'name' => 'title', |
|
| 18 | + 'tooltip' => esc_attr_x('Enter a custom shortcode heading.', 'admin-text', 'site-reviews'), |
|
| 19 | + 'type' => 'textbox', |
|
| 20 | + ], [ |
|
| 21 | + 'label' => _x('Description', 'admin-text', 'site-reviews'), |
|
| 22 | + 'minHeight' => 60, |
|
| 23 | + 'minWidth' => 240, |
|
| 24 | + 'multiline' => true, |
|
| 25 | + 'name' => 'description', |
|
| 26 | + 'tooltip' => esc_attr_x('Enter a custom shortcode description.', 'admin-text', 'site-reviews'), |
|
| 27 | + 'type' => 'textbox', |
|
| 28 | + ], |
|
| 29 | + $this->getCategories(_x('Automatically assign a category to reviews submitted with this shortcode.', 'admin-text', 'site-reviews')), |
|
| 30 | + [ |
|
| 31 | + 'label' => _x('Assign To', 'admin-text', 'site-reviews'), |
|
| 32 | + 'name' => 'assign_to', |
|
| 33 | + 'tooltip' => esc_attr_x('Assign submitted reviews to a custom page/post ID. You can also enter "post_id" to assign reviews to the ID of the current page.', 'admin-text', 'site-reviews'), |
|
| 34 | + 'type' => 'textbox', |
|
| 35 | + ], [ |
|
| 36 | + 'label' => _x('Classes', 'admin-text', 'site-reviews'), |
|
| 37 | + 'name' => 'class', |
|
| 38 | + 'tooltip' => esc_attr_x('Add custom CSS classes to the shortcode.', 'admin-text', 'site-reviews'), |
|
| 39 | + 'type' => 'textbox', |
|
| 40 | + ], [ |
|
| 41 | + 'columns' => 2, |
|
| 42 | + 'items' => $this->getHideOptions(), |
|
| 43 | + 'label' => _x('Hide', 'admin-text', 'site-reviews'), |
|
| 44 | + 'layout' => 'grid', |
|
| 45 | + 'spacing' => 5, |
|
| 46 | + 'type' => 'container', |
|
| 47 | + ], [ |
|
| 48 | + 'hidden' => true, |
|
| 49 | + 'name' => 'id', |
|
| 50 | + 'type' => 'textbox', |
|
| 51 | + ], ]; |
|
| 52 | + } |
|
| 53 | 53 | } |