PHP code example of getolympus / olympus-dionysos-field-text
1. Go to this page and download the library: Download getolympus/olympus-dionysos-field-text library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
getolympus / olympus-dionysos-field-text example snippets
return \GetOlympus\Dionysos\Field\Text::build('my_text_field_id', [
'title' => 'What do you like?',
'default' => 'Penguins, I am sure they\'re gonna dominate the World!',
'description' => 'Put in here everything you want.',
'placeholder' => 'McDonald\'s as well',
'type' => 'text',
/**
* Settings definition
* @see the `Settings definition` section below
*/
'settings' => [],
]);
// Get text from Database
$text = get_option('my_text_field_id', '');
// Display text
echo $text;