extend wordpress core class in functions.php -


i trying extend wordpress core class inside theme's functions.php, & class trying extend wp_customize_image_control class wp-customize-control.php in wp-includes.

it extends "wp_customize_upload_control".

i allow .svg mime-type uploaded within theme customizer.

in theme's functions.php adding these lines:

class wp_customize_image_control_svg extends wp_customize_image_control {       public $extensions = array( 'jpg', 'jpeg', 'gif', 'png', 'svg' ); }; 

but sadly breaks everything.

any help, hints or tips appreciated.

you close.

/* extend image control */  class wp_customize_image_control_svg extends wp_customize_image_control {         public function __construct( $manager, $id, $args = array() )        {                 parent::__construct( $manager, $id, $args );                 $this->remove_tab('uploaded');                 $this->extensions = array( 'jpg', 'jpeg', 'gif', 'png', 'svg' );         } } 

this goes inside "customize_register" action

just make sure you're registering 1 instead of normal image control.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -