Skip to:
Content

BuddyPress.org

Changeset 12695


Ignore:
Timestamp:
07/30/2020 09:10:40 PM (4 years ago)
Author:
imath
Message:

Core: use the right option name for moderation disallowed keys

Since WordPress 5.5 the blacklist_keys option name has been deprecated in favor of the disallowed_keys one. Depending on the installed WordPress version, this commit makes sure we use the right option name.

Props boonebgorges

Fixes #8338 (branch 6.0)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/6.0/src/bp-core/bp-core-moderation.php

    r11447 r12695  
    191191 * @since 2.6.0 Added $error_type parameter.
    192192 *
    193  * @todo Why don't we use wp_blacklist_check() for this?
     193 * @todo Why don't we use wp_check_comment_disallowed_list() for this?
    194194 *
    195195 * @param int    $user_id    User ID.
     
    225225    /** Blacklist ************************************************************
    226226     */
     227    $disallowed_keys_option_name = 'blacklist_keys';
     228    if ( function_exists( 'wp_check_comment_disallowed_list' ) ) {
     229        $disallowed_keys_option_name = 'disallowed_keys';
     230    }
    227231
    228232    // Get the moderation keys.
    229     $blacklist = trim( get_option( 'blacklist_keys' ) );
     233    $blacklist = trim( get_option( $disallowed_keys_option_name ) );
    230234
    231235    // Bail if blacklist is empty.
Note: See TracChangeset for help on using the changeset viewer.