Comments form custom fields order

Demo – Setup Here’s a demo how we could control the display of comment fields and their order: Let’s create a custom class: $mycf = new MyCommentFields; Then we define our extra fields: $myfields = []; $myfields[‘myaddress’] = sprintf( ‘<p class=”comment-form-myaddress”> <label for=”myaddress”>%s <span class=”required”>*</span></label> <input id=”myaddress” name=”myaddress” type=”text” size=”30″ tabindex=”5″ /> </p>’, esc_html__( ‘Address’, … Read more

Change the tag of the comment submit button

You should be able to change the HTML structure for the comment form’s submit, with the comment_form_defaults filter. Here’s an untested example: add_filter( ‘comment_form_defaults’, function( $defaults ) { // Edit this to your needs: $button = ‘<input name=”%1$s” type=”submit” id=”%2$s” class=”%3$s” value=”%4$s” />’; // Override the default submit button: $defaults[‘submit_button’] = $button; return $defaults; } … Read more

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/

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

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