Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class CustomizeImageListControl extends \WP_Customize_Control {
- protected function render_content() {
- if ( empty( $this->choices ) )
- return;
- $name = '_customize-radio-' . $this->id;
- ?>
- <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span>
- <?php
- foreach ( $this->choices as $value => $label ) :
- $selected = '';
- $checked = '';
- if ( $this->value() != '' ) {
- if ( $this->value() == $value ) {
- $selected = ' of-radio-img-selected';
- $checked = ' checked="checked"';
- }
- }
- echo '<label><input type="radio" id="' . esc_attr( $name .'_'. $value) . '" class="of-radio-img-radio" value="' . esc_attr( $value ) . '" name="' . esc_attr( $name ) . '" '. $checked .' '. $this->get_link() .' />';
- echo '<div class="of-radio-img-label">' . esc_html( $value ) . '</div>';
- echo '<img src="' . esc_url( $label ) . '" alt="' . $label .'" class="of-radio-img-img' . $selected .'"
- onclick="jQuery(\'#'. esc_attr($name .'_'. $value) .'\').click();" /></label>';
- endforeach;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement