I'm really sorry, but there isn't an easy solution we can provide you. You should write custom JS codes for this kind of customization.
In case you want to say thank you! 🙂 We'd really appreciate if you leave a good review on the plugin page. This is the best way to say thank you to this project and the support team.
jQuery(document).ready(function ($) { $(document).on('click', '.wc_comm_submit', function (e) { if (!($(this).parents('.wpd_comm_form').find('.wmu-attachments-ids') && $(this).parents('.wpd_comm_form').find('.wmu-attachments-ids').val())) { wpdiscuzAjaxObj.setCommentMessage('Attachment is required'); e.preventDefault(); e.stopImmediatePropagation(); return false; } }); });
Just make sure this JS code is being loaded before the wpDiscuz js files.
In case you want to say thank you! 🙂 We'd really appreciate if you leave a good review on the plugin page. This is the best way to say thank you to this project and the support team.
please can you update this code to make required attachments just for comments not replies? I tried to put (.wpd-main-form-wrapper) as a parent class but that didn't work
jQuery(document).ready(function ($) {
$(document).on('click', '.wc_comm_submit', function (e) {
if (!($(this).parents('.wpd_main_comm_form').find('.wmu-attachments-ids') && $(this).parents('.wpd_main_comm_form').find('.wmu-attachments-ids').val())) {
wpdiscuzAjaxObj.setCommentMessage('Attachment is required');
e.preventDefault();
e.stopImmediatePropagation();
return false;
}
});
});
In case you want to say thank you! 🙂 We'd really appreciate if you leave a good review on the plugin page. This is the best way to say thank you to this project and the support team.
Just make sure this JS code is being loaded before the wpDiscuz js files.
What about this condition? Are you sure this is made?
In case you want to say thank you! 🙂 We'd really appreciate if you leave a good review on the plugin page. This is the best way to say thank you to this project and the support team.
You can create some new JS file, put the code in the file, then add the created file in the header of your active theme. If it still doesn't work, keep the changes and leave some example URL to allow us to check the issue.
In case you want to say thank you! 🙂 We'd really appreciate if you leave a good review on the plugin page. This is the best way to say thank you to this project and the support team.