PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-search/src/customizer/class-customizer.php +74 -4 12.0.3 → 16.3 View file →
@@ -8,13 +8,22 @@
8 8 namespace Automattic\Jetpack\Search;
9 9
10 10 use Automattic\Jetpack\Assets;
11 11 use WP_Customize_Color_Control;
12 +use WP_Customize_Manager;
12 13
13 14 /**
14 15 * Class to customize search on the site.
16 + *
17 + * @phan-constructor-used-for-side-effects
15 18 */
16 19 class Customizer {
20 + /**
21 + * Search Plan class.
22 + *
23 + * @var Plan
24 + */
25 + public $plan;
17 26
18 27 /**
19 28 * Class initialization.
20 29 */
@@ -35,9 +44,10 @@
35 44
36 45 $wp_customize->add_section(
37 46 $section_id,
38 47 array(
39 - 'title' => esc_html__( 'Jetpack Search', 'jetpack-search-pkg' ),
48 + /** "Search" is a product name, do not translate. */
49 + 'title' => 'Jetpack Search',
40 50 'capability' => 'edit_theme_options',
41 51 'priority' => 200,
42 52 )
43 53 );
@@ -100,11 +110,14 @@
100 110 $wp_customize->add_control(
101 111 $id,
102 112 array(
103 113 'choices' => array(
104 - 'relevance' => __( 'Relevance (recommended)', 'jetpack-search-pkg' ),
105 - 'newest' => __( 'Newest first', 'jetpack-search-pkg' ),
106 - 'oldest' => __( 'Oldest first', 'jetpack-search-pkg' ),
114 + 'relevance' => __( 'Relevance (recommended)', 'jetpack-search-pkg' ),
115 + 'newest' => __( 'Newest first', 'jetpack-search-pkg' ),
116 + 'oldest' => __( 'Oldest first', 'jetpack-search-pkg' ),
117 + 'rating_desc' => __( 'Product rating', 'jetpack-search-pkg' ),
118 + 'price_asc' => __( 'Price: low to high', 'jetpack-search-pkg' ),
119 + 'price_desc' => __( 'Price: high to low', 'jetpack-search-pkg' ),
107 120 ),
108 121 'description' => __( 'Pick the initial sort for your search results.', 'jetpack-search-pkg' ),
109 122 'label' => __( 'Default Sort', 'jetpack-search-pkg' ),
110 123 'section' => $section_id,
@@ -134,8 +147,45 @@
134 147 ),
135 148 )
136 149 );
137 150
151 + $id = $setting_prefix . 'filtering_opens_overlay_settings';
152 + $wp_customize->add_setting(
153 + $id,
154 + array( 'type' => 'option' )
155 + );
156 + $wp_customize->add_control(
157 + new Label_Control(
158 + $wp_customize,
159 + $id,
160 + array(
161 + 'label' => __( 'Filtering Search Overlay', 'jetpack-search-pkg' ),
162 + 'description' => __( 'Open overlay when filters are used outside the Jetpack Sidebar', 'jetpack-search-pkg' ),
163 + 'section' => $section_id,
164 + )
165 + )
166 + );
167 +
168 + $id = $setting_prefix . 'filtering_opens_overlay';
169 + $wp_customize->add_setting(
170 + $id,
171 + array(
172 + 'default' => '1',
173 + 'sanitize_callback' => array( 'Automattic\Jetpack\Search\Helper', 'sanitize_checkbox_value' ),
174 + 'sanitize_js_callback' => array( 'Automattic\Jetpack\Search\Helper', 'sanitize_checkbox_value_for_js' ),
175 + 'transport' => 'postMessage',
176 + 'type' => 'option',
177 + )
178 + );
179 + $wp_customize->add_control(
180 + $id,
181 + array(
182 + 'type' => 'checkbox',
183 + 'section' => $section_id,
184 + 'label' => __( 'Open overlay from filter links', 'jetpack-search-pkg' ),
185 + )
186 + );
187 +
138 188 $id = $setting_prefix . 'excluded_post_types';
139 189 $wp_customize->add_setting(
140 190 $id,
141 191 array(
@@ -248,8 +298,28 @@
248 298 array(
249 299 'type' => 'checkbox',
250 300 'section' => $section_id,
251 301 'label' => __( 'Show post date', 'jetpack-search-pkg' ),
302 + )
303 + );
304 +
305 + $id = $setting_prefix . 'show_product_price';
306 + $wp_customize->add_setting(
307 + $id,
308 + array(
309 + 'default' => '1',
310 + 'sanitize_callback' => array( 'Automattic\Jetpack\Search\Helper', 'sanitize_checkbox_value' ),
311 + 'sanitize_js_callback' => array( 'Automattic\Jetpack\Search\Helper', 'sanitize_checkbox_value_for_js' ),
312 + 'transport' => 'postMessage',
313 + 'type' => 'option',
314 + )
315 + );
316 + $wp_customize->add_control(
317 + $id,
318 + array(
319 + 'type' => 'checkbox',
320 + 'section' => $section_id,
321 + 'label' => __( 'Show price', 'jetpack-search-pkg' ),
252 322 )
253 323 );
254 324
255 325 $id = $setting_prefix . 'show_powered_by';