getolympus / olympus-dionysos-field-rte
RTE 字段,此组件是 Olympus Dionysos 字段的一部分。
v0.0.1
2023-12-17 22:26 UTC
Requires (Dev)
- phpunit/phpunit: ~5.3
README
Dionysos Rte Field
此组件是用于 WordPress 的 Olympus Dionysos 字段 的一部分。
它使用默认的 WordPress RTE 字段。
composer require getolympus/olympus-dionysos-field-rte
目录
字段初始化 • 变量定义 • 数据检索 • 发布历史 • 贡献
字段初始化
使用以下行在您的 WordPress 管理页面或自定义文章类型元字段中添加 rte 字段
return \GetOlympus\Dionysos\Field\Rte::build('my_rte_field_id', [ 'title' => 'How do Penguins drink their cola?', 'default' => 'On the rocks.', 'description' => 'A simple question to know if you will be able to survive to the Penguin domination.', /** * RTE settings * @see https://codex.wordpress.org/Function_Reference/wp_editor */ 'settings' => [ 'teeny' => false, 'textarea_rows' => 8, ] ]);
变量定义
数据检索
使用简单的 get_option('my_rte_field_id', '')
从数据库中检索您的值(见 WordPress 参考)
// Get RTE from Database $rte = get_option('my_rte_field_id', ''); // Display RTE in HTML tag echo '<pre>'.htmlspecialchars($rte).'</pre>';
发布历史
贡献
- 分叉它 (https://github.com/GetOlympus/olympus-dionysos-field-rte/fork)
- 创建您的功能分支 (
git checkout -b feature/fooBar
) - 提交您的更改 (
git commit -am 'Add some fooBar'
) - 推送到分支 (
git push origin feature/fooBar
) - 创建一个新的 Pull Request
由 Achraf Chouk 使用♥构建 ~ (c) 很久以前。