• 0

Vectors


Question

Posted (edited) · Report post

Hi, I'm aware that .svg is not supported by wordpress by default, however there are some workarounds, which make using .svg in wordpress possible, these plugins or modifications allow me to upload .svg image files and use them wherever a bitmap image can be used.

The problem is, DMS seems to have a list of supported image extensions somewhere inside also, example: i can upload a .svg image into a gallery and using third party image displaying plugins incorporate .svg into DMS, this is a hassle as most of these third party 'boxes' dont work nicely with DMS as DMS components do, but DMS 'media box' still tells me .svg is not supported as an image file, although, as i said, my wordpress now accepts .svg and i can even use shortcodes to implement .svg into third party components ,not in a DMS 'text box' though.

 

I guess my question is, is there a way to change the default extension image layout for DMS aswell, as my wordpress is now accepting .svg, my DMS still won't. (i can use .svg in those default worpress themes).

Edited by capgras
1 person likes this

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

Posted · Report post

HI,

 

To be totally honest, I am not sure. I will need to speak to one of our developers regarding this. I have bookmarked your topic and as soon as I have more information, I will reply here.

 

You could try this:

 

Using FTP or command line if you know how, navigate to the following directory

 

wp-content/themes/dms/editor and open the editor.actions.php file.

 

Navigate to line 302 and you will find the following line of code:

 

$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/x-icon');

 

Replace it with this:

 

$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/svg' 'image/x-icon');

 

and see if that does the trick, reply here if it does and I will do a pull request.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

i get this:

 

Parse error: syntax error, unexpected ''image/x-icon'' (T_CONSTANT_ENCAPSED_STRING), expecting ')' in C:\wamp\www\oblik2\wp-content\themes\dms\editor\editor.actions.php on line 313

 

the line is obviousely different, its 313 not 302, maybe i should update dms? maybe the list appears somewhere else in the DMS code so it needs to match this one.. just a thought.

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/svg', 'image/x-icon');a comma was left out in the code you provided, i no longer get a syntax error but the .svg still wont upload

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

thanks for the help, i hope DMS gets .svg support in the future, it would be awesome...

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

Try switching 'image/svg' to 'image/svg+xml'

Share this post


Link to post
Share on other sites
  • 0

Posted · Report post

OK, I will need to speak to one of our developers and see if we can add support.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now