Yoast_Form::label PHP Method

label() public method

Output a label element
public label ( string $text, array $attr )
$text string Label text string.
$attr array HTML attributes set.
    public function label($text, $attr)
    {
        $attr = wp_parse_args($attr, array('class' => 'checkbox', 'close' => true, 'for' => ''));
        echo "<label class='" . $attr['class'] . "' for='" . esc_attr($attr['for']) . "'>{$text}";
        if ($attr['close']) {
            echo '</label>';
        }
    }