Title: WP_REST_Application_Passwords_Controller::get_items
Published: December 9, 2020
Last modified: May 20, 2026

---

# WP_REST_Application_Passwords_Controller::get_items( WP_REST_Request $request ): 󠀁[WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)󠁿|󠀁[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)󠁿

## In this article

 * [Parameters](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#changelog)

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

Retrieves a collection of application passwords.

## 󠀁[Parameters](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#parameters)󠁿

 `$request`[WP_REST_Request](https://developer.wordpress.org/reference/classes/wp_rest_request/)
required

Full details about the request.

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

 [WP_REST_Response](https://developer.wordpress.org/reference/classes/wp_rest_response/)
|[WP_Error](https://developer.wordpress.org/reference/classes/wp_error/) Response
object on success, or [WP_Error](https://developer.wordpress.org/reference/classes/wp_error/)
object on failure.

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

    ```php
    public function get_items( $request ) {
    	$user = $this->get_user( $request );

    	if ( is_wp_error( $user ) ) {
    		return $user;
    	}

    	$passwords = WP_Application_Passwords::get_user_application_passwords( $user->ID );
    	$response  = array();

    	foreach ( $passwords as $password ) {
    		$response[] = $this->prepare_response_for_collection(
    			$this->prepare_item_for_response( $password, $request )
    		);
    	}

    	return new WP_REST_Response( $response );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php#L138)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php#L138-L155)

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

| Uses | 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_REST_Application_Passwords_Controller::prepare_item_for_response()](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/prepare_item_for_response/)`wp-includes/rest-api/endpoints/class-wp-rest-application-passwords-controller.php` |

Prepares the application password for the REST response.

  | 
| [WP_Application_Passwords::get_user_application_passwords()](https://developer.wordpress.org/reference/classes/wp_application_passwords/get_user_application_passwords/)`wp-includes/class-wp-application-passwords.php` |

Gets a user’s application passwords.

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

Checks whether the given variable is a WordPress Error.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_rest_application_passwords_controller/get_items/?output_format=md#)

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

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

## User Contributed Notes

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