How can I remove the title “leave a reply” in the comment box in twentyeleven?

You can filter the default comment_form arguments (which is what’s causing the “leave a reply”). Just drop this in functions.php or in a plugin file. It would probably be better to put it in a plugin and keep your twenty eleven theme unedited (read: easily updated). <?php add_filter( ‘comment_form_defaults’, ‘wpse33039_form_defaults’ ); function wpse33039_form_defaults( $defaults ) … Read more

Is it possible to show custom comment metadata in the admin panel?

To show the content on individual edit pages you need to add custom meta boxes to the comment edit page. You’ll use the key comment for the $page argument of add_meta_box. <?php add_action( ‘add_meta_boxes_comment’, ‘pmg_comment_tut_add_meta_box’ ); function pmg_comment_tut_add_meta_box() { add_meta_box( ‘pmg-comment-title’, __( ‘Comment Title’ ), ‘pmg_comment_tut_meta_box_cb’, ‘comment’, ‘normal’, ‘high’ ); } function pmg_comment_tut_meta_box_cb( $comment ) … Read more

Disable wordpress comments API

There is much easier way to close standard WordPress comments. Just add add_filter( ‘comments_open’, ‘__return_false’ ); to your functions.php file and comments will be closed.

Why are default comments deprecated?

You shouldn’t copy that file, precisely because it is too bulky. About half of it is implementation of submission form, which was entirely replaced with comment_form() function around that time. So the answer why was it deprecated is roughly: Newer code is more compact Markup belongs in theme For better and more relevant comments.php example … Read more

Comment form validation

Comments processing is done in the file: wp-comments-post.php. You can use the hook pre_comment_on_post to validate the values entered in the comment form fields. function custom_validate_comment_url() { if( !empty( $_POST[‘url’] ) && !preg_match( ‘\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|]’, $_POST[‘url’] ) // do you url validation here (I am not a regex expert) wp_die( __(‘Error: please enter a valid url … Read more

How to remove commenters ability to add hyperlinks to comments?

WP runs so many prettifying filters on this stuff that it’s easy to get lost. Here is what I ended up with: remove_filter(‘comment_text’, ‘make_clickable’, 9); add_filter(‘pre_comment_content’, ‘strip_comment_links’); function strip_comment_links($content) { global $allowedtags; $tags = $allowedtags; unset($tags[‘a’]); $content = addslashes(wp_kses(stripslashes($content), $tags)); return $content; } This scrubs out clearly defined links and removes filter that turns plain … Read more

How to add editor-style.css styling to wp_editor on front end for comments

Actually you can include the editor-style.css (or any other stylesheet), just pass a “content_css” value to tinymce that points to a css file: wp_editor( $content, ‘editablecontent’, array( ‘tinymce’ => array( ‘content_css’ => get_stylesheet_directory_uri() . ‘/editor-styles.css’ ) ); So the original posters code would look like: add_filter( ‘comment_form_defaults’, ‘custom_comment_form_defaults’ ); function custom_comment_form_defaults( $args ) { if … Read more

Hook/Filter before and after comments

do_action( ‘comment_form_before’ ); is called on line 1553 of /wp-includes/comment-template.php, right before the output of the comment form, that should handle that one for you. I’ll update this if I can find the hook before the comments. edit It seems like you might be able to modify Walker_Comment (found in the same file as above) … Read more

Where to remove from comment’s feed?

Things added by WordPress core can not be deleted or removed, or better said, shouldn’t be modified directly. Instead, you can use any of the actions and filters. Specifically, to disable comments feeds, you can use this (note the priority parameter): remove_action( ‘wp_head’, ‘feed_links’, 2 ); The above code will remove also other posts feed … Read more

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