Passing arguments to wp_list_comments callback function

Finally I figured it out. you may simply add your arguments to the wp_list_comments as associative key => value pairs like this: $args = array( ‘callback’ => ‘my_callback’, ‘avatar_size’ => 48, ‘type’ => ‘comment’, ‘arg1’ => $arg1 ); wp_list_comments( $args ); and then in your my_callback you have: function my_callback( $comment, $args, $depth ) where … Read more

Why does comment_reply_link launch the reply form at the wrong spot on the comment section?

Because that’s done in javascript, and you have to enqueue that javascript for it to work, as stated in the docs: If JavaScript is enabled and the comment-reply.js JavaScript is loaded the link moves the comment form to just below the comment. https://codex.wordpress.org/Function_Reference/comment_reply_link e.g. function wpse289875_enqueue_comments_reply() { if ( is_singular() && get_option( ‘thread_comments’ ) ) … Read more

Comment Walker vs. Comment Callback

We could rewrite: wp_list_comments( array( ‘callback’ => ‘bootstrap_comment_callback’, )); with the null walker parameter: wp_list_comments( array( ‘walker’ => null, ‘callback’ => ‘bootstrap_comment_callback’, )); which means we are using the default Walker_Comment class: wp_list_comments( array( ‘walker’ => new Walker_Comment, ‘callback’ => ‘bootstrap_comment_callback’, )); The Walker_Comment::start_el() method is just a wrapper for one of these protected methods: … Read more

How to wrap submit button of comment form with div

We can use comment_form function’s submit_button parameter to change submit button HTML. Default HTML for submit_button is <input name=”%1$s” type=”submit” id=”%2$s” class=”%3$s” value=”%4$s” /> You can change your code like this. $comments_args = array( …. ‘submit_button’ => ‘<div class=”form-group”> <input name=”%1$s” type=”submit” id=”%2$s” class=”%3$s” value=”%4$s” /> </div>’ …. ); Update: Regarding %1$s , %2$s and … Read more

deneme bonusu veren sitelerbahis siteleripulibet girişdeneme bonusutürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişholiganbetholiganbet girişholiganbet güncel girişnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnews