Make WordPress Core


Ignore:
Timestamp:
08/20/2022 12:25:13 AM (2 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Check for deprecated options before wp_installing().

This is a micro-optimization that makes the conditional several times faster for non-deprecated options by avoiding an unnecessary function call.

Functions affected:

  • get_option()
  • update_option()
  • add_option()

Follow-up to [48575].

See #55647.

File:
1 edited

Legend:

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

    r53827 r53914  
    9696    );
    9797
    98     if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {
     98    if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
    9999        _deprecated_argument(
    100100            __FUNCTION__,
     
    402402    );
    403403
    404     if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {
     404    if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
    405405        _deprecated_argument(
    406406            __FUNCTION__,
     
    592592    );
    593593
    594     if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {
     594    if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
    595595        _deprecated_argument(
    596596            __FUNCTION__,
Note: See TracChangeset for help on using the changeset viewer.