定制 innocode-digital/wp-cdn 二次开发

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

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

innocode-digital/wp-cdn

最新稳定版本:3.5.0

Composer 安装命令:

composer require innocode-digital/wp-cdn

包简介

Change all static files URLs to CDN domain.

README 文档

README

Description

Change all static files URLs to CDN domain.

Install

  • Preferable way is to use Composer:

    composer require innocode-digital/wp-cdn
    

    By default it will be installed as Must Use Plugin. But it's possible to control with extra.installer-paths in composer.json.

  • Alternate way is to clone this repo to wp-content/mu-plugins/ or wp-content/plugins/:

    cd wp-content/plugins/
    git clone git@github.com:innocode-digital/wp-cdn.git
    cd wp-cdn/
    composer install
    

If plugin was installed as regular plugin then activate CDN from Plugins page or WP-CLI: wp plugin activate wp-cdn.

Usage

Add required constant (usually to wp-config.php):

define( 'CDN_DOMAIN', '' ); // E.g. 'xxxxxx.cloudfront.net'

Documentation

It's possible to disable URL replace at all or for certain cases:

add_filter( 'innocode_cdn_should_replace_url', function ( $should_replace_url, $uri ) {
    return $should_replace_url;
}, 10, 2 );

It's possible to control a list of extensions:

add_filter( 'innocode_cdn_extensions', function ( array $extensions ) {
    return $extensions;
} );

It's possible to control a list of hosts:

add_filter( 'innocode_cdn_hosts', function ( array $hosts ) {
    return $hosts;
} );

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2019-10-23