The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Share:
Notifications
Clear all

Issue [Solved] Can't do image only

5 Posts
2 Users
1 Likes
324 Views
Posts: 17
 Mau
Topic starter
(@mau)
Eminent Member
Joined: 1 year ago

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
Asti
Posts: 7123
 Asti
Support
(@asti)
Illustrious Member
Joined: 6 years ago

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
Posts: 17
 Mau
Topic starter
(@mau)
Eminent Member
Joined: 1 year ago

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?

2 Replies
Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7123

@mau,

Thank you so much, it is working! I left a 5star review on the plugin page for this.

Thank you, very much! We really appreciate it. 

Do you also have a code for making the image a required field?

I'll ask the developers and let you know soon. 

Asti
 Asti
Support
(@asti)
Joined: 6 years ago

Illustrious Member
Posts: 7123

Please find a response from the developers. 

You can use the code below: 

add_filter('wpdiscuz_mu_allowed_extensions', function($extensions){
    return $extensions .=' required ';
});

Put the code in the active theme fucntions.php file. 

The code simply doesn't allow posting a comment if the attachment is missing. It doesn't display any notices. 

For deeper customizations, you can contact us via sales[at]gvectors.com email address. We have plugin customization and custom addon development services at the gVectors Team. They can assess the work and create it for you.

Share: