Single line answers - placeholder text

Hi there,

In the coursepress pro plugin you have the option to place an answers text field. But, the placeholder text is not working. It does work when i choose for a multiple line text field, but not when i choose for a single line. Is this a bug?

  • Ash

    Hello @JTI

    I have a quick fix for you.

    Please go to /coursepress/includes/unit-modules/text_input.php line no 115 and replace

    <div class="module_textarea_input"><input <?php echo ( $data->mandatory_answer == 'yes' ) ? 'data-mandatory="yes"' : 'data-mandatory="no"'; ?> type="text" name="<?php echo $this->name . '_front_' . $data->ID; ?>" id="<?php echo $this->name . '_front_' . $data->ID; ?>" placeholder="<?php echo(isset($data->placeholder_text) && $data->placeholder_text !== '' ? esc_attr($data->placeholder_text) : ' ' ); ?>" value="<?php echo ( is_object($response) && count($response >= 1) ? esc_attr($response->post_content) : ' ' ); ?>" <?php echo $enabled; ?> /></div>

    with

    <div class="module_textarea_input"><input <?php echo ( $data->mandatory_answer == 'yes' ) ? 'data-mandatory="yes"' : 'data-mandatory="no"'; ?> type="text" name="<?php echo $this->name . '_front_' . $data->ID; ?>" id="<?php echo $this->name . '_front_' . $data->ID; ?>" placeholder="<?php echo(isset($data->placeholder_text) && $data->placeholder_text !== '' ? esc_attr($data->placeholder_text) : ' ' ); ?>" value="<?php echo ( is_object($response) && count($response >= 1) ? esc_attr($response->post_content) : '' ); ?>" <?php echo $enabled; ?> /></div>

    Please note that, this changes will be lost in next update. So it's worth to note down this changes somewhere and apply again after your updates (if the issue is not fixed in next update).

    Hope it helps :slight_smile: Please feel free to ask more question if you have any.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.