Making WordPress.org


Ignore:
Timestamp:
04/10/2017 09:53:03 PM (8 years ago)
Author:
ocean90
Message:

Plugin Directory: Don't use Jetpack Search if the site isn't connected.

Makes the search available in the meta environment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-plugin-directory.php

    r5312 r5315  
    470470
    471471        // Instantiate our copy of the Jetpack_Search class.
    472         if ( class_exists( 'Jetpack' ) && ! class_exists( 'Jetpack_Search' )
    473             && !isset( $_GET['s'] ) ) { // Don't run the ES query if we're going to redirect to the pretty search URL
     472        if ( class_exists( 'Jetpack' ) && \Jetpack::get_option( 'id' ) && ! class_exists( 'Jetpack_Search' )
     473            && ! isset( $_GET['s'] ) ) { // Don't run the ES query if we're going to redirect to the pretty search URL
    474474                require_once( __DIR__ . '/libs/site-search/jetpack-search.php' );
    475475                \Jetpack_Search::instance();
     
    813813    public function bypass_options_cache( $value, $option ) {
    814814        global $wpdb;
    815         $value = $wpdb->get_var( 
     815        $value = $wpdb->get_var(
    816816            $wpdb->prepare(
    817                 "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", 
     817                "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1",
    818818                $option
    819819            )
     
    10251025            die();
    10261026        }
    1027    
     1027
    10281028        // We've disabled WordPress's default 404 redirects, so we'll handle them ourselves.
    10291029        if ( is_404() ) {
     
    11891189    /**
    11901190     * Create a new post entry for a given plugin slug.
    1191      * 
     1191     *
    11921192     * @static
    11931193     *
Note: See TracChangeset for help on using the changeset viewer.