1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace GeminiLabs\SiteReviews\Shortcodes; |
4
|
|
|
|
5
|
|
|
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsButton; |
6
|
|
|
|
7
|
|
|
class SiteReviewsSummaryButton extends SiteReviewsButton |
8
|
|
|
{ |
9
|
|
|
/** |
10
|
|
|
* @return array |
11
|
|
|
*/ |
12
|
1 |
|
public function fields() |
13
|
|
|
{ |
14
|
|
|
return [[ |
15
|
1 |
|
'html' => sprintf( '<p class="strong">%s</p>', esc_html__( 'All settings are optional.', 'site-reviews' )), |
16
|
1 |
|
'minWidth' => 320, |
17
|
1 |
|
'type' => 'container', |
18
|
|
|
],[ |
19
|
1 |
|
'label' => esc_html__( 'Title', 'site-reviews' ), |
20
|
1 |
|
'name' => 'title', |
21
|
1 |
|
'tooltip' => esc_attr__( 'Enter a custom shortcode heading.', 'site-reviews' ), |
22
|
1 |
|
'type' => 'textbox', |
23
|
|
|
], |
24
|
1 |
|
$this->getTypes(), |
25
|
1 |
|
$this->getTerms(), |
26
|
|
|
[ |
27
|
1 |
|
'label' => esc_html__( 'Post ID', 'site-reviews' ), |
28
|
1 |
|
'name' => 'assigned_to', |
29
|
1 |
|
'tooltip' => esc_attr__( '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.', 'site-reviews' ), |
30
|
1 |
|
'type' => 'textbox', |
31
|
|
|
],[ |
32
|
1 |
|
'label' => esc_html__( 'Schema', 'site-reviews' ), |
33
|
1 |
|
'name' => 'schema', |
34
|
|
|
'options' => [ |
35
|
1 |
|
'true' => esc_html__( 'Enable rich snippets', 'site-reviews' ), |
36
|
1 |
|
'false' => esc_html__( 'Disable rich snippets', 'site-reviews' ), |
37
|
|
|
], |
38
|
1 |
|
'tooltip' => esc_attr__( 'Rich snippets are disabled by default.', 'site-reviews' ), |
39
|
1 |
|
'type' => 'listbox', |
40
|
|
|
],[ |
41
|
1 |
|
'label' => esc_html__( 'Classes', 'site-reviews' ), |
42
|
1 |
|
'name' => 'class', |
43
|
1 |
|
'tooltip' => esc_attr__( 'Add custom CSS classes to the shortcode.', 'site-reviews' ), |
44
|
1 |
|
'type' => 'textbox', |
45
|
|
|
],[ |
46
|
1 |
|
'columns' => 2, |
47
|
|
|
'items' => [[ |
48
|
1 |
|
'type' => 'checkbox', |
49
|
1 |
|
'name' => 'hide_bars', |
50
|
1 |
|
'text' => esc_html__( 'Bars', 'site-reviews' ), |
51
|
1 |
|
'tooltip' => esc_attr__( 'Hide the percentage bars?', 'site-reviews' ), |
52
|
|
|
],[ |
53
|
1 |
|
'type' => 'checkbox', |
54
|
1 |
|
'name' => 'hide_if_empty', |
55
|
1 |
|
'text' => esc_html__( 'If Empty', 'site-reviews' ), |
56
|
1 |
|
'tooltip' => esc_attr__( 'Hide the summary if no reviews are found?', 'site-reviews' ), |
57
|
|
|
],[ |
58
|
1 |
|
'type' => 'checkbox', |
59
|
1 |
|
'name' => 'hide_rating', |
60
|
1 |
|
'text' => esc_html__( 'Rating', 'site-reviews' ), |
61
|
1 |
|
'tooltip' => esc_attr__( 'Hide the rating?', 'site-reviews' ), |
62
|
|
|
],[ |
63
|
1 |
|
'type' => 'checkbox', |
64
|
1 |
|
'name' => 'hide_stars', |
65
|
1 |
|
'text' => esc_html__( 'Stars', 'site-reviews' ), |
66
|
1 |
|
'tooltip' => esc_attr__( 'Hide the stars?', 'site-reviews' ), |
67
|
|
|
],[ |
68
|
1 |
|
'type' => 'checkbox', |
69
|
1 |
|
'name' => 'hide_summary', |
70
|
1 |
|
'text' => esc_html__( 'Summary', 'site-reviews' ), |
71
|
1 |
|
'tooltip' => esc_attr__( 'Hide the summary text?', 'site-reviews' ), |
72
|
|
|
]], |
73
|
1 |
|
'layout' => 'grid', |
74
|
1 |
|
'label' => esc_html__( 'Hide', 'site-reviews' ), |
75
|
1 |
|
'spacing' => 5, |
76
|
1 |
|
'type' => 'container', |
77
|
|
|
]]; |
78
|
|
|
} |
79
|
|
|
} |
80
|
|
|
|