PHPackages                             getolympus/olympus-dionysos-field-link - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. getolympus/olympus-dionysos-field-link

ActiveOlympus-field[Framework](/categories/framework)

getolympus/olympus-dionysos-field-link
======================================

Link field, this component is a part of the Olympus Dionysos fields.

v0.0.22(6y ago)02442MITJavaScript

Since Apr 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/GetOlympus/olympus-dionysos-field-link)[ Packagist](https://packagist.org/packages/getolympus/olympus-dionysos-field-link)[ Docs](https://github.com/GetOlympus/olympus-dionysos-field-link)[ RSS](/packages/getolympus-olympus-dionysos-field-link/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (1)Versions (24)Used By (2)

[![](https://github.com/GetOlympus/olympus-dionysos-field-link/raw/master/assets/field-link.png)](https://github.com/GetOlympus/olympus-dionysos-field-link/blob/master/assets/field-link.png)

Dionysos Link Field
===================

[](#dionysos-link-field)

[![Olympus Component](https://camo.githubusercontent.com/f483886a465a9e44005a352c6c1ba6556689a579ecf0d8b984cf60becaaa878c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f666f722d4f6c796d7075732d3434636331312e7376673f7374796c653d666c61742d737175617265)](https://github.com/GetOlympus)[![CodeFactor Grade](https://camo.githubusercontent.com/baf603645726a0680cc185a36bc723cf8da0b047d156bb0768cfcde7d56bb55f/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f4765744f6c796d7075732f6f6c796d7075732d64696f6e79736f732d6669656c642d6c696e6b2f62616467653f7374796c653d666c61742d737175617265)](https://www.codefactor.io/repository/github/getolympus/olympus-dionysos-field-link)[![Packagist Version](https://camo.githubusercontent.com/af9ffb5367e1e323c5f012db721140ffb3b5578cd7e419ca522bdadfb1d80fea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6765746f6c796d7075732f6f6c796d7075732d64696f6e79736f732d6669656c642d6c696e6b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/getolympus/olympus-dionysos-field-link)[![MIT](https://camo.githubusercontent.com/68035de4b7f69ada20e98e34172f47d361b83a017c8045200fc338660c467897/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49545f4c6963656e73652d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/GetOlympus/olympus-dionysos-field-link/blob/master/LICENSE)

> This component is a part of the **Olympus Dionysos fields** for **WordPress**. It uses the default `wpLink` WordPress javascript bundle to manage field.

```
composer require getolympus/olympus-dionysos-field-link
```

---

Table of contents
-----------------

[](#table-of-contents)

[Field initialization](#field-initialization) • [Variables definition](#variables-definition) • [Texts definition](#texts-definition) • [Retrive data](#retrive-data) • [Release History](#release-history) • [Contributing](#contributing)

---

Field initialization
--------------------

[](#field-initialization)

Use the following lines to add a `link field` in your **WordPress** admin pages or custom post type meta fields:

```
return \GetOlympus\Dionysos\Field\Link::build('my_link_field_id', [
    'title'       => 'Never gonna give you up!',
    'default'     => [
        [
            'url'    => 'https://www.youtube.com/watch?v=oVTPg9iicy4',
            'label'  => 'Never gonna get you down!',
            'target' => '_blank',
        ],
    ],
    'description' => 'You\'ve been Rick rolled!',
    'multiple'    => false,

    /**
     * Texts definition
     * @see the `Texts definition` section below
     */
    't_addblock_title'        => 'Click on the edit button',
    't_addblock_description'  => 'Click on the "+" button to add your link.',
    't_addblocks_description' => 'Click on the "+" button to add a link item.',
    't_addblock_label'        => 'Add',
    't_editblock_label'       => 'Edit',
    't_removeblock_label'     => 'Remove',
]);
```

Variables definition
--------------------

[](#variables-definition)

VariableTypeDefault value if not setAccepted values`title`String`'Hypertext link'`*empty*`default`Array*empty**empty*`description`String*empty**empty*`multiple`Boolean`false``true` or `false`Notes:

- Set `multiple` to `true` to enable the "Add link" button

Texts definition
----------------

[](#texts-definition)

CodeDefault valueDefinition`t_addblock_title`Click on the edit buttonMessage 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`AddUsed as an Add button area title`t_editblock_label`EditUsed as an Edit button area title`t_removeblock_label`RemoveUsed as a Remove button area titleRetrive data
------------

[](#retrive-data)

Retrieve your value from Database with a simple `get_option('my_link_field_id', [])` (see [WordPress reference](https://developer.wordpress.org/reference/functions/get_option/)).
Below, a `json_encode()` example to understand how data are stored in Database:

```
{
  "1": {
    "url": "https://www.google.com",
    "label": "Google.com",
    "target": "_self"
  },
  "2": {
    "url": "https://www.yahoo.com",
    "label": "Yahoo.com",
    "target": "_blank"
  }
}
```

And below, a simple example to show how to iterate on the data array in `PHP`:

```
// Get links from Database
$links = get_option('my_link_field_id', []);

// Check if links are empty
if (!empty($links)) {
    // Build HTML list
    echo '';

    foreach ($links as $link) {
        // Build HTML items
        echo '';
        echo '';
        echo $link['label'];
        echo '';
        echo '';
    }

    echo '';
}
```

Release history
---------------

[](#release-history)

VersionNote0.0.22Add editor's button stylesheet and wp-util javascript
Update README0.0.21JS compatibility0.0.20Fix display with new remove iconContributing
------------

[](#contributing)

1. Fork it ()
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](https://github.com/crewstyle "Achraf Chouk") ~ (c) since a long time.**

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~69 days

Recently: every ~12 days

Total

22

Last Release

2201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c255b14ebf8b792ba8b0c9940bd13e899281fc1431f1088af9074acdaa191cef?d=identicon)[crewstyle](/maintainers/crewstyle)

---

Top Contributors

[![crewstyle](https://avatars.githubusercontent.com/u/1572149?v=4)](https://github.com/crewstyle "crewstyle (47 commits)")

---

Tags

customfieldframeworkjquerylinkolympus-zeusphptwigwordpressphpframeworkwordpresslinkfieldcustomolympusdionysos

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/getolympus-olympus-dionysos-field-link/health.svg)

```
[![Health](https://phpackages.com/badges/getolympus-olympus-dionysos-field-link/health.svg)](https://phpackages.com/packages/getolympus-olympus-dionysos-field-link)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
