Up to 50 percent off

Custom Radio Helptext

This topic contains 5 reply and 2 voices, and was last updated by Tareq Hasan 11 years, 5 months ago
Viewing 5 Posts - 1 through 5 (of 5 total)
Author Posts
May 22, 2013 at 5:57 am 3961
Tareq Hasan No, Helptext will displayed. Bug?
May 22, 2013 at 6:21 am 3962
Tareq Hasan Tareq Hasan

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.

May 26, 2013 at 3:00 pm 4222
zellermaniac zellermaniac
        <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.

May 27, 2013 at 10:28 am 4232
Tareq Hasan Tareq Hasan

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

May 27, 2013 at 12:07 pm 4240
zellermaniac zellermaniac

Right?

May 28, 2013 at 2:11 am 4257
Tareq Hasan Tareq Hasan

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 5 Posts - 1 through 5 (of 5 total)