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
Post a Comment