The task is to move the block "Cancel reply" to the end of the form, to the submit level. Is it possible to use the comment_form_fields filter for this purpose? Such a redefinition does not work (source on wp-kama.ru). Used in functions.php and comments.php (before default comment_form).
add_filter('comment_form_fields', 'reorder_comment_fields' ); function reorder_comment_fields($fields){ $new_fields = array(); // поля в новом порядке $myorder = ['author', 'email', 'url', 'comment', 'cancel_reply_before', 'cancel_reply_link', 'cancel_reply_after', 'submit_button', 'submit_field']; // нужный порядок foreach($myorder as $key){ $new_fields[$key] = $fields[ $key ]; unset( $fields[$key] ); } // если остались еще какие-то поля добавим их в конец if( $fields ) foreach( $fields as $key => $val ) $new_fields[ $key ] = $val; return $new_fields; }