1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace GeminiLabs\SiteReviews\Integrations\WPBakery; |
4
|
|
|
|
5
|
|
|
use GeminiLabs\SiteReviews\Contracts\ShortcodeContract; |
6
|
|
|
|
7
|
|
|
abstract class VcShortcode extends \WPBakeryShortCode |
|
|
|
|
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* Override the "vc_map" data with the |
11
|
|
|
* "vc_element_settings_filter" ($settings, $shortcode) filter hook. |
12
|
|
|
*/ |
13
|
|
|
public static function vcRegister(array $args = []): void |
14
|
|
|
{ |
15
|
|
|
vc_map(wp_parse_args($args, [ |
|
|
|
|
16
|
|
|
'base' => static::vcShortcode()->shortcode, |
17
|
|
|
'category' => glsr()->name, |
18
|
|
|
'description' => static::vcShortcode()->description, |
|
|
|
|
19
|
|
|
'icon' => static::vcShortcodeIcon(), |
20
|
|
|
'name' => static::vcShortcode()->name, |
|
|
|
|
21
|
|
|
'params' => array_values(array_filter(static::vcShortcodeSettings())), |
22
|
|
|
'php_class_name' => static::class, |
23
|
|
|
'show_settings_on_create' => false, |
24
|
|
|
])); |
25
|
|
|
} |
26
|
|
|
|
27
|
|
|
public static function vcShortcode(): ShortcodeContract |
28
|
|
|
{ |
29
|
|
|
return glsr(static::vcShortcodeClass()); |
|
|
|
|
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
abstract public static function vcShortcodeClass(): string; |
33
|
|
|
|
34
|
|
|
abstract public static function vcShortcodeIcon(): string; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Override attributes for a setting with the |
38
|
|
|
* "vc_mapper_attribute" ($setting, $shortcode) filter hook. |
39
|
|
|
*/ |
40
|
|
|
public static function vcShortcodeSettings(): array |
41
|
|
|
{ |
42
|
|
|
return []; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public static function vcTypeOptions(): array |
46
|
|
|
{ |
47
|
|
|
$types = glsr()->retrieveAs('array', 'review_types', []); |
48
|
|
|
if (2 > count($types)) { |
49
|
|
|
return []; |
50
|
|
|
} |
51
|
|
|
return [ |
52
|
|
|
'type' => 'dropdown', |
53
|
|
|
'heading' => esc_html_x('Limit Reviews by Type', 'admin-text', 'site-reviews'), |
54
|
|
|
'param_name' => 'type', |
55
|
|
|
'std' => 'local', |
56
|
|
|
'value' => array_flip($types), |
57
|
|
|
]; |
58
|
|
|
} |
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