wppaste
WordPress

WP_Application_Passwords

Source
wp-includes/class-wp-application-passwords.php:14
Class for displaying, modifying, and sanitizing application passwords.

Hooks fired · 4

Every hook that fires from inside WP_Application_Passwords, in the order it appears in the class, grouped by the method that fires it.

Methods · 11

Source

#[AllowDynamicProperties]class WP_Application_Passwords { 	/**	 * The application passwords user meta key.	 *	 * @since 5.6.0	 *	 * @var string	 */	const USERMETA_KEY_APPLICATION_PASSWORDS = '_application_passwords'; 	/**	 * The option name used to store whether application passwords are in use.	 *	 * @since 5.6.0	 *	 * @var string	 */	const OPTION_KEY_IN_USE = 'using_application_passwords'; 	/**	 * The generated application password length.	 *	 * @since 5.6.0	 *	 * @var int	 */	const PW_LENGTH = 24; 	/**	 * Checks if application passwords are being used by the site.	 *	 * This returns true if at least one application password has ever been created.	 *	 * @since 5.6.0	 *	 * @return bool	 */	public static function is_in_use() {		$network_id = get_main_network_id();		return (bool) get_network_option( $network_id, self::OPTION_KEY_IN_USE );	} 	/**	 * Creates a new application password.	 *	 * @since 5.6.0	 * @since 5.7.0 Returns WP_Error if application name already exists.	 *	 * @param int   $user_id  User ID.	 * @param array $args     {	 *     Arguments used to create the application password.	 *	 *     @type string $name   The name of the application password.	 *     @type string $app_id A UUID provided by the application to uniquely identify it.	 * }	 * @return array|WP_Error {	 *     Application password details, or a WP_Error instance if an error occurs.	 *	 *     @type string $0 The generated application password in plain text.	 *     @type array  $1 {	 *         The details about the created password.	 *	 *         @type string $uuid      The unique identifier for the application password.	 *         @type string $app_id    A UUID provided by the application to uniquely identify it.	 *         @type string $name      The name of the application password.	 *         @type string $password  A one-way hash of the password.	 *         @type int    $created   Unix timestamp of when the password was created.	 *         @type null   $last_used Null.	 *         @type null   $last_ip   Null.	 *     }	 * }	 */	public static function create_new_application_password( $user_id, $args = array() ) {		if ( ! empty( $args['name'] ) ) {			$args['name'] = sanitize_text_field( $args['name'] );		} 		if ( empty( $args['name'] ) ) {

History

2 changes between 6.7.7 and 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.8.8
Method hash_password() added.verified against source
6.8.8
Method check_password() added.verified against source

About this page

Parsed data
Generated from the wordpress-develop 6.7.7 tag, from src/wp-includes/class-wp-application-passwords.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.