kunoichi/theme-resource-sharing

用于共享主题资源的实用工具。

0.8.0 2019-08-09 11:30 UTC

This package is auto-updated.

Last update: 2024-09-09 22:57:17 UTC


README

在您的主题目录中共享资源。

安装

composer require kunoichi/theme-resource-sharing

如何使用

此Composer库为您的WordPress安装添加了CLI。从主题的资源文件夹(默认为 themes/your-theme/resource)导入/导出内容,您可以在开发团队之间共享您的设置。

// In your theme's functions.php
// 
Kunoichi\ThemeResourceSharing::enable( 'data' );

现在您可以随时运行以下命令。

导出

wp theme-resource export

此命令将导出以下WordPress设置

  • 数据库。默认名称为 wordpress.sql
  • 上传目录。

导入

wp theme-resource import --site_url=https://example.com

此命令将导入所有源文件夹中的数据。如果某人使用 https://example.local 而其他人使用 'https://:8888',请指定 --site_url 以更改导入的数据。

注意

  • 此命令旨在在私有仓库中使用。在公共仓库中请小心。这可能会导致 身份欺诈
  • 请勿将 resources 目录部署到公共空间!