Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




wp_trash_comment [ WordPress Function ]

wp_trash_comment ( $comment_id )
Parameters:
Uses:
Returns:
  • (mixed) False on failure
Defined at:



Moves a comment to the Trash

If trash is disabled, comment is permanently deleted.

Source


<?php
function wp_trash_comment($comment_id) {
    if ( !
EMPTY_TRASH_DAYS )
        return 
wp_delete_comment($comment_idtrue);

    if ( !
$comment get_comment($comment_id) )
        return 
false;

    
do_action('trash_comment'$comment_id);

    if ( 
wp_set_comment_status($comment_id'trash') ) {
        
add_comment_meta($comment_id'_wp_trash_meta_status'$comment->comment_approved);
        
add_comment_meta($comment_id'_wp_trash_meta_time'time() );
        
do_action('trashed_comment'$comment_id);
        return 
true;
    }

    return 
false;
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics