Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svg preview not working #1223

Closed
bilalmalkoc opened this issue Jan 31, 2019 · 5 comments
Closed

Svg preview not working #1223

bilalmalkoc opened this issue Jan 31, 2019 · 5 comments

Comments

@bilalmalkoc
Copy link

In file type, i upload svg image, but preview doesn't show it. For allow to upload svg i used Safe SVG plugin.

$cmb_services->add_field( array(
    'name'         => esc_html__( 'Navigation Image (Svg)', 'test' ),
    'id'           => $prefix . 'servicesNavigationImageSvg',
    'type'         => 'file',
    'query_args'   => array(
        'type' => array(
            'image/svg',
        ),
    ),
    'preview_size' => 'thumbnail',
) );
@tw2113
Copy link
Contributor

tw2113 commented Jan 31, 2019

Until told otherwise, I think this is a detail that needs added as an enhancement for the field type above, if not overall. As is, we just may not have things set to display a preview of sorts, and I don't know offhand how to possibly achieve it as well.

@tw2113
Copy link
Contributor

tw2113 commented Feb 2, 2019

Possibly related? #874

@bilalmalkoc
Copy link
Author

@tw2113 it requires to edit js file. But i am using with plugin. It must be fixed with new update.

@andymb
Copy link

andymb commented Feb 18, 2021

Hi, was this change ever committed? I'm using the WordPress CMB2 2.8.0 plugin and SVGs still don't display for a file list:

Screenshot 2021-02-18 at 12 55 37

Latest WP & the SVG Support plugin.

@jtsternberg
Copy link
Member

This should be good in the latest on the develop branch. It will still require the Safe SVG plugin in order to upload svg's to the site.

lipemat added a commit to lipemat/CMB2 that referenced this issue Mar 30, 2021
* upstream/develop:
  Clean up and add props for CMB2#1413
  Sanitize URLs with HTTPS
  Add develop suffix to init class
  Add am-cli-tools
  Update changelong and version numbers and readmes, and prepare release
  Set default priority to 10 for options pages. Fixes CMB2#1410
  build field-cache key manually to remove unnecessary |'s
  Better generated array key for cached fields, fixes issue where wrong field is found. Fixes CMB2#1405
  Add to list of valid image types from get_allowed_mime_types(). Fixes CMB2#1223
  Move tab markup output to separate method, options_page_tab_nav_output. Fixes CMB2#1407
  Add cmb2_tab_group_tabs filter for adding arbitrary menu page urls to the cmb2 tabs. See CMB2#1407
  Update since tag, and add props for CMB2#1340
  Limit use of italic, including removing from field descriptions. Fixes CMB2#1404
  Add props for CMB2#1400
  move $args in deprecated_param method for 7.4
  Add develop suffix to init class
  Prepare release and changelog for 2.8.0
  Fix tests since WP_Error signature changed
  move $args in deprecated_param method for 7.4
  Use the already-existing get_priority method. Re CMB2#1380 and CMB2#1398
  Use existing "priority" field param. Fixes CMB2#1380. Closes CMB2#1398
  Add admin_menu_hook_priority box property for options boxes. Fixes CMB2#1380. Closes CMB2#1398
  Make field_can first param required to address php 8 "Required parameter follows optional parameter". Fixes CMB2#1396
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/CMB2_Utils.php
  Prevent array to string conversion
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/types/CMB2_Type_Colorpicker.php
  Update includes/types/CMB2_Type_Colorpicker.php
  Added sanitize_color() function and remove PHP warnings suppresions
  Fixes PHP warnings on repeatable ColorPicker with an array as default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants