定制 getolympus/olympus-dionysos-field-textarea 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

getolympus/olympus-dionysos-field-textarea

Composer 安装命令:

composer require getolympus/olympus-dionysos-field-textarea

包简介

Textarea field, this component is a part of the Olympus Dionysos fields.

README 文档

README

Dionysos Textarea Field

Olympus Component CodeFactor Grade Packagist Version MIT

This component is a part of the Olympus Dionysos fields for WordPress.
Adds a counter JS component on textarea.

composer require getolympus/olympus-dionysos-field-textarea

Table of contents

Field initializationVariables definitionTexts definitionRetrive dataRelease HistoryContributing

Field initialization

Use the following lines to add a textarea field in your WordPress admin pages or custom post type meta fields:

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.',
]);

Variables definitions

Variable Type Default value Accepted value Description
title String 'Textarea' empty
default String empty empty Sets default value if none found
description String empty empty
counter Boolean true true or false Defines whether or not to display the counter widget
placeholder String empty empty For default mode only
readonly Boolean false true or false Defines whether or not to allow modification
rows Integer 8 > 1

Texts definition

Code Default value Definition
t_length_label characters. Used to display characters counter as %d characters.

Retrive data

Retrieve your value from Database with a simple get_option('my_textarea_field_id', '') (see WordPress reference):

// Get textarea from Database
$textarea = get_option('my_textarea_field_id', '');

// Display textarea in HTML tag
echo '<pre>'.htmlspecialchars($textarea).'</pre>';

Release History

Version Note
0.0.18 Fix jQuery integration on domReady
0.0.17 Change id on twig template
0.0.16 Remove RTE mode from package

Contributing

  1. Fork it (https://github.com/GetOlympus/olympus-dionysos-field-textarea/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Built with ♥ by Achraf Chouk ~ (c) since a long time.

统计信息

  • 总下载量: 229
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固