定制 ouun/kirki-module-fonts_upload 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ouun/kirki-module-fonts_upload

最新稳定版本:v1.0.1

Composer 安装命令:

composer require ouun/kirki-module-fonts_upload

包简介

Easy custom fonts upload and CSS injection with Kirki WordPress plugin.

README 文档

README

This module allows uploading fonts (.woff, .woff2) via the regular WP Media Upload. Simply upload the font and it will be available in Typography Fields as Standard Font. Additionally the @font-face CSS is added to Kirki CSS Module output.

Requirements

  • Kirki Framework >=4.0
  • WordPress >= 4.6

Font Formats

By default the upload of .woff and .woff2 file is supported. You can use a filter to add other font mimes:

add_filter( 'kirki_upload_fonts_allowed_mimes', function( $mimes ) {
    return array_merge( $mimes, array(
        'ttf' => 'application/font-ttf'
    ) );
});

Additional Resources

You can add additional fonts (e.g. from your theme folder) by using the filter kirki_upload_fonts_available:

add_filter( 'kirki_upload_fonts_available', function( $fonts ) {
    return array_merge( $fonts, array(
        'my_font_name' => array(
            'name' => 'My Font Name,
            'type' => 'woff',
            'url'  => 'http://example.com/my_font.woff',
        }
    ) );
});

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-04-07