Mar 05, 2023 2:45 pm
I want users to be able to upload an image. Text should be optional. I put in settings minimum required words and letters as 0 but still if I only try to upload an image as user it says that a required field is missing
4 Replies
Mar 06, 2023 7:54 am
Hi @mau,
You should add the hook code below in the active theme fucntions.php file:
add_filter( 'allow_empty_comment', function ($allow, $data) { return true; }, 10 , 2 );
This article should be helpful for you: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/
Besides adding the hook code, you should also make sure the values of the following options are set to 0:
- Comment Text Length
- Reply Text Length
Mar 06, 2023 10:12 am
Hi Asti,
Thank you so much, it is working! I left a 5star review on the plugin page for this.
Another question:
Do you also have a code for making the image a required field?