themosis / theme

The Themosis framework theme.
http://framework.themosis.com/
GNU General Public License v2.0
104 stars 35 forks source link

Loading SVG file to media field #32

Closed leurdo closed 5 years ago

leurdo commented 6 years ago

Hello, I have a problem with svg images. I added them to the list of allowed files extensions, so I can upload them to Wordpress Media Library. But I still can not upload them to Themosis Media Field. How to make this possible? Many thanks.

jlambe commented 6 years ago

Not sure but by default the media field is set to handle image type only. Perhaps adding the application file type to the media field will let you select it for use in the media field.

leurdo commented 6 years ago

Dear Sir, I tried this. Here is my metabox: Metabox::make(__('Popup', 'lzd'), 'post', [ 'context' => 'side', 'priority' => 'low' ]) ->set([ Field::media('popup_image', [ 'title' => __('Popup Image', 'lzd'), 'type' => ['image', 'application'] ]) ]); And other application types (pdf for example) can be selected, but not the svg.

Xaotome commented 6 years ago

I've got the same problem in my project : I find a code for displaying .svg file in media select but when I pressed 'Insert', the file doesn't appear. https://github.com/mvpdesign/themosis-theme/blob/master/app/admin/svg.php

jlambe commented 6 years ago

@Xaotome @leurdo A PR with a fix is in progress regarding this issue. Will be fixed soon.

jlambe commented 5 years ago

Current 2.0 beta release allows the upload of svg images to the media field now.