我正在尝试在我的主题的functions.php中扩展一个wordpress核心类,并且我要扩展的WP_Customize_Image_Control
类来自wp-customize-control.php
wp-includes中的类。
它已经扩展了“WP_Customize_Upload_Control”。
我想允许在主题定制器中上传 .svg mime-type。
在我的主题的functions.php中,我添加了这些行:
class WP_Customize_Image_Control_SVG extends WP_Customize_Image_Control {
public $extensions = array( 'jpg', 'jpeg', 'gif', 'png', 'svg' );
};
但可悲的是,这打破了一切。
任何帮助,提示或提示表示赞赏。