承接 digimix/wp-svg-upload 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

digimix/wp-svg-upload

Composer 安装命令:

composer require digimix/wp-svg-upload

包简介

Adds full SVG media support to WordPress.

关键字:

README 文档

README

Install with Composer composer require digimix/wp-svg-upload

Install manually

  1. Clone or copy the files into your WordPress plugins directory
  2. Activate the plugin from the dashboard or using WP CLI

Once the plugin is activated, you're good to go. Your WordPress media library will support uploading SVG files.

##Logic Breakdown

    1. We need the whole page, but only if we are in the backend (hence admin_init hook)
    1. We would like to grab all output (ob_start within admin_init as nothing should echo before that, we should not interfere with things that do)
    1. We want to grab the content on shutdown, concatenate all output buffers, then filter
    1. Search for placeholders which should exist and replace the text
  • Downsides
    1. Not permanent fix (for perma fix WP core would need to be editable or native filtering added)
    1. A bit resource munchy (it's locked to the admin side, so IMHO who cares)
    1. This is just to get SVG into WP core... Luckily the find replace is that simple in /wp-includes/media-template.php (Patch it Mullweng & Co!)

Changes...

  • Re-factored function declaration and calls to make compatible with lesser PHP versions, despite believing anyone using such versions is dangerous
  • Added param for mime-types to filter_mimes function
  • Moved into a namespace and class to make the whole thing less hack-and-slash
  • Updated to use short-array syntax (Breaking change update your PHP or don't use)
  • Deleted some dead code I never noticed before

Credits

统计信息

  • 总下载量: 383
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-05-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固