|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace GeminiLabs\SiteReviews\Integrations\FusionBuilder; |
|
4
|
|
|
|
|
5
|
|
|
use GeminiLabs\SiteReviews\Commands\EnqueuePublicAssets; |
|
6
|
|
|
|
|
7
|
|
|
abstract class FusionElement extends \Fusion_Element |
|
|
|
|
|
|
8
|
|
|
{ |
|
9
|
|
|
abstract public static function elementParameters(): array; |
|
10
|
|
|
|
|
11
|
|
|
public static function optionAssignedTerms(string $heading, string $description = ''): array |
|
12
|
|
|
{ |
|
13
|
|
|
$isFusionEditor = function_exists('is_fusion_editor') && is_fusion_editor(); |
|
14
|
|
|
if ($isFusionEditor && function_exists('fusion_builder_shortcodes_categories')) { |
|
15
|
|
|
$terms = fusion_builder_shortcodes_categories(glsr()->taxonomy, false, '', 26); |
|
16
|
|
|
} else { |
|
17
|
|
|
$terms = []; |
|
18
|
|
|
} |
|
19
|
|
|
$option = [ |
|
20
|
|
|
'default' => '', |
|
21
|
|
|
'heading' => $heading, |
|
22
|
|
|
'param_name' => 'assigned_terms', |
|
23
|
|
|
'placeholder_text' => esc_attr_x('Select or Leave Blank', 'admin-text', 'site-reviews'), |
|
24
|
|
|
'type' => 'multiple_select', |
|
25
|
|
|
'value' => $terms, |
|
26
|
|
|
]; |
|
27
|
|
|
if (!empty($description)) { |
|
28
|
|
|
$option['description'] = $description; |
|
29
|
|
|
} |
|
30
|
|
|
if (count($terms) > 25) { |
|
31
|
|
|
$option['type'] = 'ajax_select'; |
|
32
|
|
|
$option['ajax'] = 'fusion_search_query'; |
|
33
|
|
|
$option['value'] = []; |
|
34
|
|
|
$option['ajax_params'] = [ |
|
35
|
|
|
'taxonomy' => glsr()->taxonomy, |
|
36
|
|
|
'use_slugs' => true, |
|
37
|
|
|
]; |
|
38
|
|
|
} |
|
39
|
|
|
return $option; |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
public static function optionReviewTypes(): array |
|
43
|
|
|
{ |
|
44
|
|
|
$types = glsr()->retrieveAs('array', 'review_types', []); |
|
45
|
|
|
if (2 > count($types)) { |
|
46
|
|
|
return []; |
|
47
|
|
|
} |
|
48
|
|
|
return [ |
|
49
|
|
|
'default' => 'local', |
|
50
|
|
|
'heading' => esc_attr_x('Limit the Review Type', 'admin-text', 'site-reviews'), |
|
51
|
|
|
'param_name' => 'type', |
|
52
|
|
|
'placeholder_text' => esc_attr_x('Select or Leave Blank', 'admin-text', 'site-reviews'), |
|
53
|
|
|
'type' => 'multiple_select', |
|
54
|
|
|
'value' => $types, |
|
55
|
|
|
]; |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
abstract public static function registerElement(): void; |
|
59
|
|
|
} |
|
60
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths