Changeset 13995 for trunk/wp-includes/post.php
- Timestamp:
- 04/04/2010 12:20:19 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r13985 r13995 1593 1593 1594 1594 /** 1595 * Removes a post, attachment,or page.1596 * 1597 * When the post and page goes, everything that is tied to it is deleted also.1595 * Trashes or deletes a post or page. 1596 * 1597 * When the post and page is permanently deleted, everything that is tied to it is deleted also. 1598 1598 * This includes comments, post meta fields, and terms associated with the post. 1599 * 1600 * The post or page is moved to trash instead of permanently deleted unless trash is 1601 * disabled, item is already in the trash, or $force_delete is true. 1599 1602 * 1600 1603 * @since 1.0.0 … … 1602 1605 * @uses do_action() on 'deleted_post' after deletion unless post type is 'attachment'. 1603 1606 * @uses wp_delete_attachment() if post type is 'attachment'. 1607 * @uses wp_trash_post() if item should be trashed. 1604 1608 * 1605 1609 * @param int $postid Post ID. 1606 * @param bool $force_delete Whether to bypass trash and force deletion 1610 * @param bool $force_delete Whether to bypass trash and force deletion. Defaults to false. 1607 1611 * @return mixed False on failure 1608 1612 */ … … 1613 1617 return $post; 1614 1618 1615 if ( !$force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS > 0)1619 if ( !$force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS ) 1616 1620 return wp_trash_post($postid); 1617 1621 … … 1699 1703 * Moves a post or page to the Trash 1700 1704 * 1705 * If trash is disabled, the post or page is permanently deleted. 1706 * 1701 1707 * @since 2.9.0 1702 1708 * @uses do_action() on 'trash_post' before trashing 1703 1709 * @uses do_action() on 'trashed_post' after trashing 1710 * @uses wp_delete_post() if trash is disabled 1704 1711 * 1705 1712 * @param int $postid Post ID. … … 1707 1714 */ 1708 1715 function wp_trash_post($post_id = 0) { 1709 if ( EMPTY_TRASH_DAYS == 0)1710 return wp_delete_post($post_id );1716 if ( !EMPTY_TRASH_DAYS ) 1717 return wp_delete_post($post_id, true); 1711 1718 1712 1719 if ( !$post = wp_get_single_post($post_id, ARRAY_A) ) … … 3297 3304 3298 3305 /** 3299 * Delete an attachment. 3300 * 3301 * Will remove the file also, when the attachment is removed. Removes all post 3302 * meta fields, taxonomy, comments, etc associated with the attachment (except 3303 * the main post). 3306 * Trashes or deletes an attachment. 3307 * 3308 * When an attachment is permanently deleted, the file will also be removed. 3309 * Deletion removes all post meta fields, taxonomy, comments, etc. associated 3310 * with the attachment (except the main post). 3311 * 3312 * The attachment is moved to the trash instead of permanently deleted unless trash 3313 * for media is disabled, item is already in the trash, or $force_delete is true. 3304 3314 * 3305 3315 * @since 2.0.0 … … 3308 3318 * 3309 3319 * @param int $postid Attachment ID. 3310 * @param bool $force_delete Whether to bypass trash and force deletion 3320 * @param bool $force_delete Whether to bypass trash and force deletion. Defaults to false. 3311 3321 * @return mixed False on failure. Post data on success. 3312 3322 */
Note: See TracChangeset
for help on using the changeset viewer.