How To Remove The “Click here to cancel reply” Link From The WordPress Comment Form

add_filter( ‘cancel_comment_reply_link’, ‘__return_false’ ); See /wp-includes/comment-template.php#function get_cancel_comment_reply_link() for more background. But if you do that the reply form will not move to the comment. The more interesting question is: Why doesn’t the link work for you? Do you have this line in your footer? is_singular() and get_option( ‘thread_comments’ ) and wp_print_scripts( ‘comment-reply’ );

One comment per user email per post

Try this, the code below will generate every comment by the $current_user->user_email for the author_email, if the $usercomment return something, then there is a comment by the current user so echo “thank you”, but if it’s not return anything output the form. global $current_user,$post; $usercomment = get_comments(array(‘author_email’ => $current_user->user_email, ‘post_id’ => $post->ID)); if($usercomment) { echo … Read more

Why are two functions over-riding each other?

It looks like you are overwriting the comment text with your commentimage_comment_text2 filter, try this to append the ratings text: add_filter( ‘comment_text’, ‘commentimage_comment_text2′ ); function commentimage_comment_text2( $comment ){ $rtt = “<br>Rating”; return $comment.$rtt; } ps: you forgot the $comment input parameter. Here is a poor man’s skematic picture of the filter flow in WordPress 😉 … Read more

How to add bubble count in WordPress wp_nav_menu menu?

For flexibility, you could assign the CSS bubblecount class to the corresponding menu item: and then target it with: if( in_array( ‘bubblecount’, (array) $item->classes ) ) $output .= ‘<span class=”unread”>’.my_function_here().'</span>’; in your code snippet above.

Get a variable field of all comments of current post

To get the comments use get_comments() and the current post’s ID. To get the URL fields only use wp_list_pluck(). To remove the empty fields use array_filter() without a callback. . $comment_urls = array (); $all_comments = get_comments( array ( ‘post_id’ => get_the_ID() ) ); if ( $all_comments ) { $comment_urls = array_filter( wp_list_pluck( $all_comments, ‘comment_author_url’ … Read more

where to modify get_comment_author_link()?

You would have to use the get_comment_author_link filter for this in the following manner. add_filter( “get_comment_author_link”, “wpse_63316_modifiy_comment_author_anchor” ); function wpse_63316_modifiy_comment_author_anchor( $author_link ){ return str_replace( “<a”, “<a target=”_blank””, $author_link ); }

Prevent Contributor to show comment list

Paste this code inside the functions.php file of your currently active theme. You can make it a plugin file too. It uses the “the_comments” filter to remove the unwanted comments from the backend table. /** * Filter out comments of other posts than current logged-in user. * * @param $all_comments all the comments to be … Read more

What should I hook to add extra fields to comments?

First you have to add your input fields to comment form. You can use these two hooks for that: comment_form_logged_in_after comment_form_after_fields Here’s how: function add_my_custom_field_to_comment_form() { ?> <p class=”comment-form-<FIELD_ID>”> <label for=”<FIELD_ID>”><?php _e( ‘Your <SOMETHING>’, ‘<TEXTDOMAIN>’ ); ?><span class=”required”>*</span>:</label> <input id=”<FIELD_ID>” name=”<FIELD_ID>” value=”” placeholder=”” /> </p> <?php } add_action( ‘comment_form_logged_in_after’, ‘add_my_custom_field_to_comment_form’ ); add_action( ‘comment_form_after_fields’, ‘add_my_custom_field_to_comment_form’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)