Use Yoda conditions. Props evansolomon. see #21270
git-svn-id: https://develop.svn.wordpress.org/trunk@21378 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
d69dda48ec
commit
43d668a041
@ -329,7 +329,7 @@ function get_blog_option( $id, $option, $default = false ) {
|
||||
if ( empty( $id ) )
|
||||
$id = get_current_blog_id();
|
||||
|
||||
if ( $id == get_current_blog_id() )
|
||||
if ( get_current_blog_id() == $id )
|
||||
return get_option( $option, $default );
|
||||
|
||||
switch_to_blog( $id );
|
||||
@ -364,7 +364,7 @@ function add_blog_option( $id, $option, $value ) {
|
||||
if ( empty( $id ) )
|
||||
$id = get_current_blog_id();
|
||||
|
||||
if ( $id == get_current_blog_id() )
|
||||
if ( get_current_blog_id() == $id )
|
||||
return add_option( $option, $value );
|
||||
|
||||
switch_to_blog( $id );
|
||||
@ -389,7 +389,7 @@ function delete_blog_option( $id, $option ) {
|
||||
if ( empty( $id ) )
|
||||
$id = get_current_blog_id();
|
||||
|
||||
if ( $id == get_current_blog_id() )
|
||||
if ( get_current_blog_id() == $id )
|
||||
return delete_option( $option );
|
||||
|
||||
switch_to_blog( $id );
|
||||
@ -415,7 +415,7 @@ function update_blog_option( $id, $option, $value, $deprecated = null ) {
|
||||
if ( null !== $deprecated )
|
||||
_deprecated_argument( __FUNCTION__, '3.1' );
|
||||
|
||||
if ( $id == get_current_blog_id() )
|
||||
if ( get_current_blog_id() == $id )
|
||||
return update_option( $option, $value );
|
||||
|
||||
switch_to_blog( $id );
|
||||
|
Loading…
Reference in New Issue
Block a user