How should I get the original comment while processing the reply

The comment/reply ID is a value actually sent by the form. You are able to retrieve it via $_GET: // Default is “no reply” eq. 0 $id = 0; // Handle replies if ( isset( $_GET[‘replytocom’] ) ) { $id = filter_var( $_GET[‘replytocom’], FILTER_VALIDATE_INT, # or: # FILTER_SANITIZE_NUMBER_INT array( ‘options’ => array( ‘min_range’ => 1, … Read more

Which filter/hook to use for styling comments?

the comments_form function that outputs the contact form has two actions that could be used to accomplish what you want. add_action( ‘comment_form_before’, ‘wwm_comment_form_before’ ); function wwm_comment_form_before() { //output your opening html here } add_action( ‘comment_form_after’, ‘wwm_comment_form_after’ ); function wwm_comment_form_after() { //output your closing html here } and that’s a wrap 🙂

How to get comment id in callback function?

The callback is already passed arguments but crazily the codex doesn’t document them. However it does give you an example and the first two lines are: function mytheme_comment($comment, $args, $depth) { $GLOBALS[‘comment’] = $comment; which matches the equivalent functions in the bundled styles. Once you’ve set the comment object passed as the global as in … Read more

Display attachment, post and page in recent comments widget

It does seem that you are already using a custom function that you found from this site. You should credit the original author of that code. The widget_comments_args filter was introduced in WordPress3.4. This filter is poorly documented. This filter uses get_comments(), so you can also use the same parameters. Here is the filter in … Read more

how get comments only on post of current logged in user?

Using the @shanebp ideas of using get_comments: $args = array( ‘post_author’ => get_current_user_id(), // It will use the current logged in use to grab the comments ); $comments = get_comments( $args ); // Referer to http://codex.wordpress.org/Function_Reference/wp_list_comments $list_args = array( ‘reverse_top_level’ => false // Show the latest comments at the top of the list ); wp_list_comments( … Read more