1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace GeminiLabs\SiteReviews\Widgets; |
4
|
|
|
|
5
|
|
|
use GeminiLabs\SiteReviews\Contracts\ShortcodeContract; |
6
|
|
|
use GeminiLabs\SiteReviews\Shortcodes\SiteReviewsFormShortcode; |
7
|
|
|
|
8
|
|
|
class SiteReviewsFormWidget extends Widget |
9
|
|
|
{ |
10
|
|
|
protected function wConfig(): array |
11
|
|
|
{ |
12
|
|
|
return [ |
13
|
|
|
'assigned_posts' => [ |
14
|
|
|
'description' => esc_html_x('Enter "post_id" to use the Post ID of the current page.', 'admin-text', 'site-reviews'), |
15
|
|
|
'label' => esc_html_x('Assign New Reviews to Pages', 'admin-text', 'site-reviews'), |
16
|
|
|
'type' => 'text', |
17
|
|
|
], |
18
|
|
|
'assigned_users' => [ |
19
|
|
|
'description' => esc_html_x('Enter "user_id" to use the ID of the logged-in user.', 'admin-text', 'site-reviews'), |
20
|
|
|
'label' => esc_html_x('Assign New Reviews to Users', 'admin-text', 'site-reviews'), |
21
|
|
|
'type' => 'text', |
22
|
|
|
], |
23
|
|
|
'assigned_terms' => [ |
24
|
|
|
'label' => esc_html_x('Assign New Reviews to Categories', 'admin-text', 'site-reviews'), |
25
|
|
|
'options' => $this->fieldAssignedTermsOptions(), |
26
|
|
|
'type' => 'select', |
27
|
|
|
], |
28
|
|
|
'hide' => [ |
29
|
|
|
'options' => $this->shortcode->options('hide'), |
30
|
|
|
'type' => 'checkbox', |
31
|
|
|
], |
32
|
|
|
'id' => [ |
33
|
|
|
'description' => esc_html_x('This should be a unique value.', 'admin-text', 'site-reviews'), |
34
|
|
|
'label' => esc_html_x('Custom ID', 'admin-text', 'site-reviews'), |
35
|
|
|
'type' => 'text', |
36
|
|
|
], |
37
|
|
|
'class' => [ |
38
|
|
|
'description' => esc_html_x('Separate multiple classes with spaces.', 'admin-text', 'site-reviews'), |
39
|
|
|
'label' => esc_html_x('Additional CSS classes', 'admin-text', 'site-reviews'), |
40
|
|
|
'type' => 'text', |
41
|
|
|
], |
42
|
|
|
]; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
protected function wShortcode(): ShortcodeContract |
46
|
|
|
{ |
47
|
|
|
return glsr(SiteReviewsFormShortcode::class); |
|
|
|
|
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|