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
339
340                     /**
341                      * Fires when an application password is deleted.
342                      *
343                      * @since 5.6.0
344                      *
345                      * @param int   $user_id The user ID.
346                      * @param array $item    The data about the application password.
347                      */
348                     do_action( 'wp_delete_application_password', $user_id, $item );
349
350                     return true;
351                }
352           }
353
354           return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
355      }
356
357      /**
 
Line Code
368           if ( $passwords ) {
369                $saved = static::set_user_application_passwords( $user_id, array() );
370
371                if ( ! $saved ) {
372                     return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) );
373                }
374
375                foreach ( $passwords as $item ) {
376                     /** This action is documented in wp-includes/class-wp-application-passwords.php */
377                     do_action( 'wp_delete_application_password', $user_id, $item );
378                }
379
380                return count( $passwords );
381           }
382
383           return 0;
384      }
385
386      /**