• K B

    (@kiritb)


    I want to add a few custom fields to my comments_form but despite trying a few different techniques I can’t get them to work, any ideas?

    Environment :
    Woothemes definition theme + woocommerce 2.1.5

    • 1st technique :
    • – Added a filter for comment_form_default_fields – like so :

      function wpsites_modify_comment_form_fields($fields){
          $fields['new'] = '<p>This will be by custom field</p>';
          return $fields;
      }
      
      add_filter('comment_form_default_fields','wpsites_modify_comment_form_fields', 20);

      Doesn’t add anything, doesn’t throw any errors.

    • 2nd technique
    • – Added the field to $comments_args – like so :

      $comments_args = array( 'new'=> '<p>This will be by custom field</p>' );
       comment_form($comments_args);

      Doesn’t work.

    • 3rd technique
    • – added the field directly to the comments_form() as a paramter
      comment_form(array( 'new'=> '<p>This will be by custom field</p>' ))
      and that didn’t work either

      How do I get this to work?

  • The topic ‘Custom Comment_Form Fields don't work’ is closed to new replies.