Files
display-featured-image-genesis/includes/widgets/admin/checkbox.php
T
Robin Cornett 4ef7e552da Refactor taxonomy widget
Adds new widget form class, which all three widgets can share.
2017-05-18 16:36:27 -04:00

9 lines
607 B
PHP

<?php
$value = isset( $instance[ $args['id'] ] ) ? $instance[ $args['id'] ] : $this->parent->defaults[ $args['id'] ];
echo '<p>';
printf( '<input type="hidden" name="%s" value="0" />', esc_attr( $this->parent->get_field_name( $args['id'] ) ) );
printf( '<input id="%s" type="checkbox" name="%s" value="1" %s/>', esc_attr( $this->parent->get_field_id( $args['id'] ) ), esc_attr( $this->parent->get_field_name( $args['id'] ) ), checked( 1, esc_attr( $value ), false ) );
printf( '<label for="%s">%s</label>', esc_attr( $this->parent->get_field_id( $args['id'] ) ), esc_attr( $args['label'] ) );
echo '</p>';