W
W
WebforSelf2021-02-17 03:37:07
WordPress
WebforSelf, 2021-02-17 03:37:07

How to add placeholder to woocomerce feedback fields?

in the comment template - single-product-reviews.php

there is an output of the fields, but how to add a placeholder to them?

foreach ( $fields as $key => $field ) {
          $field_html  = '<p class="comment-form-' . esc_attr( $key ) . '">';					
          $field_html .= '<input class="form_input"  id="' . esc_attr( $key ) . '" name="' . esc_attr( $key ) . '" type="' . esc_attr( $field['type'] ) . '" value="' . esc_attr( $field['value'] ) . '" size="30" ' . ( $field['required'] ? 'required' : '' ) . ' /></p>';

          $comment_form['fields'][ $key ] = $field_html;
        }


The bottom line is, you need to remove the labels, which you actually did and add a placeholder, but something doesn’t work out.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question