Changeset 27466
- Timestamp:
- 03/08/2014 03:15:06 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r27463 r27466 269 269 * @return bool True when finished. 270 270 */ 271 function wp_delete_user( $id, $reassign = 'novalue') {271 function wp_delete_user( $id, $reassign = null ) { 272 272 global $wpdb; 273 273 … … 278 278 return false; 279 279 280 // Normalize $reassign to null or a user ID. 'novalue' was an older default. 281 if ( 'novalue' === $reassign ) { 282 $reassign = null; 283 } elseif ( null !== $reassign ) { 284 $reassign = (int) $reassign; 285 } 286 287 var_dump( $reassign ); 288 die; 289 280 290 /** 281 291 * Fires immediately before a user is deleted from the database. … … 283 293 * @since 2.0.0 284 294 * 285 * @param int $id ID of the user to delete. 286 * @param int|string $reassign ID of the user to reassign posts and links to. Default 'novalue'. 295 * @param int $id ID of the user to delete. 296 * @param int|null $reassign ID of the user to reassign posts and links to. 297 * Default null, for no reassignment. 287 298 */ 288 299 do_action( 'delete_user', $id, $reassign ); 289 300 290 if ( 'novalue' === $reassign ||null === $reassign ) {301 if ( null === $reassign ) { 291 302 $post_types_to_delete = array(); 292 303 foreach ( get_post_types( array(), 'objects' ) as $post_type ) { … … 322 333 } 323 334 } else { 324 $reassign = (int) $reassign;325 335 $post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id ) ); 326 336 $wpdb->update( $wpdb->posts, array('post_author' => $reassign), array('post_author' => $id) ); … … 355 365 * @since 2.9.0 356 366 * 357 * @param int $id ID of the deleted user. 358 * @param int|string $reassign ID of the user to reassign posts and links to. Default 'novalue'. 367 * @param int $id ID of the deleted user. 368 * @param int|null $reassign ID of the user to reassign posts and links to. 369 * Default null, for no reassignment. 359 370 */ 360 371 do_action( 'deleted_user', $id, $reassign );
Note: See TracChangeset
for help on using the changeset viewer.