alleyinteractive / wp-newsletter-builder
管理电子邮件通讯接口
Requires
- php: ^8.1
- alleyinteractive/composer-wordpress-autoloader: ^1.0
- campaignmonitor/createsend-php: ^7.0
- sendgrid/sendgrid: ^8.1
- tijsverkoyen/css-to-inline-styles: ^2.2
Requires (Dev)
- dev-develop
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.35
- v0.3.34
- v0.3.33
- v0.3.32
- v0.3.31
- v0.3.30
- v0.3.29
- v0.3.28
- v0.3.27
- v0.3.26
- v0.3.25
- v0.3.24
- v0.3.23
- v0.3.22
- v0.3.21
- v0.3.20
- v0.3.19
- v0.3.18
- v0.3.17
- v0.3.16
- v0.3.15
- v0.3.14
- v0.3.13
- v0.3.12
- v0.3.11
- v0.3.10
- v0.3.9
- v0.3.8
- v0.3.7
- v0.3.6
- v0.3.5
- v0.3.4
- v0.3.3
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.0
- v0.1.0
- dev-dependabot/npm_and_yarn/typescript-5.6.2
- dev-dependabot/npm_and_yarn/types/jest-29.5.13
- dev-develop-built
- dev-feature/issue-97/remove-fieldmanager-dependency
- dev-feature/LEDE-2632/update-sendgrid-account-redirect
- dev-debug-built
- dev-fix/issue-122/disable-editor-styles-newsletter-screen
- dev-feature/issue-19/breaking-news-meta-box-classic
- dev-feature/issue-17/add-url-override-post-block
- dev-hotfix/email-settings-on-template
- dev-hotfix/remove-singleton
- dev-hotfix/node-version
- dev-release/v0.1.0-4
- dev-release/v0.1.0-3
This package is auto-updated.
Last update: 2024-09-14 13:38:47 UTC
README
贡献者:alleyinteractive
标签:alleyinteractive, wp-newsletter-builder
稳定版本:0.3.35
至少需要:6.2
测试到:6.4.1
需要PHP:8.0
许可证:GPL v2或更高版本
管理电子邮件通讯接口。创建自定义文章类型。
安装
您可以通过composer安装此包
composer require alleyinteractive/wp-newsletter-builder
用法
在WordPress中激活插件并按如下方式使用它
$plugin = WP_Newsletter_Builder\WP_Newsletter_Builder\WP_Newsletter_Builder(); $plugin->perform_magic();
启用电子邮件提供商
插件支持多个电子邮件提供商。要启用电子邮件提供商,将以下代码添加到主题中的插件或函数 wp-newsletter-builder-PROVIDER.php
做出此决定是为了让只有开发者才能切换电子邮件提供商(但未来可能会为此创建一个设置页面。)
<?php /** * Plugin Name: PROVIDER for WP Newsletter Builder * Description: Plugin to enable PROVIDER as an email provider for WP Newsletter Builder. * Version: 0.1.0 * Author: Alley * * Text Domain: newsletter-testing * Domain Path: /languages/ * * @package newsletter-testing */ add_filter( 'wp_newsletter_builder_selected_provider', fn( $provider ) => 'WP_Newsletter_Builder\Email_Providers\PROVIDER' );
过滤在文章选择器中可用的文章类型
插件允许过滤Gutenberg文章选择器中可用的文章类型。文章选择器在wp-newsletter-builder/post
块中作为单个文章选择器出现,在wp-newsletter-builder/section
块中作为多个文章选择器出现。
例如,为了允许自定义podcast
文章类型出现在文章选择器中,同时还有默认的post
文章类型
add_filter( 'wp_newsletter_builder_allowed_post_types', function( array $allowed_post_types ) { $allowed_post_types[] = 'podcast'; return $allowed_post_types; } );
测试
运行npm run test
来运行针对JavaScript文件的Jest测试。运行npm run test:watch
以保持测试运行器打开并监视更改。
运行npm run lint
来运行针对所有JavaScript文件的ESLint。在运行开发或生产构建时也会发生linting。
运行composer test
来运行针对PHPUnit和插件中的PHP代码的测试。
entries目录和入口点
在entries
目录中创建的所有目录都可以作为入口点,并将使用@wordpress/scripts编译到build
目录中,并附带index.asset.php
资产映射。
队列入口点
您还可以在入口点目录中包含一个index.php
文件以排队或注册脚本。然后,该文件将被移动到构建目录,并使用functions.php
文件中的load_scripts()
函数自动加载。或者,如果脚本要在其他地方排队,则src/assets.php
文件中有辅助函数用于获取资产。
使用create-block
脚手架构建块
使用create-block
命令和@wordpress/create-block
创建自定义块,并按照提示在blocks/
目录中生成所有块资产。块注册、脚本创建等将从bin/create-block/templates/block/
模板中脚手架化。运行npm run build
来编译和构建自定义块。块使用src/assets.php
中的load_scripts()
函数排队。
更新WP依赖项
更新项目中使用的WordPress依赖包到最新版本。
要更新@wordpress
依赖项到最新版本,请使用packages-update命令
npx wp-scripts packages-update
此脚本提供了以下自定义选项
--dist-tag
– 允许在更新 npm 包时指定自定义的 dist-tag。默认为latest
。这在使用@wordpress/dependency-extraction-webpack-plugin
时特别有用。它可以让您安装与指定 WordPress 主版本使用的版本相同的 npm 依赖项,以便进行本地测试等。示例
npx wp-scripts packages-update --dist-tag=wp-WPVERSION`
其中 WPVERSION
是您要针对的 WordPress 版本。版本必须包含主版本和次要版本(例如,6.1
)。例如
npx wp-scripts packages-update --dist-tag=wp-6.1`
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG。
鸣谢
该项目由 Alley Interactive 主动维护。喜欢您看到的内容?加入我们的团队。
- [Alley Interactive](https://github.com/Alley Interactive)
- 所有贡献者
许可证
GNU 通用公共许可证 (GPL)。有关更多信息,请参阅 许可证文件。