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

WP_Application_Passwords::delete_application_password() public WP 5.6.0

Deletes an application password.

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

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

true|WP_Error. Whether the password was successfully found and deleted, a WP_Error otherwise.

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

$result = WP_Application_Passwords::delete_application_password( $user_id, $uuid );
$user_id(int) (обязательный)
User ID.
$uuid(строка) (обязательный)
The password's uuid.

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

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

Код WP_Application_Passwords::delete_application_password() WP 5.8

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

	foreach ( $passwords as $key => $item ) {
		if ( $item['uuid'] === $uuid ) {
			unset( $passwords[ $key ] );
			$saved = static::set_user_application_passwords( $user_id, $passwords );

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

			/**
			 * Fires when an application password is deleted.
			 *
			 * @since 5.6.0
			 *
			 * @param int   $user_id The user ID.
			 * @param array $item    The data about the application password.
			 */
			do_action( 'wp_delete_application_password', $user_id, $item );

			return true;
		}
	}

	return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
}