Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: delete_user

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

Line Code
416  * @return bool True when finished.
417  */
418 function wp_delete_user($id, $reassign = 'novalue') {
419      global $wpdb;
420
421      $id = (int) $id;
422      $user = new WP_User($id);
423
424      // allow for transaction statement
425      do_action('delete_user', $id);
426
427      if ($reassign == 'novalue') {
428           $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
429
430           if ($post_ids) {
431                foreach ($post_ids as $post_id)
432                     wp_delete_post($post_id);
433           }
434