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’ );

Add a drop down list to comment form?

Filter comment_form_field_comment to add a select element with a label. Add a callback to the action comment_post to save the value. Filter comment_text to show the value for a comment. Sample code: add_filter( ‘comment_form_field_comment’, function( $field ) { global $wp_roles; $user = wp_get_current_user(); $select=”<p><label for=”roleselect”>Your role:</label> <select name=”prefix_role” id=”roleselect”> <option value=””>Select a role</option>”; foreach ( … Read more

How to change the order of the comment_form fields with css?

You could use flexbox instead of table if wanting to do this with css. Flexbox lets you order elements easily: #commentform { display: flex; flex-flow: column; } .comment-form-comment { order: 1; } .comment-form-url { order: 2; } .comment-form-email{ order: 3; } .comment-form-author{ order: 4; } .form-submit{ order: 5; } Here’s an example: http://codepen.io/candid/pen/NxKJyW/

Display comments on a comment page without form

Use get_comments() and pass the post ID as parameter. Then print the result as regular list. From a plugin I have published recently: function t5_list_comments( $atts, $content=”” ) { ” !== $content && $content = wpautop( do_shortcode( $content ) ); if ( ! isset ( $atts[‘post_id’] ) ) return ‘Please pass an argument for “post_id”‘; … Read more

Am I using the right hook for removing quicktags on the admin TinyMCE?

After checking out the code, the best way to do this would be to use the wp_editor_settings filter in /wp-includes/class-wp-editor.php. When you call wp_editor() it internally makes a call to _WP_Editors::editor($content, $editor_id, $settings);. This function first passes the $settings array through parse_settings() which uses that filter. add_filter( ‘wp_editor_settings’, ‘remove_editor_quicktags’, 10, 2 ); function remove_editor_quicktags( $settings, … Read more

Add comments meta fields to comments metabox on post edit screen

Unfortunately the hooks: manage_{$this->screen->id}_columns manage_{$this->screen->id}_sortable_columns manage_comments_custom_column are not available for the post-comments list table, constructed within the wp_ajax_get-comments call. That table consists only of two columns: author and comment. The data for author, avatar, email, url and IP is displayed in the first column. We can on the other hand use a hack like: add_filter( … Read more

comment_form() generates the wrong action url

By default WordPress organizes the comment pages from oldest to newest. This does not change, even if the Settings-Discussion options have been modified. This is the sticking point, one might suspect changing these settings to reorganize the comment pages, it doesn’t. These settings, basically, define comment order in the default comment loop, and what page … Read more