An SVG logo Custom Control for the WordPress Customizer – Per Søderlind


Another proof of concept. The custom control
You create a custom control by extending the WP_Customize_Control class. I check for WP_Customizer_Control existence before adding custom control because WP_Customize_Control is loaded on customizer page only.
if ( class_exists( ‘WP_Customize_Control’ ) ) {
/**
* Custom customizer option control
*/
class DSS_SVG_Picker_Option extends WP_Customize_Control {
public $type = ‘svg’;
public function render_content() {
?>

}
}
}
list_svg()
Create a option list with URLs to SVG files. The SVG files are defined in svg.json
function list_svg( $selected_value = ” ) {
$ret = ”;
$svg_data_file = dirname( __FILE__ ) . ‘/svg.json’;
if ( file_exists(
Source: https://managewp.org/articles/13861/an-svg-logo-custom-control-for-the-wordpress-customizer-per-s-derlind




source https://williechiu40.wordpress.com/2016/11/18/an-svg-logo-custom-control-for-the-wordpress-customizer-per-soderlind/