rest_add_application_passwords_to_index

函数
rest_add_application_passwords_to_index ( $response )
参数
  • (WP_REST_Response) $response The index response object.
    Required:
返回值
  • (WP_REST_Response)
定义位置
相关方法
rest_application_password_collect_statusrest_application_password_check_errorswp_is_application_passwords_supportedwp_is_application_passwords_availablewp_validate_application_password
引入
5.6.0
弃用
-

rest_add_application_passwords_to_index: 该函数用于将应用程序的密码添加到REST API索引响应中。它用于允许开发人员为他们的应用程序创建和管理应用密码。

将应用密码信息添加到REST API索引中。

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

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 18:32:58

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: