Wenn das Cookie nicht gesetzt ist, "weiss" WordPress in der Folgeseite nicht, wer der Kommentator war und daher auch nicht ob es den Kommentar (inklusive der "Ihr Kommentar wartet..." Meldung) anzeigen kann.
Damit WordPress also weiss, dass es was anzeigen soll, muss man dies der Folgeseite anderweitig mitteilen.
Eine mögliche Lösung ist ein sog. Filter im Link der zur Folgeseite führt, dort kann man was eigenes eintragen, je nach Situation. Dazu ein Check in der Folgeseite, ob im Link was eigenes eingetragen wurde, und die Ausgabe einer Meldung, z.B. so:
function b3317133_comment_post_redirect( $location ) {
if ( !isset( $_POST['wp-comment-cookies-consent'] ) ) {
$fragment = wp_parse_url( $location, PHP_URL_FRAGMENT ); // comment-XX
if ( !empty( $fragment ) ) {
if ( count( $parts = explode( '-', $fragment ) ) == 2 ) {
$location = add_query_arg( 'no-cookies-id', $parts[1], $location );
}
}
}
return $location;
}
add_filter( 'comment_post_redirect', 'b3317133_comment_post_redirect' );
function b3317133_comment_form_before() {
if ( isset( $_GET['no-cookies-id'] ) ) {
echo '<p id="comment-' . esc_attr( $_GET['no-cookies-id'] ) . '">Danke für den Kommentar, auch ohne Cookies...</p>';
}
}
add_action( 'comment_form_before', 'b3317133_comment_form_before' );
Alles anzeigen
Edit: Code noch etwas gekürzt, ein Parameter reicht...