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
269  * @param int $reassign Optional. Reassign posts and links to new User ID.
270  * @return bool True when finished.
271  */
272 function wp_delete_user( $id, $reassign = 'novalue' ) {
273      global $wpdb;
274
275      $id = (int) $id;
276
277      // allow for transaction statement
278      do_action('delete_user', $id);
279
280      if ( 'novalue' === $reassign || null === $reassign ) {
281           $post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );
282
283           if ( $post_ids ) {
284                foreach ( $post_ids as $post_id )
285                     wp_delete_post($post_id);
286           }
287