PHPackages                             marcusdevcode/carbon-fields-urlpicker - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. marcusdevcode/carbon-fields-urlpicker

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

marcusdevcode/carbon-fields-urlpicker
=====================================

Carbon Fields extension that adds a URL picker field type.

v3.x-dev(7mo ago)03GPL-2.0+JavaScript

Since Oct 6Pushed 7mo agoCompare

[ Source](https://github.com/marcusdevcode/carbon-fields-urlpicker)[ Packagist](https://packagist.org/packages/marcusdevcode/carbon-fields-urlpicker)[ RSS](/packages/marcusdevcode-carbon-fields-urlpicker/feed)WikiDiscussions v3 Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

Carbon Field: urlpicker
-----------------------

[](#carbon-field-urlpicker)

*(this is an extension of [Carbon Fields](http://carbonfields.net/) plugin)*

You can install it via composer:

```
composer require marcusdevcode/carbon-fields-urlpicker

```

If you install it from the source, you need to make sure that you also run `npm install` and `npm run production` in order to have assets compiled.

Return values:
--------------

[](#return-values)

The field will return an associative array with the following values:

```
url: the actual URL
anchor: the text anchor (might be blank)
blank: wether the link should open in a new window or not

```

Example
-------

[](#example)

### Registering A Field

[](#registering-a-field)

This goes in your `functions.php` as with other Carbon Fields fields. The only difference is that the type is `urlpicker`.

```
use Carbon_Fields\Container;
use Carbon_Fields\Field;

add_action( 'carbon_fields_register_fields', 'crb_url_picker_test' );

function crb_url_picker_test() {
  Container::make( 'post_meta', 'URL Picker Test' )
    ->add_fields( array(
      Field::make( 'urlpicker', 'crb_my_link', 'URL Picker Test' )
      ->set_help_text( "This is a test of the URL picker." )
    ));
}
```

### Using Field Values

[](#using-field-values)

```
