Home Forums Plugin Support WP User Frontend Pro Custom Radio Helptext

This topic is: resolved

Tagged: 

This topic contains 5 replies, has 2 voices, and was last updated by  Tareq Hasan 6 years ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #3961

    zellermaniac
    Participant
    Post count: 40

    No, Helptext will displayed. Bug?

    #3962

    Tareq Hasan
    Keymaster
    Post count: 2831

    Seems like the help text left out :-/

    So until the official update comes out, you can copy paste the help text code in the render-form.php after line 959.

    #4222

    zellermaniac
    Participant
    Post count: 40
            <div class="wpuf-fields">
                <span data-required="<?php echo $attr['required'] ?>" data-type="radio"></span>
    
                <?php
                if ( $attr['options'] && count( $attr['options'] ) > 0 ) {
                    foreach ($attr['options'] as $option) {
                        ?>
    
                        <label>
                            <input type="checkbox" name="<?php echo $attr['name']; ?>[]" value="<?php echo esc_attr( $option ); ?>"<?php echo in_array( $option, $selected ) ? ' checked="checked"' : ''; ?> />
                            <?php echo $option; ?>
                        </label>
                        <?php
                    }
                }
                ?><span class="wpuf-help"><?php echo $attr['help']; ?></span>

    Not working.

    #4232

    Tareq Hasan
    Keymaster
    Post count: 2831

    Are you sure you've put the help text? It's working fine here.

    #4240

    zellermaniac
    Participant
    Post count: 40

    < ?php echo $attr['help']; ?>

    Right?

    #4257

    Tareq Hasan
    Keymaster
    Post count: 2831

    Yes.

    [php]
    /**
    * Prints a radio field
    *
    * @param array $attr
    * @param int|null $post_id
    */
    function radio( $attr, $post_id, $type ) {
    $selected = isset( $attr[‘selected'] ) ? $attr[‘selected'] : ”;

    if ( $post_id ) {
    $selected = $this->get_meta( $post_id, $attr[‘name'], $type, true );
    }
    ?>

    <div class="wpuf-fields">

    <span data-required="<?php echo $attr[‘required'] ?>" data-type="radio"></span>

    <?php
    if ( $attr[‘options'] && count( $attr[‘options'] ) > 0 ) {
    foreach ($attr[‘options'] as $option) {
    ?>

    <label>
    <input name="<?php echo $attr[‘name']; ?>" type="radio" value="<?php echo esc_attr( $option ); ?>"<?php checked( $selected, $option ); ?> />
    <?php echo $option; ?>
    </label>
    <?php
    }
    }
    ?>

    <span class="wpuf-help"><?php echo $attr[‘help']; ?></span>
    </div>

    <?php
    }
    [/php]

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Custom Radio Helptext’ is closed to new replies.