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
307
308                     /**
309                      * Fires when an application password is deleted.
310                      *
311                      * @since 5.6.0
312                      *
313                      * @param int   $user_id The user ID.
314                      * @param array $item    The data about the application password.
315                      */
316                     do_action( 'wp_delete_application_password', $user_id, $item );
317
318                     return true;
319                }
320           }
321
322           return new WP_Error( 'application_password_not_found', __( 'Could not find an application password with that id.' ) );
323      }
324
325      /**
 
Line Code
336           if ( $passwords ) {
337                $saved = static::set_user_application_passwords( $user_id, array() );
338
339                if ( ! $saved ) {
340                     return new WP_Error( 'db_error', __( 'Could not delete application passwords.' ) );
341                }
342
343                foreach ( $passwords as $item ) {
344                     /** This action is documented in wp-includes/class-wp-application-passwords.php */
345                     do_action( 'wp_delete_application_password', $user_id, $item );
346                }
347
348                return count( $passwords );
349           }
350
351           return 0;
352      }
353
354      /**