← All changes
|
jetpack_vendor/automattic/jetpack-search/src/customizer/class-customizer.php
+31
-4
12.4.2
→
16.3
View file →
| @@ -8,11 +8,14 @@ | ||
| 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 { |
| 17 | 20 | /** |
| 18 | 21 | * Search Plan class. |
| @@ -41,9 +44,10 @@ | ||
| 41 | 44 | |
| 42 | 45 | $wp_customize->add_section( |
| 43 | 46 | $section_id, |
| 44 | 47 | array( |
| 45 | - 'title' => esc_html__( 'Jetpack Search', 'jetpack-search-pkg' ), | |
| 48 | + /** "Search" is a product name, do not translate. */ | |
| 49 | + 'title' => 'Jetpack Search', | |
| 46 | 50 | 'capability' => 'edit_theme_options', |
| 47 | 51 | 'priority' => 200, |
| 48 | 52 | ) |
| 49 | 53 | ); |
| @@ -106,11 +110,14 @@ | ||
| 106 | 110 | $wp_customize->add_control( |
| 107 | 111 | $id, |
| 108 | 112 | array( |
| 109 | 113 | 'choices' => array( |
| 110 | - 'relevance' => __( 'Relevance (recommended)', 'jetpack-search-pkg' ), | |
| 111 | - 'newest' => __( 'Newest first', 'jetpack-search-pkg' ), | |
| 112 | - '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' ), | |
| 113 | 120 | ), |
| 114 | 121 | 'description' => __( 'Pick the initial sort for your search results.', 'jetpack-search-pkg' ), |
| 115 | 122 | 'label' => __( 'Default Sort', 'jetpack-search-pkg' ), |
| 116 | 123 | 'section' => $section_id, |
| @@ -291,8 +298,28 @@ | ||
| 291 | 298 | array( |
| 292 | 299 | 'type' => 'checkbox', |
| 293 | 300 | 'section' => $section_id, |
| 294 | 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' ), | |
| 295 | 322 | ) |
| 296 | 323 | ); |
| 297 | 324 | |
| 298 | 325 | $id = $setting_prefix . 'show_powered_by'; |