PHPackages                             basduchambre/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. basduchambre/carbon-fields-urlpicker

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

basduchambre/carbon-fields-urlpicker
====================================

Carbon Fields extension, that adds a URL picker field type.

3.0.0(6y ago)014GPL-2.0+

Since Aug 15Pushed 4y agoCompare

[ Source](https://github.com/basduchambre/carbon-fields-urlpicker)[ Packagist](https://packagist.org/packages/basduchambre/carbon-fields-urlpicker)[ Docs](https://github.com/iamntz/carbon-fields-urlpicker)[ RSS](/packages/basduchambre-carbon-fields-urlpicker/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (6)Used By (0)

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

[](#carbon-field-urlpicker)

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

Adds a `urlpicker` field type to Carbon Fields. Install using composer:

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

```

You're using Carbon Fields v3? Then install it from the v3 branch!

```
composer require iamntz/carbon-fields-urlpicker:v3.x-dev

```

(first, make sure you have `"minimum-stability": "dev"` set in `composer.json`)

Or by installing as a WP plugin (composer is recommended though; installing as a plugin may throw an error).

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

```

Demo
----

[](#demo)

[https://img.iamntz.com/jing/video\_2017-09-01\_\_12\_22.mp4](https://img.iamntz.com/jing/video_2017-09-01__12_22.mp4)

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)

```
