Title: wp_is_application_passwords_available
Published: December 9, 2020
Last modified: February 24, 2026

---

# wp_is_application_passwords_available(): bool

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#description)
 * [Return](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#wp--skip-link--target)

Checks if Application Passwords is globally available.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#description)󠁿

By default, Application Passwords is available to all sites using SSL or to local
environments.
Use the [‘wp_is_application_passwords_available’](https://developer.wordpress.org/reference/hooks/wp_is_application_passwords_available/)
filter to adjust its availability.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#return)󠁿

 bool

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#source)󠁿

    ```php
    function wp_is_application_passwords_available() {
    	/**
    	 * Filters whether Application Passwords is available.
    	 *
    	 * @since 5.6.0
    	 *
    	 * @param bool $available True if available, false otherwise.
    	 */
    	return apply_filters( 'wp_is_application_passwords_available', wp_is_application_passwords_supported() );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/user.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/user.php#L5100)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/user.php#L5100-L5109)

## 󠀁[Hooks](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#hooks)󠁿

 [apply_filters( ‘wp_is_application_passwords_available’, bool $available )](https://developer.wordpress.org/reference/hooks/wp_is_application_passwords_available/)

Filters whether Application Passwords is available.

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_is_application_passwords_supported()](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_supported/)`wp-includes/user.php` |

Checks if Application Passwords is supported.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

| Used by | Description | 
| [WP_REST_Application_Passwords_Controller::get_user()](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_user/)`wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php` |

Gets the requested user.

  | 
| [wp_is_application_passwords_available_for_user()](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available_for_user/)`wp-includes/user.php` |

Checks if Application Passwords is available for a specific user.

  | 
| [wp_authenticate_application_password()](https://developer.wordpress.org/reference/functions/wp_authenticate_application_password/)`wp-includes/user.php` |

Authenticates the user using an application password.

  | 
| [wp_validate_application_password()](https://developer.wordpress.org/reference/functions/wp_validate_application_password/)`wp-includes/user.php` |

Validates the application password credentials passed via Basic Authentication.

  | 
| [rest_add_application_passwords_to_index()](https://developer.wordpress.org/reference/functions/rest_add_application_passwords_to_index/)`wp-includes/rest-api.php` |

Adds Application Passwords info to the REST API index.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.6.0](https://developer.wordpress.org/reference/since/5.6.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/?output_format=md#comment-content-6897)
 2.   [Jose Lazo](https://profiles.wordpress.org/jose-lazo/)  [  2 years ago  ](https://developer.wordpress.org/reference/functions/wp_is_application_passwords_available/#comment-6897)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_is_application_passwords_available%2F%23comment-6897)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_is_application_passwords_available%2F%23comment-6897)
 4. Make a custom permission callback to a custom endpoint.
 5.     ```php
        /**
         * A callback for checking the permission for the REST API.
         *
         * @param WP_REST_Request $request API request
         * @return true|WP_Error
         */
        function wpdocs_rest_permission_callback( $request ) {
        	if ( wp_is_application_passwords_available() ) {
        		$auth_header = $request->get_header( 'Authorization' );
    
        		if ( empty( $auth_header ) ) {
        			return new WP_Error( 'rest_forbidden', __( 'Authentication required. Application Password not found' ), array( 'status' => 401 ) );
        		}
    
        		$user_id = get_current_user_id(); // or get the user ID from the request data
        		$result  = wp_validate_application_password( $user_id );
    
        		if ( ! $result ) {
        			return new WP_Error( 'rest_forbidden', __( 'Authentication failed.' ), array( 'status' => 403 ) );
        		}
        	} elseif ( ! current_user_can( 'manage_options' ) ) {
        		return new WP_Error( 'rest_forbidden', __( 'Permission denied.' ), array( 'status' => 403 ) );
        	}
    
        	return true;
        }
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_is_application_passwords_available%2F%3Freplytocom%3D6897%23feedback-editor-6897)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_is_application_passwords_available%2F)
before being able to contribute a note or feedback.