metabolism / wordpress-bundle
使用 WordPress 构建企业级解决方案
Requires
- php: >=8.1
- ext-ctype: *
- ext-curl: *
- ext-fileinfo: *
- ext-gd: *
- ext-iconv: *
- ext-json: *
- ext-mbstring: *
- ext-mysqli: *
- ext-openssl: *
- ext-pcre: *
- ext-session: *
- ext-simplexml: *
- ext-zip: *
- dflydev/dot-access-data: ^3.0
- enshrined/svg-sanitize: ^0.18
- ifsnop/mysqldump-php: ^2.0
- intervention/image: ^3.4.0
- johnpbloch/wordpress-core: ^5.0|^6.0
- kornrunner/blurhash: ^1.2.2
- metabolism/package-actions: ^1.0
- metabolism/void: ^2.0
- metabolism/wordpress-core-installer: ^1.0
- metabolism/wp-steroids: ^1.3.0
- oscarotero/env: ^2.1
- symfony/asset: ^4.0|^5.0
- symfony/http-client: ^4.0|^5.0
- symfony/templating: ^4.0|^5.0
- symfony/twig-bundle: ^4.0|^5.0
Suggests
- metabolism/acf-extensions: Extensions for ACF
- wpackagist-plugin/advanced-custom-fields: Customise WordPress with powerful, professional and intuitive fields.
- wpackagist-plugin/classic-editor: Restores the previous (« classic ») WordPress editor and the « Edit Post » screen.
- wpackagist-plugin/contact-form-7: Manage multiple contact forms, plus you can customize the form and the mail contents
- wpackagist-plugin/multisite-language-switcher: Add multilingual support using a WordPress multisite
- wpackagist-plugin/query-monitor: Query Monitor is the developer tools panel for WordPress.
- wpackagist-plugin/redirection: Easily manage 301 redirections, keep track of 404 errors
- wpackagist-plugin/relevanssi: Replaces the standard WordPress search with a better search engine, with lots of features and configurable options.
- wpackagist-plugin/wordpress-seo: The favorite WordPress SEO plugin of millions of users worldwide!
- wpackagist-plugin/wp-2fa: Harden your website login page; add two-factor authentication (2FA) for all your users with this easy to use plugin.
- wpackagist-plugin/wp-smartcrop: Set the 'focal point' of any image, right from the media library
- 2.3.x-dev
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.x-dev
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.x-dev
- 2.1.7
- 2.1.6
- 2.1.5
- 2.1.4
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.x-dev
- 2.0.2
- 2.0.1
- 2.0.0
- 1.4.x-dev
- 1.4.16
- 1.4.15
- 1.4.14
- 1.4.13
- 1.4.12
- 1.4.11
- 1.4.10
- 1.4.9
- 1.4.8
- 1.4.7
- 1.4.6
- 1.4.5
- 1.4.4
- 1.4.3
- 1.4.2
- 1.4.1
- 1.4.0
- 1.3.11
- 1.3.10
- 1.3.9
- 1.3.8
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.7
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-tests
This package is auto-updated.
Last update: 2024-09-11 14:53:37 UTC
README
使用 WordPress 构建企业级解决方案。
Symfony WordPress 后台管理包是一个强大的库,它将强大的 PHP 框架 Symfony 的灵活性与流行的内容管理系统 (CMS) WordPress 的用户友好性无缝结合。
此包使您能够利用 Symfony 的结构来开发高度定制的网络应用程序,同时使用 WordPress 作为内容管理的后端。它简化了 WordPress 与您的 Symfony 项目的集成,让您充分利用两者的优势。
它是如何工作的?
当 WordPress 包被加载时,它会选择性地包含用于在 Symfony 中利用 WordPress 功能和插件的必需的 WordPress 核心文件。
示例
// src/Controller/BlogController.php /** * @param Post $post * @param PostRepository $postRepository * @return Response */ public function pageAction(Post $post, PostRepository $postRepository) { $context = []; // get current post $context['post'] = $post; // find 10 "guide" ordered by title $context['guides'] = $postRepository->findBy(['post_type'=>'guide'], ['title'=>'ASC'], 10); return $this->render('page.html.twig', $context); }
{# templates/page.html.twig #} {% extends 'layout.html.twig' %} {% block body %} <article id="post-{{ post.ID }}" class="entry {{ post.class }}"> {% if post.thumbnail %} <img src="{{ post.thumbnail|resize(800, 600) }}" alt="{{ post.thumbnail.alt }}"/> {% endif %} <div class="entry-content"> {{ post.content|raw }} {# or #} {% for block in post.blocks %} {% include 'block/'~block.name~'.html.twig' %} {% endfor %} </div> <small>{{ post.custom_fields.mention }}</small> {% for guide in guides %} {% include 'guide.html.twig' with {props:guide} %} {% endfor %} </article> {% endblock body %}
文档
变更日志
请参阅 变更日志 了解最近的变化。
特性
使用 Composer
- 通过 composer 安装/更新 WordPress
- 通过 composer 安装/更新插件
使用 Symfony
- Twig 模板引擎
- 文件夹结构
- HTTP 缓存
- 路由
- YML 配置
- DotEnv
- 增强安全性(WordPress 被隐藏)
- 动态图片缩放
- MVC
使用 WordPress 包
- 帖子/术语/用户存储库
- 帖子、术语、用户和博客的控制器参数解析器
- 更新时的 Symfony 缓存失效(与 Varnish 兼容)
- 帖子/帖子集合/图片/菜单/术语/用户/评论/博客/块实体
- 可以使用 WordPress 预定义的路由
- 站点健康检查 URL
使用 WP Steroids WordPress 插件
- 使用 yml 配置 WordPress(查看示例)
- 自定义帖子类型和分类的永久链接配置
- 维护模式
- 开发模式下备份下载
- 构建钩子
- 禁用自动更新
- 增强安全性
- 使用符合 RFC 4122 标准的 UUID 版本 5 的更好的 guid
- 多站点图片同步(对于多语言的多站点)
- SVG 支持
- 更好的性能
- WordPress Bugfix
- CSS 修复
- 多站点帖子深度复制(与多站点语言切换插件一起使用)
- 带有查看和删除操作的行政界面中的自定义数据表支持
- Google 翻译或 Deepl 集成
- 优化
YML 文件允许配置
- 图片选项
- 维护支持
- 删除管理页面
- 所见即所得 MCE 编辑器
- 特性支持
- 多站点配置
- ACF/Carbon Fields 配置
- 菜单
- 自定义帖子类型
- 自定义分类法
- 块
- 页面、帖子、分类模板
- 页面状态
- 帖子格式
- 外部表格查看器
- 高级角色
安装
请确保已全局安装 Composer,如 Composer 文档中的安装章节所述。
创建新项目
$ composer create-project metabolism/wordpress-skeleton my_project_directory
请阅读完整的包安装指南以继续
设置现有Symfony项目
在composer.json
中定义WordPress核心和插件的安装路径
"extra": { "installer-paths": { "public/wp-bundle/mu-plugins/{$name}/": ["type:wordpress-muplugin"], "public/wp-bundle/plugins/{$name}/": ["type:wordpress-plugin"], "public/wp-bundle/themes/{$name}/": ["type:wordpress-theme"], "public/edition/": ["type:wordpress-core"] } }
安装包
$ composer require metabolism/wordpress-bundle
对于不使用Symfony Flex的应用程序
注册包
// config/bundles.php return [ // ... Metabolism\WordPressBundle\WordPressBundle::class => ['all' => true], ];
请阅读完整的包安装指南以继续
演示
https://github.com/metabolism/wordpress-bundle-demo
这是为wordpress-bundle实现的Twenty Nineteen WordPress主题。
推荐/测试插件
- 高级自定义字段使用强大、专业和直观的字段定制WordPress。
- ACF扩展 ACF的扩展
- 经典编辑器 恢复之前的(“经典”)WordPress编辑器和“编辑帖子”屏幕。
- WP智能裁剪 直接从媒体库设置任何图像的“焦点点”
- 多站点语言切换器 使用WordPress多站点添加多语言支持
- WordPress SEO 全球数百万用户的喜爱的WordPress SEO插件!
- 查询监视器 Query Monitor是WordPress的开发者工具面板
- 重定向轻松管理301重定向,跟踪404错误
- 联系表单7 管理多个联系表单,还可以自定义表单和邮件内容
路线图
- 更多示例
- 多站点的全局维护模式
- 单元测试
- 更好的类型提示
缺点
WordPress的函数在全局命名空间中可用。
某些WordPress插件可能无法正常工作(例如:Woocommerce)或需要额外的工作。
树状文档
此包是TreeWare。如果您在生产环境中使用它,那么我们要求您为世界种一棵树以感谢我们的工作。通过为TreeWare森林做出贡献,您将为当地家庭创造就业机会并恢复野生动物栖息地。
许可证
MIT许可证(MIT)。有关更多信息,请参阅许可证文件。