Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: wp_delete_application_password

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
385
386                     /**
387                      * Fires when an application password is deleted.
388                      *
389                      * @since 5.6.0
390                      *
391                      * @param int   $user_id The user ID.
392                      * @param array $item    The data about the application password.
393                      */
394                     do_action( 'wp_delete_application_password', $user_id, $item );
395
396                     return true;
397                }
398           }
399
400           return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
401      }
402
403      /**
 
Line Code
414           if ( $passwords ) {
415                $saved = static::set_user_application_passwords( $user_id, array() );
416
417                if ( ! $saved ) {
418                     return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) );
419                }
420
421                foreach ( $passwords as $item ) {
422                     /** This action is documented in wp-includes/class-wp-application-passwords.php */
423                     do_action( 'wp_delete_application_password', $user_id, $item );
424                }
425
426                return count( $passwords );
427           }
428
429           return 0;
430      }
431
432      /**