Support » Plugin: HMS Testimonials » Display field names

Viewing 1 replies (of 1 total)
  • Chris Dillon

    (@cdillon27)

    It seems the plugin was designed to handle single words, not phrases, in the custom field name.

    You will have to rename “Was the staff friendly and courteous?” to something like “friendly” and move the phrase to a filter.

    Then filter the form output:

    /**
     * To show a phrase on the form instead of the field name.
     */
    function my_custom_field_1( $value ) {
    	return 'Was the staff friendly?';
    }
    add_filter( 'hms_testimonials_cf_text_1', 'my_custom_field_1' );

    The filter for your 2nd custom field would be hms_testimonials_cf_text_2, and so on.

    Then filter the display output:

    /**
     * To show a phrase before the custom field value on display.
     */
    function my_custom_field_friendly( $value ) {
    	return 'Was the staff friendly and courteous? ' . $value;
    }
    add_filter( 'hms_testimonials_cf_friendly', 'my_custom_field_friendly' );

    Notice the field name in the filter pattern.

    Or try Strong Testimonials which makes such customization much easier.

Viewing 1 replies (of 1 total)
  • The topic ‘Display field names’ is closed to new replies.