getolympus / olympus-dionysos-field-textarea
文本区域字段,此组件是 Olympus Dionysos 字段的一部分。
v0.0.18
2023-12-20 22:17 UTC
Requires (Dev)
- phpunit/phpunit: ~5.3
README
Dionysos 文本区域字段
此组件是 WordPress 的 Olympus Dionysos 字段 的一部分。
在文本区域添加一个计数器 JS 组件。
composer require getolympus/olympus-dionysos-field-textarea
目录
字段初始化 • 变量定义 • 文本定义 • 检索数据 • 发布历史 • 贡献
字段初始化
使用以下行在您的 WordPress 管理页面或自定义文章类型元字段中添加 textarea field
return \GetOlympus\Dionysos\Field\Textarea::build('my_textarea_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.', 'counter' => true, 'placeholder' => 'Tell us how?', 'readonly' => false, 'rows' => 8, /** * Texts definition * @see the `Texts definition` section below */ 't_length_label' => 'characters.', ]);
变量定义
文本定义
检索数据
使用简单的 get_option('my_textarea_field_id', '')
从数据库检索您的值(见 WordPress 参考)
// Get textarea from Database $textarea = get_option('my_textarea_field_id', ''); // Display textarea in HTML tag echo '<pre>'.htmlspecialchars($textarea).'</pre>';
发布历史
贡献
- 分支它 (https://github.com/GetOlympus/olympus-dionysos-field-textarea/fork)
- 创建您的功能分支 (
git checkout -b feature/fooBar
) - 提交您的更改 (
git commit -am 'Add some fooBar'
) - 推送到分支 (
git push origin feature/fooBar
) - 创建一个新的 Pull Request
由 Achraf Chouk 用♥构建 ~ (c) 很久以前。