rest_add_application_passwords_to_index( WP_REST_Response $response ): WP_REST_Response

In this article

Adds Application Passwords info to the REST API index.

Parameters

$responseWP_REST_Responserequired
The index response object.

Return

WP_REST_Response

Source

function rest_add_application_passwords_to_index( $response ) {
	if ( ! wp_is_application_passwords_available() ) {
		return $response;
	}

	$response->data['authentication']['application-passwords'] = array(
		'endpoints' => array(
			'authorization' => admin_url( 'authorize-application.php' ),
		),
	);

	return $response;
}

Changelog

VersionDescription
5.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.