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