2017 © Pedro Peláez
 

olympus-field olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Zeus Core framework.

image

getolympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Zeus Core framework.

  • Saturday, March 17, 2018
  • by crewstyle
  • Repository
  • 1 Watchers
  • 0 Stars
  • 176 Installations
  • CSS
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

, (*1)

Dionysos Toggle Field

Olympus Component ![CodeFactor Grade][codefactor-image] Packagist Version ![MIT][license-image], (*2)

This component is a part of the Olympus Dionysos fields for WordPress., (*3)

composer require getolympus/olympus-dionysos-field-toggle

Table of contents

Field initializationVariables definitionRetrive dataRelease historyContributing, (*4)


Field initialization

Use the following lines to add a toggle field in your WordPress admin pages or custom post type meta fields:, (*5)

return \GetOlympus\Dionysos\Field\Toggle::build('my_toggle_field_id', [
    'title'       => 'Get ready to rumble!',
    'default'     => true,
    'description' => 'Put it on to get started',
]);

Variables definition

Variable Type Default value if not set Accepted values
title String 'Toggle' empty
default Boolean false true or false
description String empty empty

Retrive data

Retrieve your value from Database with a simple get_option('my_toggle_field_id', false) (see WordPress reference):, (*6)

// Get toggle from Database
$toggle = get_option('my_toggle_field_id', false);

// Display toggle in HTML tag
echo $toggle ? 'Let\'s go!' : 'Not ready yet.';

Release history

Version Note
0.0.16 Use WordPress default design to display toggle box
0.0.15 Use default getVars Zeus-Core method. No need to override it anymore
0.0.14 New Olympus components compatibilitybr/Change repository to be a part of Dionysos fields

Contributing

  1. Fork it (https://github.com/GetOlympus/olympus-dionysos-field-toggle/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., (*7)

The Versions

17/03 2018

dev-master

9999999-dev https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus zeus hera

17/03 2018

v0.0.7

0.0.7.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Zeus Core framework.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus zeus

08/10 2016

v0.0.6

0.0.6.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus hera

22/08 2016

v0.0.5

0.0.5.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus hera

26/06 2016

v0.0.4

0.0.4.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus hera

10/05 2016

v0.0.3

0.0.3.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus hera

05/05 2016

v0.0.2

0.0.2.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus hera

29/04 2016

v0.0.1

0.0.1.0 https://github.com/GetOlympus/olympus-toggle-field

[READ-ONLY] Toggle field, this component is a part of the Olympus Hera WordPress library.

  Sources   Download

MIT

The Requires

 

The Development Requires

framework php field toggle olympus hera