type ) {
case 'radioimage' :
if ( empty( $this->choices ) )
return;
$name = '_customize-radio-' . $this->id;
if ( ! empty( $this->label ) ) : ?>
label ); ?>
description ) ) : ?>
description ); ?>
sublabel ) ) : ?>
sublabel ); ?>
choices as $value => $image ) :
$checked = checked( $this->value(), $value, false );
?>
';
break;
}
}
}
endif;
/**
* Hook into control display interface
*
* @since 3.0.0
* @param object $wp_customize
* @param string $id
* @param array $setting
* @return void
*/
// Only load in customizer (not in frontend)
if ( class_exists( 'WP_Customize_Control' ) ) :
function hoot_customize_radioimage_control_interface ( $wp_customize, $id, $setting ) {
if ( isset( $setting['type'] ) ) :
if ( $setting['type'] == 'radioimage' ) {
$wp_customize->add_control(
new Hoot_Customize_Radioimage_Control( $wp_customize, $id, $setting )
);
}
endif;
}
add_action( 'hoot_customize_control_interface', 'hoot_customize_radioimage_control_interface', 10, 3 );
endif;
/**
* Add sanitization function
*
* @since 3.0.0
* @param string $callback
* @param string $type
* @param array $setting
* @param string $name name (id) of the setting
* @return string
*/
function hoot_customize_sanitize_radioimage_callback( $callback, $type, $setting, $name ) {
if ( $type == 'radioimage' )
$callback = 'hoot_sanitize_customize_enum';
return $callback;
}
add_filter( 'hoot_customize_sanitize_callback', 'hoot_customize_sanitize_radioimage_callback', 5, 4 );