PHP code example of getolympus / olympus-radio-field
1. Go to this page and download the library: Download getolympus/olympus-radio-field 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-radio-field example snippets
return \GetOlympus\Dionysos\Field\Radio::build('my_radio_field_id', [
'title' => 'Select a Minion that you may know',
'default' => 'kevin',
'description' => 'A very important question! Pay attention to it ;)',
'mode' => 'default',
'options' => [
'kevin' => 'Kevin',
'mel' => 'Mel',
'dave' => 'Dave',
'bob' => 'Bob',
],
/**
* Texts definition
* @see the `Texts definition` section below
*/
't_no_options' => 'The field does no have any options.',
]);
// Get radio from Database
$radio = get_option('my_radio_field_id', '');
// Display value
echo '<h2><b>'.$radio.'</b>, master of the ceremony</h2>';