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
409  * @return bool True when finished.
410  */
411 function wp_delete_user($id, $reassign = 'novalue') {
412      global $wpdb;
413
414      $id = (int) $id;
415      $user = new WP_User($id);
416
417      // allow for transaction statement
418      do_action('delete_user', $id);
419
420      if ($reassign == 'novalue') {
421           $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
422
423           if ($post_ids) {
424                foreach ($post_ids as $post_id)
425                     wp_delete_post($post_id);
426           }
427