Download the PHP package getolympus/olympus-link-field without Composer
On this page you can find all versions of the php package getolympus/olympus-link-field. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download getolympus/olympus-link-field
More information about getolympus/olympus-link-field
Files in getolympus/olympus-link-field
Package olympus-link-field
Short Description Link field, this component is a part of the Olympus Dionysos fields.
License MIT
Homepage https://github.com/GetOlympus/olympus-dionysos-field-link
Informations about the package olympus-link-field
Dionysos Link Field
This component is a part of the Olympus Dionysos fields for WordPress. It uses the default
wpLink
WordPress javascript bundle to manage field.
Table of contents
Contributing
Field initialization
Use the following lines to add a link field
in your WordPress admin pages or custom post type meta fields:
Variables definition
Variable | Type | Default value if not set | Accepted values |
---|---|---|---|
title |
String | 'Hypertext link' |
empty |
default |
Array | empty | empty |
description |
String | empty | empty |
multiple |
Boolean | false |
true or false |
Notes:
- Set
multiple
totrue
to enable the "Add link" button
Texts definition
Code | Default value | Definition |
---|---|---|
t_addblock_title |
Click on the edit button | Message displayed on an item without link |
t_addblock_description |
Click on the "+" button to add your link. | Main helper to add a single item box |
t_addblocks_description |
Click on the "+" button to add a link item. | Main helper to add multiple items boxes |
t_addblock_label |
Add | Used as an Add button area title |
t_editblock_label |
Edit | Used as an Edit button area title |
t_removeblock_label |
Remove | Used as a Remove button area title |
Retrive data
Retrieve your value from Database with a simple get_option('my_link_field_id', [])
(see WordPress reference).
Below, a json_encode()
example to understand how data are stored in Database:
And below, a simple example to show how to iterate on the data array in PHP
:
Release history
Version | Note |
---|---|
0.0.22 | Add editor's button stylesheet and wp-util javascript Update README |
0.0.21 | JS compatibility |
0.0.20 | Fix display with new remove icon |
Contributing
- Fork it (https://github.com/GetOlympus/olympus-dionysos-field-link/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.