WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
функция не описана

WP_Application_Passwords::delete_all_application_passwords() public WP 5.6.0

Deletes all application passwords for the given user.

{} Это метод класса: WP_Application_Passwords{}

Хуки из метода
Возвращает

int|WP_Error. The number of passwords that were deleted or a WP_Error on failure.

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

$result = WP_Application_Passwords::delete_all_application_passwords( $user_id );
$user_id(int) (обязательный)
User ID.

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

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

Код WP_Application_Passwords::delete_all_application_passwords() WP 5.8

<?php
public static function delete_all_application_passwords( $user_id ) {
	$passwords = static::get_user_application_passwords( $user_id );

	if ( $passwords ) {
		$saved = static::set_user_application_passwords( $user_id, array() );

		if ( ! $saved ) {
			return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) );
		}

		foreach ( $passwords as $item ) {
			/** This action is documented in wp-includes/class-wp-application-passwords.php */
			do_action( 'wp_delete_application_password', $user_id, $item );
		}

		return count( $passwords );
	}

	return 0;
}