diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2020-01-06 14:32:30 -0500 |
commit | 10ef81bf85ad0a4bad0d204838e14c99ca2526f7 (patch) | |
tree | b4bb36a326d41de12d1a6181d2a2baf34696ac24 /plugins/jetpack/modules/widgets/search.php | |
parent | Updating script for Update (diff) | |
download | blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.gz blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.tar.bz2 blogs-gentoo-10ef81bf85ad0a4bad0d204838e14c99ca2526f7.zip |
Update jetpack 8.0
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'plugins/jetpack/modules/widgets/search.php')
-rw-r--r-- | plugins/jetpack/modules/widgets/search.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/jetpack/modules/widgets/search.php b/plugins/jetpack/modules/widgets/search.php index 54d866b5..49cb9b7f 100644 --- a/plugins/jetpack/modules/widgets/search.php +++ b/plugins/jetpack/modules/widgets/search.php @@ -7,6 +7,9 @@ * @since 5.0.0 */ +use Automattic\Jetpack\Constants; +use Automattic\Jetpack\Status; + add_action( 'widgets_init', 'jetpack_search_widget_init' ); function jetpack_search_widget_init() { @@ -164,7 +167,7 @@ class Jetpack_Search_Widget extends WP_Widget { * @since 5.8.0 */ public function enqueue_frontend_scripts() { - if ( ! is_active_widget( false, false, $this->id_base, true ) ) { + if ( ! is_active_widget( false, false, $this->id_base, true ) || Constants::is_true( 'JETPACK_SEARCH_PROTOTYPE' ) ) { return; } @@ -266,7 +269,7 @@ class Jetpack_Search_Widget extends WP_Widget { $display_filters = false; - if ( Jetpack::is_development_mode() ) { + if ( ( new Status() )->is_development_mode() ) { echo $args['before_widget']; ?><div id="<?php echo esc_attr( $this->id ); ?>-wrapper"> <div class="jetpack-search-sort-wrapper"> @@ -309,7 +312,8 @@ class Jetpack_Search_Widget extends WP_Widget { $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; - ?><div id="<?php echo esc_attr( $this->id ); ?>-wrapper"> + ?><div id="<?php echo esc_attr( $this->id ); ?>-wrapper" class="<?php + echo Constants::is_true( 'JETPACK_SEARCH_PROTOTYPE' ) ? 'jetpack-instant-search-wrapper' : '' ?>"> <?php if ( ! empty( $title ) ) { @@ -393,6 +397,10 @@ class Jetpack_Search_Widget extends WP_Widget { * @param string $orderby The orderby to initialize the select with. */ private function maybe_render_sort_javascript( $instance, $order, $orderby ) { + if ( Constants::is_true( 'JETPACK_SEARCH_PROTOTYPE' ) ) { + return; + } + if ( ! empty( $instance['user_sort_enabled'] ) ) : ?> <script type="text/javascript"> |