Linux 软件免费装
Banner图

SVG Support

开发者 Benbodhi
更新时间 2022年12月13日 07:25
捐献地址: 去捐款
PHP版本: 7.2 及以上
WordPress版本: 6.1.1
版权: GPLv2 or later
版权网址: 版权信息

标签

css embed style js animation svg inline animate sanitize vector mime sanitization img mime type render safesvg sanitizer sanitise safe svg sanitisation sanitiser sanitized sanitised

下载

2.3.15 2.5.3 2.4 2.5.4 2.1.1 2.2.3.1 2.5 2.5.5 2.0 2.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2 2.2.1 2.2.2 2.2.3 2.2.3.2 2.2.4 2.2.5 2.3 2.3.1 2.3.10 2.3.11 2.3.12 2.3.13 2.3.14 2.3.16 2.3.17 2.3.18 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.5.1 2.3.21 2.3.9 1.0 2.4.1 2.3.19 2.3.20 2.3.8 2.4.2 2.5.2

详情介绍:

Safely upload SVG files to your media library and use them like any other image. Now with optional sanitization! But SVG Support has more features!!! Read on to learn more. When using SVG images on your WordPress site, it can be hard to style elements within the SVG using CSS. Now you can, easily! Scalable Vector Graphics (SVG) are becoming common place in modern web design, allowing you to embed images with small file sizes that are scalable to any visual size without loss of quality. This plugin not only provides SVG Support like the name says, it also allows you to easily embed your full SVG file's code using a simple IMG tag. By adding the class "style-svg" to your IMG elements (or outer containers), this plugin dynamically replaces any IMG elements containing an SVG in the src that are found inside the target class with your complete SVG code, rendering it inline. The main purpose of this is to allow styling and animation of your SVG elements. Usually your styling options are restricted when using embed, object or img tags alone. Features

屏幕截图:

  • Basic Settings
  • Advanced Settings
  • Featured Image checkbox to render SVG inline
  • SVG used in WP native Image Widget (since 4.9)
  • Inline SVG in the front end markup
  • Help tab - Overview
  • Help tab - The Settings
  • Help tab - Standard Usage
  • Help tab - Render SVG Inline (advanced usage)
  • Help tab - Featured Images
  • Help tab - Animation

升级注意事项:

2.5.5 Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating! 2.5.5 fixes more reported errors in the 2.5 series of updates. 2.5.4 Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating! 2.5.4 fixes errors in the 2.5 series of updates. 2.5.3 Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating! 2.5.3 fixes fatal error in 2.5.2. 2.5.2 Updating to 2.5+ Adds new features and addresses a number of earlier issues raised. Please take a backup before updating! 2.5.2 introduces some defaults for better security. 2.5.1 2.5 Adds new features and addresses a number of recent issues raised. Please take a backup before updating! 2.5.1 fixes the uninstall file. 2.5 Adds new features and addresses a number of recent issues raised. Please take a backup before updating! 2.4.2 2.4.2 fixes srcset issue firing PHP warnings for some themes and original image IDs missing on replacement to inline SVG. 2.4.1 2.4.1 fixes broken WP-CLI. Now featuring optional SVG sanitization and ability to target nested SVGs! This update contains a lot, please BACKUP YOUR DATABASE AND FILES BEFORE UPDATING! 2.4 Now featuring optional SVG sanitization and ability to target nested SVGs! This update contains a lot, please BACKUP YOUR DATABASE AND FILES BEFORE UPDATING! 2.3.21 Fixes featured image display on edit post screen. 2.3.20 Added more security. 2.3.19 Quick update to address PHP warnings from localize_script and to add a SRC check. 2.3.18 General clean up of plugin, testing on latest nightly build plus fixed issue with metadata being removed from non SVG attachments. 2.3.17 Added a setting to choose whether to load the frontend CSS file or not. It was previously enabled by default, so you may want to flick that on after the update. This allows you to leave it out so your site has one less file to load :) 2.3.16 This update addresses upload issues, PHP warnings and some frontend CSS changes with attachment display. 2.3.15 Had to roll back a recent PHP warnings fix due to it breaking some theme compatibility. 2.3.14 Fixes fatal error in some cases when removing old option from the database. 2.3.13 Update to address PHP warnings and notices on the image widget when wp_debug is enabled. 2.3.12
  • Wrapped the inline JS so you can call the inline function at will using bodhisvgsInlineSupport();. Added a native help tab. Removed the admin update notice. Did some general clean up of code and settings page. As always, it's best to take a full backup of your site before running any updates.
2.3.11
  • New Features and Fixes! Now you can force ALL of your SVG files (old and new) to be rendered inline in a single click with the new "Force Inline SVG" setting. You can also choose to use an expanded version of the inline JS if you want to minify it separately using a caching plugin or similar.
2.3.10
  • Fixed missing links in settings page.
2.3.9
  • Cleaned up some code and language, now stores less meta when not needed and added a plugin recommendation for Image Optimization.
2.3.8
  • Adds better support for WooCommerce and Sensei. Fixes issue with featured images not showing up when auto insert class setting is on.
2.3.7
  • Fixes issues with media library not loading for some, attachment-modal errors and adds some wider compatibility.
2.3.6
  • Adds support for older browsers, fixes a couple of seemingly isolated errors reported, removes some redundant code.
2.3.5
  • Modifications to thumbnail display code to prevent output buffer clash with another plugin.
2.3.4
  • Fixes fatal error for some because a function wasn't prefixed.
2.3.3
  • This update fixes some PHP warnings introduced in 2.3.2 and also has updated settings page text.
2.3.2
  • Changes to the way the auto class insert works.
2.3.1
  • Fixes fatal error in some cases due to admin notice in V2.3.
2.3 IMPORTANT, MAJOR CHANGES, BACKUP BEFORE UPDATING: Users that are inlining SVG will need to make sure "Advanced Mode" is active under "Settings > SVG Support". Your settings should all still be there. Make sure you run a backup before updating just in case!!! 2.2.5
  • Fix to display SVG thumbnails in attachment modals. (NOTE: You can not edit SVG files like other images in WordPress)
2.2.4
  • IMPORTANT: Fixes upload ability in WP 4.7.1
2.2.32
  • Changed text domain to match plugin slug for localization.
2.2.31
  • This release attempts to fix translation issues.
2.2.3
  • Feature - Changed code to allow JS detection if SVG has loaded and ability to control SVG using JS.
  • Fix - Thumbnail display in media library list view.
  • Added Spanish translation and cleaned up code/comments a bit.
2.2.2
  • Fix - Another change from anonymous function that was triggering errors for some.
2.2.1
  • Minor change to remove anonymous function that triggered a fatal error in older PHP versions.
2.2
  • Significant changes, added functionality, please BACKUP BEFORE UPDATING just in case.
2.1.7
  • Tested in WordPress 4.0 and added plugin icons for the new interface.
2.1.6
  • Important update! Added missing jQuery dependency in /functions/enqueue.php - was loading SVG Support JS before jQuery.
2.1.5
  • Added Serbian translation, submitted by Ogi Djuraskovic.
2.1.4
  • Some more re-arranging, added a few helpful links, updated language files, tended to my OCD a bit.
2.1.3
  • Added a link on the plugins page to the plugin settings page for easy access after install.
2.1.2
  • A little bit of house cleaning, updates to changelog and readme.txt for correct output with current version.
2.1.1
  • Update to conditional in JS file.
2.1
  • Updated language files for localization that were missed in version 2.0.
2.0
  • SVG Support has been completely re-written and re-structured. It now includes an admin settings page with instructions, plus options for restricting to admin use only and setting a custom CSS target class.
1.0
  • Initial Release.

常见问题:

SVG not rendering inline since 2.3 update

SVG Support 2.3 includes a new settings section called "Advanced Mode". Users that were inlining SVG files need to make sure this setting is checked. Go to your dashboard > Settings > SVG Support and check "Advanced Mode". All of your original settings should still be there.

How do I disable the Javascript on the front end if I am not using inline SVG?

If you go to Settings > SVG Support in your admin dashboard, you can choose to enable "Advanced Mode" or not. If you leave it disabled, the advanced functionality and extraneous script is removed.

I'm trying to use SVG in the customizer but it's not working.

To allow SVG to work in the customizer, you will need to modify/add some code in your child theme's function file. Here is a great tutorial on how to do that. The important part is: 'flex-width' => true 'flex-height' => true

How do I add animation to my SVG?

You will need to edit your SVG file in a code editor so you can add CSS classes to each element you need to target within the SVG. Make sure that your IMG tag is being swapped out for your inline SVG and then you can use CSS or JS to apply animations to elements within your SVG file.

Why is SVG Support not working in multisite?

If you installed multisite prior to WordPress 3.5, then you will need to remove your ms-files. Here is a couple of resources to help you: Dumping ms-files Removing ms-files after 3.5.

Why is my SVG not working in Visual Composer?

If you are using SVG Support with Visual Composer or any other page builders, you will need to make sure that you can add your own class to the image. The easiest way to do this is by using a simple text or code block in the builder to put your image code in to. Additionally, there is now a setting to force all SVG files to be rendered inline.

How do I get this to work with the Media Library Assistant plugin?

You need to add the mime type for svg and svgz to: "MLA Settings > Media Library Assistant > Uploads (tab)" and then it works.

更新日志:

2.5.5 2.5.4 2.5.3 2.5.2 2.5.1 2.5 2.4.2 2.4.1 2.4 2.3.21 2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 2.3.12 2.3.11 2.3.10 2.3.9 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.3 2.2.5 2.2.4 2.2.32 2.2.31 2.2.3 2.2.2 2.2.1 2.2 2.1.7 2.1.6 2.1.5 2.1.4 2.1.3 2.1.2 2.1.1 2.1 2.0 1.0