I am trying to extend a wordpress core class inside my theme’s functions.php, & the class I am trying to extend is WP_Customize_Image_Control
from class wp-customize-control.php
in wp-includes.
It already extends “WP_Customize_Upload_Control”.
I would like to allow the .svg mime-type to be uploaded within the theme customizer.
in my theme’s functions.php I am adding these lines:
class WP_Customize_Image_Control_SVG extends WP_Customize_Image_Control {
public $extensions = array( 'jpg', 'jpeg', 'gif', 'png', 'svg' );
};
but sadly this breaks everything.
Any help, hints or tips appreciated.
You are close.
This goes inside your “customize_register” action
Just make sure you’re registering this one instead of the normal image control.