mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@53914 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -95,7 +95,7 @@ function get_option( $option, $default = false ) {
|
||||
'comment_whitelist' => 'comment_previously_approved',
|
||||
);
|
||||
|
||||
if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {
|
||||
if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'5.5.0',
|
||||
@@ -401,7 +401,7 @@ function update_option( $option, $value, $autoload = null ) {
|
||||
'comment_whitelist' => 'comment_previously_approved',
|
||||
);
|
||||
|
||||
if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {
|
||||
if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'5.5.0',
|
||||
@@ -591,7 +591,7 @@ function add_option( $option, $value = '', $deprecated = '', $autoload = 'yes' )
|
||||
'comment_whitelist' => 'comment_previously_approved',
|
||||
);
|
||||
|
||||
if ( ! wp_installing() && isset( $deprecated_keys[ $option ] ) ) {
|
||||
if ( isset( $deprecated_keys[ $option ] ) && ! wp_installing() ) {
|
||||
_deprecated_argument(
|
||||
__FUNCTION__,
|
||||
'5.5.0',
|
||||
|
||||
Reference in New Issue
Block a user