File: /var/www/vhosts/uyarreklam.com.tr/httpdocs/checkboxes.class.php.tar
httpdocs/wp-content/plugins/so-widgets-bundle/widgets/contact/fields/checkboxes.class.php 0000644 00000002145 15154630115 0034254 0 ustar 00 var/www/vhosts/uyarreklam.com.tr <?php
class SiteOrigin_Widget_ContactForm_Field_Checkboxes extends SiteOrigin_Widget_ContactForm_Field_Base {
public function render_field( $options ) {
if ( ! empty( $options['field']['options'] ) ) {
if ( empty( $options['value'] ) || ! is_array( $options['value'] ) ) {
$options['value'] = array();
}
?>
<ul>
<?php foreach ( $options['field']['options'] as $i => $option ) { ?>
<?php
$is_checked = in_array( $option['value'], $options['value'] ) || ( isset( $option['default'] ) && $option['default'] );
?>
<li>
<input
type="checkbox"
value="<?php echo esc_attr( $option['value'] ); ?>"
name="<?php echo esc_attr( $options['field_name'] ); ?>[]"
id="<?php echo esc_attr( $options['field_id'] ) . '-' . $i; ?>"
<?php echo checked( $is_checked, true, false ); ?>
<?php self::add_custom_attrs( 'checkboxes', $options ); ?>
/>
<label for="<?php echo esc_attr( $options['field_id'] ) . '-' . $i; ?>">
<?php echo wp_kses_post( $option['value'] ); ?>
</label>
</li>
<?php } ?>
</ul>
<?php
}
}
}
uyarreklam.com.tr/httpdocs/wp-content/plugins/so-widgets-bundle/base/inc/fields/checkboxes.class.php0000644 00000002610 15154755263 0032647 0 ustar 00 var/www/vhosts <?php
/**
* Class SiteOrigin_Widget_Field_Checkbox
*/
class SiteOrigin_Widget_Field_Checkboxes extends SiteOrigin_Widget_Field_Base {
protected $options;
protected function render_field( $value, $instance ) {
if ( empty( $value ) ) {
$value = array();
}
if ( !is_array( $value ) ) {
$value = array( $value );
}
$i = 0;
foreach ( $this->options as $id => $label ) {
?>
<label for="<?php echo esc_attr( $this->element_id ); ?>-<?php echo esc_attr( $id ); ?>" class="so-checkbox-label">
<input
type="checkbox"
class="siteorigin-widget-input"
name="<?php echo esc_attr( $this->element_name ); ?>[<?php echo esc_attr( $i++ ); ?>]"
value="<?php echo esc_attr( $id ); ?>"
id="<?php echo esc_attr( $this->element_id ); ?>-<?php echo esc_attr( $id ); ?>"
<?php checked( in_array( $id, $value ) ); ?>
/>
<?php echo esc_html( $label ); ?>
</label>
<?php
}
}
protected function sanitize_field_input( $value, $instance ) {
if ( empty( $value ) ) {
$value = array();
}
$values = is_array( $value ) ? $value : array( $value );
$keys = array_keys( $this->options );
$sanitized_value = array();
foreach ( $values as $value ) {
if ( ! in_array( $value, $keys ) ) {
$sanitized_value[] = isset( $this->default ) ? $this->default : false;
} else {
$sanitized_value[] = $value;
}
}
return $sanitized_value;
}
}