public function commentsFieldsOrderSetting($fields)
    {
        add_filter('comment_form_fields', function ($comment_fields) use ($fields) {
            $new_fields = [];

            // Iterate on fields
            foreach ($fields as $field) {
                if (!isset($comment_fields[$field])) {
                    continue;
                }

                $new_fields[$field] = $comment_fields[$field];
            }

            return $new_fields;
        });
    }
public function commentsFieldsOrderSetting($fields)
    {
        add_filter('comment_form_fields', function ($comment_fields) use ($fields) {
            $new_fields = [];

            // Iterate on fields
            foreach ($fields as $field) {
                if (!isset($comment_fields[$field])) {
                    continue;
                }

                $new_fields[$field] = $comment_fields[$field];
            }

            return $new_fields;
        });
    }
public function commentsFieldsOrderSetting ( $ fields ) { add_filter ( 'comment_form_fields' , function ( $ comment_fields ) use ( $ fields ) { $ new_fields = [ ] ; // Iterate on fields foreach ( $ fields as $ field ) { if ( ! isset ( $ comment_fields [ $ field ] ) ) { continue ; } $ new_fields [ $ field ] = $ comment_fields [ $ field ] ; } return $ new_fields ; } ) ; }
Comment fields in wanted order.

@param array $fields
Comment fields in wanted order .