rest_add_application_passwords_to_index()WP 5.6.0

Adds Application Passwords info to the REST API index.

Хуков нет.

Возвращает

WP_REST_Response.

Использование

rest_add_application_passwords_to_index( $response );
$response(WP_REST_Response) (обязательный)
The index response object.

Список изменений

С версии 5.6.0 Введена.

Код rest_add_application_passwords_to_index() WP 6.6.2

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;
}