Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -1071,12 +1071,15 @@ class WP_User_Query {
|
||||
if ( isset( $args['blog_id'] ) ) {
|
||||
$blog_id = absint( $args['blog_id'] );
|
||||
}
|
||||
if ( ( $args['has_published_posts'] && $blog_id ) || in_array( 'post_count', $ordersby, true ) ) {
|
||||
$switch = get_current_blog_id() !== $blog_id;
|
||||
|
||||
if ( $args['has_published_posts'] || in_array( 'post_count', $ordersby, true ) ) {
|
||||
$switch = $blog_id && get_current_blog_id() !== $blog_id;
|
||||
if ( $switch ) {
|
||||
switch_to_blog( $blog_id );
|
||||
}
|
||||
|
||||
$last_changed .= wp_cache_get_last_changed( 'posts' );
|
||||
|
||||
if ( $switch ) {
|
||||
restore_current_blog();
|
||||
}
|
||||
@@ -1109,6 +1112,7 @@ class WP_User_Query {
|
||||
* Makes private properties readable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Getting a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to get.
|
||||
* @return mixed Property.
|
||||
@@ -1117,27 +1121,44 @@ class WP_User_Query {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return $this->$name;
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"The property `{$name}` is not declared. Getting a dynamic property is " .
|
||||
'deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes private properties settable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Setting a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to check if set.
|
||||
* @param mixed $value Property value.
|
||||
* @return mixed Newly-set property.
|
||||
*/
|
||||
public function __set( $name, $value ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return $this->$name = $value;
|
||||
$this->$name = $value;
|
||||
return;
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"The property `{$name}` is not declared. Setting a dynamic property is " .
|
||||
'deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes private properties checkable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Checking a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to check if set.
|
||||
* @return bool Whether the property is set.
|
||||
@@ -1146,19 +1167,36 @@ class WP_User_Query {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
return isset( $this->$name );
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
|
||||
'is deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes private properties un-settable for backward compatibility.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 6.4.0 Unsetting a dynamic property is deprecated.
|
||||
*
|
||||
* @param string $name Property to unset.
|
||||
*/
|
||||
public function __unset( $name ) {
|
||||
if ( in_array( $name, $this->compat_fields, true ) ) {
|
||||
unset( $this->$name );
|
||||
return;
|
||||
}
|
||||
|
||||
wp_trigger_error(
|
||||
__METHOD__,
|
||||
"A property `{$name}` is not declared. Unsetting a dynamic property is " .
|
||||
'deprecated since version 6.4.0! Instead, declare the property on the class.',
|
||||
E_USER_DEPRECATED
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user