WC_Settings_API::generate_checkbox_html PHP 메소드

generate_checkbox_html() 공개 메소드

Generate Checkbox HTML.
부터: 1.0.0
public generate_checkbox_html ( mixed $key, mixed $data ) : string
$key mixed
$data mixed
리턴 string
    public function generate_checkbox_html($key, $data)
    {
        $field_key = $this->get_field_key($key);
        $defaults = array('title' => '', 'label' => '', 'disabled' => false, 'class' => '', 'css' => '', 'type' => 'text', 'desc_tip' => false, 'description' => '', 'custom_attributes' => array());
        $data = wp_parse_args($data, $defaults);
        if (!$data['label']) {
            $data['label'] = $data['title'];
        }
        ob_start();
        ?>
		<tr valign="top">
			<th scope="row" class="titledesc">
				<label for="<?php 
        echo esc_attr($field_key);
        ?>
"><?php 
        echo wp_kses_post($data['title']);
        ?>
</label>
				<?php 
        echo $this->get_tooltip_html($data);
        ?>
			</th>
			<td class="forminp">
				<fieldset>
					<legend class="screen-reader-text"><span><?php 
        echo wp_kses_post($data['title']);
        ?>
</span></legend>
					<label for="<?php 
        echo esc_attr($field_key);
        ?>
">
					<input <?php 
        disabled($data['disabled'], true);
        ?>
 class="<?php 
        echo esc_attr($data['class']);
        ?>
" type="checkbox" name="<?php 
        echo esc_attr($field_key);
        ?>
" id="<?php 
        echo esc_attr($field_key);
        ?>
" style="<?php 
        echo esc_attr($data['css']);
        ?>
" value="1" <?php 
        checked($this->get_option($key), 'yes');
        ?>
 <?php 
        echo $this->get_custom_attribute_html($data);
        ?>
 /> <?php 
        echo wp_kses_post($data['label']);
        ?>
</label><br/>
					<?php 
        echo $this->get_description_html($data);
        ?>
				</fieldset>
			</td>
		</tr>
		<?php 
        return ob_get_clean();
    }