{"id":17808123,"url":"https://github.com/getolympus/olympus-dionysos-field-toggle","last_synced_at":"2026-04-09T08:10:47.045Z","repository":{"id":62510304,"uuid":"57395419","full_name":"GetOlympus/olympus-dionysos-field-toggle","owner":"GetOlympus","description":"Διώνυσος — Toggle field, this component is a part of the Olympus Dionysos fields for WordPress.","archived":false,"fork":false,"pushed_at":"2023-12-18T21:02:50.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T06:13:20.747Z","etag":null,"topics":["css3","custom","field","framework","olympus-zeus","php","toggle","twig","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Less","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GetOlympus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-04-29T15:41:53.000Z","updated_at":"2023-12-18T18:58:08.000Z","dependencies_parsed_at":"2024-10-27T15:14:00.095Z","dependency_job_id":"e9d00b2a-17de-4509-94b2-3f184ca28979","html_url":"https://github.com/GetOlympus/olympus-dionysos-field-toggle","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetOlympus%2Folympus-dionysos-field-toggle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetOlympus%2Folympus-dionysos-field-toggle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetOlympus%2Folympus-dionysos-field-toggle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GetOlympus%2Folympus-dionysos-field-toggle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GetOlympus","download_url":"https://codeload.github.com/GetOlympus/olympus-dionysos-field-toggle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246763955,"owners_count":20829800,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css3","custom","field","framework","olympus-zeus","php","toggle","twig","wordpress"],"created_at":"2024-10-27T15:06:20.991Z","updated_at":"2026-04-09T08:10:47.002Z","avatar_url":"https://github.com/GetOlympus.png","language":"Less","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://github.com/GetOlympus/olympus-dionysos-field-toggle/blob/master/assets/field-toggle.png\" align=\"left\" /\u003e\n\n# Dionysos Toggle Field\n\n[![Olympus Component][olympus-image]][olympus-url]\n[![CodeFactor Grade][codefactor-image]][codefactor-url]\n[![Packagist Version][packagist-image]][packagist-url]\n[![MIT][license-image]][license-blob]\n\n\u003e This component is a part of the **Olympus Dionysos fields** for **WordPress**.\n\n```sh\ncomposer require getolympus/olympus-dionysos-field-toggle\n```\n\n---\n\n## Table of contents\n\n[Field initialization](#field-initialization) • [Variables definition](#variables-definition) • [Retrive data](#retrive-data) • [Release history](#release-history) • [Contributing](#contributing)\n\n---\n\n## Field initialization\n\nUse the following lines to add a `toggle field` in your **WordPress** admin pages or custom post type meta fields:\n\n```php\nreturn \\GetOlympus\\Dionysos\\Field\\Toggle::build('my_toggle_field_id', [\n    'title'       =\u003e 'Get ready to rumble!',\n    'default'     =\u003e true,\n    'description' =\u003e 'Put it on to get started',\n]);\n```\n\n## Variables definition\n\n| Variable      | Type    | Default value if not set | Accepted values |\n| ------------- | ------- | ------------------------ | --------------- |\n| `title`       | String  | `'Toggle'` | *empty* |\n| `default`     | Boolean | `false` | `true` or `false` |\n| `description` | String  | *empty* | *empty* |\n\n## Retrive data\n\nRetrieve your value from Database with a simple `get_option('my_toggle_field_id', false)` (see [WordPress reference][getoption-url]):\n\n```php\n// Get toggle from Database\n$toggle = get_option('my_toggle_field_id', false);\n\n// Display toggle in HTML tag\necho $toggle ? 'Let\\'s go!' : 'Not ready yet.';\n```\n\n## Release history\n\n| Version | Note |\n| :------ | :--- |\n| 0.0.16  | Use WordPress default design to display toggle box |\n| 0.0.15  | Use default `getVars` Zeus-Core method. No need to override it anymore |\n| 0.0.14  | New Olympus components compatibility\u003cbr/\u003eChange repository to be a part of Dionysos fields |\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/GetOlympus/olympus-dionysos-field-toggle/fork\u003e)\n2. Create your feature branch (`git checkout -b feature/fooBar`)\n3. Commit your changes (`git commit -am 'Add some fooBar'`)\n4. Push to the branch (`git push origin feature/fooBar`)\n5. Create a new Pull Request\n\n---\n\n**Built with ♥ by [Achraf Chouk](https://github.com/crewstyle \"Achraf Chouk\") ~ (c) since a long time.**\n\n\u003c!-- links \u0026 imgs dfn's --\u003e\n[olympus-image]: https://img.shields.io/badge/for-Olympus-44cc11.svg?style=flat-square\n[olympus-url]: https://github.com/GetOlympus\n[codefactor-image]: https://www.codefactor.io/repository/github/GetOlympus/olympus-dionysos-field-toggle/badge?style=flat-square\n[codefactor-url]: https://www.codefactor.io/repository/github/getolympus/olympus-dionysos-field-toggle\n[getoption-url]: https://developer.wordpress.org/reference/functions/get_option/\n[license-blob]: https://github.com/GetOlympus/olympus-dionysos-field-toggle/blob/master/LICENSE\n[license-image]: https://img.shields.io/badge/license-MIT_License-blue.svg?style=flat-square\n[packagist-image]: https://img.shields.io/packagist/v/getolympus/olympus-dionysos-field-toggle.svg?style=flat-square\n[packagist-url]: https://packagist.org/packages/getolympus/olympus-dionysos-field-toggle","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetolympus%2Folympus-dionysos-field-toggle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetolympus%2Folympus-dionysos-field-toggle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetolympus%2Folympus-dionysos-field-toggle/lists"}