wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_comment_status › WordPress Function
Seit1.0.0
Veraltetn/v
› wp_get_comment_status ( $comment_id )
| Parameter: |
|
| Gibt zurück: |
|
| Definiert in: |
|
| Codex: |
Retrieves the status of a comment by comment ID.
Ähnliche Funktionen: wp_set_comment_status, get_comment_statuses, wp_transition_comment_status, get_default_comment_status, get_comment_meta
Quellcode
function wp_get_comment_status( $comment_id ) {
$comment = get_comment( $comment_id );
if ( ! $comment ) {
return false;
}
$approved = $comment->comment_approved;
if ( null === $approved ) {
return false;
} elseif ( '1' === $approved ) {
return 'approved';
} elseif ( '0' === $approved ) {
return 'unapproved';
} elseif ( 'spam' === $approved ) {
return 'spam';
} elseif ( 'trash' === $approved ) {
return 'trash';
} else {
return false;
}
}