Switch language

wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren




wp_get_comment_status [ WordPress Function ]

wp_get_comment_status ( $comment_id )
Parameter:
Gibt zurück:
  • (string|bool) Status might be 'trash', 'approved', 'unapproved', 'spam'. False on failure.
Definiert in:



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;
}
?>

Beispiele [ wp-snippets.com ]

Top Google Suchergebnisse

Mehr ...

Nutzerduskussionen [ wordpress.org ]

0 Nutzerkommentare

Noch keine. Sei der Erste!

Neu hinzufügen ...



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