Making WordPress.org


Ignore:
Timestamp:
02/12/2020 04:03:15 AM (5 years ago)
Author:
dd32
Message:

Plugin Directory: Update the filter in r9499 to handle the searched module being held at array index 0, which shouldn't happen on the plugins directory, but was an issue on the Themes Directory.

See #5023.

File:
1 edited

Legend:

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

    r9499 r9501  
    7171        add_filter( 'jetpack_active_modules', function( $modules ) {
    7272            // Disable Jetpack Search
    73             if ( $i = array_search( 'search', $modules ) )
     73            if ( false !== ( $i = array_search( 'search', $modules ) ) ) {
    7474                unset( $modules[$i] );
     75            }
    7576
    7677            // Disable Jetpack Sitemaps on Rosetta sites.
    7778            if ( !empty( $GLOBALS['rosetta'] ) ) {
    78                 if ( $i = array_search( 'sitemaps', $modules ) ) {
     79                if ( false !== ( $i = array_search( 'sitemaps', $modules ) ) ) {
    7980                    unset( $modules[$i] );
    8081                }
Note: See TracChangeset for help on using the changeset viewer.