WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/23/2020 03:12:49 AM (4 months ago)
Author:
jorbin
Message:

General: Update code for readability and inclusion

There are two pieces in here:

1) The update to change blacklist to blocklist is moved to disallowed_list. "Block" has a meaning in our code, and there could be ambiguity between this code and code related to blocks.

2) This improves backwards compatibility for code that was accessing the now deprecated code.

Previously: [48477], [48405], [48400], [48121], [48122], [48124], [48142], [48566]

Props: desrosj, SergeyBiryukov, johnjamesjacoby
Fixes: #50413

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r48405 r48575  
    21782178        wp_schedule_single_event( time() + ( 1 * MINUTE_IN_SECONDS ), 'wp_update_comment_type_batch' );
    21792179
    2180         // Use more clear and inclusive language.
    2181         $blocklist = get_option( 'blacklist_keys', '' );
    2182         update_option( 'blocklist_keys', $blocklist );
    2183         delete_option( 'blacklist_keys' );
    2184 
    21852180        $comment_previously_approved = get_option( 'comment_whitelist', '' );
    21862181        update_option( 'comment_previously_approved', $comment_previously_approved );
    21872182        delete_option( 'comment_whitelist' );
     2183    }
     2184
     2185    if ( $wp_current_db_version < 48572 ) {
     2186        // Use more clear and inclusive language.
     2187        $disallowed_list = get_option( 'blacklist_keys' );
     2188
     2189        if ( false === $disallowed_list ) {
     2190            $disallowed_list = get_option( 'blocklist_keys' );
     2191        }
     2192
     2193        update_option( 'disallowed_keys', $disallowed_list );
     2194        delete_option( 'blacklist_keys' );
     2195        delete_option( 'blocklist_keys' );
    21882196    }
    21892197}
Note: See TracChangeset for help on using the changeset viewer.