: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* By default all users can use Application Passwords. Use {@see 'wp_is_application_passwords_available_for_user'}
* to restrict availability to certain users.
* @param int|WP_User $user The user to check.
function wp_is_application_passwords_available_for_user( $user ) {
if ( ! wp_is_application_passwords_available() ) {
if ( ! is_object( $user ) ) {
$user = get_userdata( $user );
if ( ! $user || ! $user->exists() ) {
* Filters whether Application Passwords is available for a specific user.
* @param bool $available True if available, false otherwise.
* @param WP_User $user The user to check.
return apply_filters( 'wp_is_application_passwords_available_for_user', true, $user );
* Registers the user meta property for persisted preferences.
* This property is used to store user preferences across page reloads and is
* currently used by the block editor for preferences like 'fullscreenMode' and
* @global wpdb $wpdb WordPress database abstraction object.
function wp_register_persisted_preferences_meta() {
* Create a meta key that incorporates the blog prefix so that each site
* on a multisite can have distinct user preferences.
$meta_key = $wpdb->get_blog_prefix() . 'persisted_preferences';
'name' => 'persisted_preferences',
'context' => array( 'edit' ),
'description' => __( 'The date and time the preferences were updated.' ),
'additionalProperties' => true,
* Sets the last changed time for the 'users' cache group.
function wp_cache_set_users_last_changed() {
wp_cache_set_last_changed( 'users' );
* Checks if password reset is allowed for a specific user.
* @param int|WP_User $user The user to check.
* @return bool|WP_Error True if allowed, false or WP_Error otherwise.
function wp_is_password_reset_allowed_for_user( $user ) {
if ( ! is_object( $user ) ) {
$user = get_userdata( $user );
if ( ! $user || ! $user->exists() ) {
if ( is_multisite() && is_user_spammy( $user ) ) {
* Filters whether to allow a password to be reset.
* @param bool $allow Whether to allow the password to be reset. Default true.
* @param int $user_id The ID of the user attempting to reset a password.
return apply_filters( 'allow_password_reset', $allow, $user->ID );