I want comments just to upload videos without text but replies the opposite

I mean comments just to upload videos.. without text area ... in replies its a must to write in text area without any uploads

comments and replies share html form ,comments have css class is called "depth-1" ,replies have css classes like "depth-2".."depth-3".."depth-4".. etc.

so first I want to disabled text area in comments, so I tried this code

    add_filter('comment_form_field_comment', 'my_comment_form_field_comment');
function my_comment_form_field_comment($default){
  return false;

add_action('pre_comment_on_post', 'my_pre_comment_on_post');
function my_pre_comment_on_post($post_id){
  $some_random_value = rand(0, 384534);
  $_POST['comment'] = "Default comment. Some random value to avoid duplicate comment warning: {$some_random_value}";

but it hide text area for both comments and replies and I want it just for comments how I can do that?

  • 1
    Can you say this using different words with much more information? Are you trying to implement an upload form by using comments?
    – Tom J Nowell
    Jun 10 at 17:49
  • I want to make comments just "add file" and replies just write text without any upload for files...can you help for that?
    – Roah
    Jun 10 at 18:00
  • I explain more in the main post
    – Roah
    Jun 10 at 18:11
  • 1
    Oh, that is not possible with standard WordPress, you would need to rebuild large parts of the commenting system, I estimate several weeks of full-time development work, you are highly unlikely to find a plugin that will do such a specific thing. Comments have text, even if you do not use it. It would be easier to upload video responses using a different mechanism that is not comments, e.g. custom post types. You should have asked how to solve your problem, not how to build your solution ( X Y Problem )
    – Tom J Nowell
    Jun 10 at 20:27
  • 1
    TLDR: If you want video replies, comments are not the solution. Use a CPT instead and set the post parent, and use a custom loop
    – Tom J Nowell
    Jun 10 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.