Switch language

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




wp_get_comment_status [ WordPress Function ]

wp_get_comment_status ( $comment_id )
Parameters:
Returns:
  • (string|bool) Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
Defined at:



The status of a comment by ID.

Source


<?php
function wp_get_comment_status($comment_id) {
    
$comment get_comment($comment_id);
    if ( !
$comment )
        return 
false;

    
$approved $comment->comment_approved;

    if ( 
$approved == null )
        return 
false;
    elseif ( 
$approved == '1' )
        return 
'approved';
    elseif ( 
$approved == '0' )
        return 
'unapproved';
    elseif ( 
$approved == 'spam' )
        return 
'spam';
    elseif ( 
$approved == 'trash' )
        return 
'trash';
    else
        return 
false;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



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