wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



wp_is_application_passwords_available_for_user › WordPress Function

Depuis5.6.0
Dépréciéen/a
wp_is_application_passwords_available_for_user ( $user )
Paramètres:
  • (int|WP_User) $user The user to check.
    Requis: Oui
Retourne:
  • (bool)
Défini(e) dans:
Codex:

Checks if Application Passwords is available for a specific user.

By default all users can use Application Passwords. Use {@see 'wp_is_application_passwords_available_for_user'} to restrict availability to certain users.


Source

function wp_is_application_passwords_available_for_user( $user ) {
	if ( ! wp_is_application_passwords_available() ) {
		return false;
	}

	if ( ! is_object( $user ) ) {
		$user = get_userdata( $user );
	}

	if ( ! $user || ! $user->exists() ) {
		return false;
	}

	/**
	 * Filters whether Application Passwords is available for a specific user.
	 *
	 * @since 5.6.0
	 *
	 * @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 );
}