定制 billerickson/be-media-from-production 二次开发

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

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

billerickson/be-media-from-production

最新稳定版本:v1.12.0

Composer 安装命令:

composer require billerickson/be-media-from-production

包简介

Uses local media when available, and uses the production server for the rest.

README 文档

README

Contributors: billerickson,magicroundabout
Requires at least: 4.3 Tested up to: 6.8
Stable tag: 1.12.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Uses local media when available, and uses the production server for the rest.

Description

When redesigning a website with a large uploads directory, you might not need all those uploads in your development or staging environment, but you also don't want to see broken images throughout the site.

This plugin lets you use the production server for missing media. Define the production URL using a constant BE_MEDIA_FROM_PRODUCTION_URL or filter be_media_from_production_url.

In all cases, if a local file exists, it will be used in preference to the remote file.

Installation

Once the plugin is installed, add the following constant to wp-config.php with your production URL.

define( 'BE_MEDIA_FROM_PRODUCTION_URL', 'https://www.billerickson.net' );

Alternatively, you can use the filter in your theme's functions.php file, a core functionality plugin, or a mu-plugin:

add_filter( 'be_media_from_production_url', function() {
	return 'https://www.billerickson.net';
});

Installation via WP-CLI and constants

wp plugin install https://github.com/billerickson/be-media-from-production/releases/latest/download/be-media-from-production.zip --force --activate
wp config set BE_MEDIA_FROM_PRODUCTION_URL https://www.billerickson.net --type=constant

Using with WP Migrate

WP Migrate is my preferred tool for pushing/pulling databases between environments. The media files functionality allows you to transfer media between environments along with the database.

When redesigning a website, I keep all the media on my development server and push up new media uploads along with the database.

Set up a "push" profile to push your local database to the development server. Make sure "Media Files" is checked and select "Compare, then upload".

Set up a "pull" profile to pull the development database locally. Do not include media in your pull. Any missing media will be handled by BE Media from Production.

统计信息

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

GitHub 信息

  • Stars: 241
  • Watchers: 12
  • Forks: 29
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2025-02-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固