getolympus / olympus-dionysos-field-rte
RTE field, this component is a part of the Olympus Dionysos fields.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:olympus-field
Requires (Dev)
- phpunit/phpunit: ~5.3
README
Dionysos Rte Field
This component is a part of the Olympus Dionysos fields for WordPress.
It uses the default WordPress RTE field.
composer require getolympus/olympus-dionysos-field-rte
Table of contents
Field initialization • Variables definition • Retrive data • Release history • Contributing
Field initialization
Use the following lines to add a rte field
in your WordPress admin pages or custom post type meta fields:
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, ] ]);
Variables definition
Retrive data
Retrieve your value from Database with a simple get_option('my_rte_field_id', '')
(see WordPress reference):
// Get RTE from Database $rte = get_option('my_rte_field_id', ''); // Display RTE in HTML tag echo '<pre>'.htmlspecialchars($rte).'</pre>';
Release History
Contributing
- Fork it (https://github.com/GetOlympus/olympus-dionysos-field-rte/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Built with ♥ by Achraf Chouk ~ (c) since a long time.