我的主题定义了自己的actions 和filters 这样它就可以由第三方进行扩展,而无需派生或修改主题的核心代码。
我已经有了一些特定于我的主题的插件,我正在以通常的方式安装这些插件wp-content/plugins
并通过管理面板激活。
然而,为了便于使用,我想bundle a few plugins directly into my Theme itself, 例如,在my_theme/plugins
, 无需要求用户将要安装的插件移动到WordPress插件目录(从而破坏主题的更新功能等)。
Have you seen any Theme or Plugin that does that in an elegant way? What are best practices to doing that?
特别是,如果我要实施这样一个系统,我会想到几个问题:除了wp-content/plugins
?
编辑:与相关,但不同于,Are drop-in plugins a product of design 和Add Plugins to Wordpress Theme: 在目前的情况下,插件没有主题(它们扩展了主题)就没有意义,它们是由同一个人/公司编写的