| 1 |
<?php |
| 2 |
$name .= "[]"; |
| 3 |
|
| 4 |
if( isset( $field['disable'] ) && $field['disable'] == true ) { |
| 5 |
$attrs .= ' disabled'; |
| 6 |
} |
| 7 |
|
| 8 |
if( ! empty( $field['options'] ) ) : |
| 9 |
foreach( $field['options'] as $opt_id => $option ) { |
| 10 |
if( is_array( $value ) ) { |
| 11 |
$selected = in_array( $opt_id, $value ) ? 'checked="checked"' : ''; |
| 12 |
} |
| 13 |
echo '<label><input class="'.esc_attr( $class ).'" type="checkbox" id="'.$field_id.'" name="'.$name.'" value="'. $opt_id .'" '. $selected .'/>'. $option .'</label><br>'; |
| 14 |
} |
| 15 |
endif; |
| 16 |
?> |