Answer the question
In order to leave comments, you need to log in
Why is the exit function not working?
Good afternoon. I'm trying to add an exit button to the comment add form. Added to function.php
function wph_change_submit_label($defaults) {
$text_out = mb_convert_encoding('Выйти', 'utf-8', 'cp-1251');
$defaults['title_reply'] =
'<p><h3 id="reply-title" class="comment-reply-title"><a href="' . sprintf( wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) )). '" title=' . sprintf( $text_out). '>' . sprintf( $text_out). '</a></h3></p>';
return $defaults;
}
add_filter('comment_form_defaults', 'wph_change_submit_label');
Answer the question
In order to leave comments, you need to log in
Hello!
Most likely, there is an error in the synth code, because of which the_permalink link is simply displayed.
Try this code to exit and redirect to Home
Or this one to exit and further redirect to the current page
https://wp-kama.ru/function/wp_logout_url
Also a useful resource - https://wordpress.stackexchange.com/questions/7793...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question