Turns out Advanced Custom Fields, a plugin I was already using, makes it super easy to insert additional fields into the comment form.
ACF is so good that it has created a tutorial to do just this and how to output the data within the comment thread: https://www.advancedcustomfields.com/resources/get-values-comment/
However, by doing this the plugin adds a bunch of superfluous CSS and JS files to the front end so to remove these, add this bit of code to your functions.php:
// disable acf css on front-end acf forms
add_action( 'wp_print_styles', 'my_deregister_styles', 100 );
function my_deregister_styles() {
wp_deregister_style( 'acf' );
wp_deregister_style( 'acf-field-group' );
wp_deregister_style( 'acf-global' );
wp_deregister_style( 'acf-input' );
wp_deregister_style( 'acf-datepicker' );
}
Related Posts:
- Show only posts which can be commented OR have custom meta field
- Adding another state (spam, reject, approve) to wordpress comments?
- Show Custom Comment Fields when editing in admin
- How to make custom comment fields required and message field not required
- Comments form custom fields order
- How to add a title field in comments?
- displaying and sorting comments by a custom field (using PODS plugin) [closed]
- Declaring in variables [closed]
- comment meta_query for keys that aren’t yet set
- custom comment_form fields not displaying
- Editing custom fields for comments
- comments_where Hook
- Rewrite comment form post ID on submit
- Add custom field information to source meta data
- Echo out custom fields in comments
- Semi-Private Comments + page comments -> is it possible?
- How to add a custom field to the comments “Quick Edit” screen?
- Problem with serialized arrays in custom meta
- explode array within shortcode
- Can I count the number of users matching a value in a multiple value key?
- Add multiple images to a page sidebar
- How to delete custom field “suggestions” from dropdown list
- Adding existing user custom field value to a woocommerce product [closed]
- How to save values of a custom input field on the Network > Site Info screen
- How to load php file for specific page in admin?
- How to set default metaboxes on user creation?
- Metabox nonce PHP notice
- ajax jquery update custom field meta value front end
- How to break meta values into different items and avoid duplicates?
- Add input field to ‘Pages > Edit Page’ through functions.php
- How can I query on the year part of a complete date in a custom field?
- get_post_meta not working inside loop
- How do I exclude posts by custom field value?
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- What is the cleanest way to extract custom variables from a post
- Auto populate a meta box field from another meta box field when publish or save
- Eliminating the appearance of a specific custom field in a post
- Conditional custom field query
- Display two custom values from a post
- Find page IDs with specific meta tag key value pairs
- Order query by meta_value with multiple custom fields
- Display only past events on that page using Visual Composer Grid Bulider
- user Profile meta value as custom field
- Send email with custom fields after new draft is saved or new post published
- Use WPbakery for own custom field [closed]
- Get posts with same meta value as current post
- Add custom field to all posts in specific post_type
- Select multiple images from custom field
- Custom Fields – How to create a list from multi-line entries of a single value
- Unique meta_key with array value vs repeated meta_key with single values
- Custom Field 101
- custom field (video/audio url) and embed functionality
- Allow only one post with specific meta value
- Querying posts by latitude and longitude to build a Google Maps with several markers
- How to display childrens custom fields?
- Attach images to posts using custom fields (just paths to images already uploaded)
- how to display custom fields of post on a web page
- Changed PHP handler to DSO – weird custom fields problem [closed]
- How to fill custom fields with brackets in their key with add_post_meta()?
- Front-End User Profile
- Displaying pages with a specific custom meta
- How to update user profile custom fields
- put saved metabox values back into fields and then display on the front end
- Custom field to array?
- How to sort by custom field value?
- Meta Box Plugin Cloned Fields – Multiple Foreach values
- How to update custom field of a posts in a particular category
- How to query posts by month based on date custom field?
- Custom field bug in WordPress 3.2
- Change word in woocommerce product category custom field
- get posts based on non-single metadata
- Problem with revisions only returning four results
- How to save multiple values with same meta_key, each value linked to another tag id
- Add forms dynamically in admin pages?
- Custom pages or Custom Posts
- get_avatar filter is not working as per requirement
- What WordPress “technology” would I use if I wanted subscribers to be able to mark pages with characteristics and notes?
- WordPress Admin – Automatically Sort Custom Posts by Custom Field Date Value in d-m-Y Fomat
- how can i show WordPress custom field data to my short code?
- searching by keywords in post’s metas or pagination links problem
- Permanently show Custom Fields in Editor
- open modal window
- a lot of custom fields
- Hide custom fields by user’s role
- select user with all meta field and field value. I am use Below Query for this ,So any of know another way to fast query instead of below query?
- Retrieve Google API JSON data and store as WordPress Custom Fields
- update meta field value after
- meta_query ‘compare’ => ‘!=’ not working
- If metabox fields has content display content
- Display Data From This Custom Media Upload Meta Box?
- Custom fields and auto save
- Save values generated via API as custom meta fields
- Load code for custom fields only on admin pages?
- Custom field in a shortcode?
- Exclude empty fields from custom field calculation (Average)
- Pagination not displaying correct number of pages
- Filter Query Post by Custom Fields(by date)
- Add fields to edit in custom widget
- Can running a WP-Cron to update_post_meta cause performance issues?
- custom field value is blank or empty