wp_trash_post [ WordPress Function ]
wp_trash_post ( $post_id = 0 )
| Parameters: |
|
| Uses: | |
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: wp_untrash_post, wp_ajax_trash_post, wp_ajax_untrash_post, wp_trash_comment, wp_trash_post_comments
Moves a post or page to the Trash
If trash is disabled, the post or page is permanently deleted.
Source
<?php
function wp_trash_post($post_id = 0) {
if ( !EMPTY_TRASH_DAYS )
return wp_delete_post($post_id, true);
if ( !$post = wp_get_single_post($post_id, ARRAY_A) )
return $post;
if ( $post['post_status'] == 'trash' )
return false;
do_action('wp_trash_post', $post_id);
add_post_meta($post_id,'_wp_trash_meta_status', $post['post_status']);
add_post_meta($post_id,'_wp_trash_meta_time', time());
$post['post_status'] = 'trash';
wp_insert_post($post);
wp_trash_post_comments($post_id);
do_action('trashed_post', $post_id);
return $post;
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/wp delete post « WordPress Codex
wp_delete_post() automatically reverts to wp_trash_post() if $force_delete is false, the post_type of $postid is page or post, $postid is not already in the trash ...
codex.wordpress.org - WordPress › Support » wp_delete_post / wp_trash_post
I have a couple of questions regarding wp_delete_post based on some behavior I'm seeing in developing a plugin. After validating that I have a valid document ...
wordpress.org - wp_trash_post Wordpress hook details -- Adam Brown, BYU ...
WordPress version history for wp_trash_post ... We find related hooks using word stems. wp_trash_post has 2 significant word stem(s): trash , post . Note that ...
adambrown.info - wordpress plugin - wp_trash_post() hook with remove_action ...
Apr 24, 2012 ... This function does not replace the WordPress core wp_trash_post() function. Any one can help me to replace original wp_trash_post function ...
stackoverflow.com