-
Notifications
You must be signed in to change notification settings - Fork 0
Link
The Link builds on top of the WP_Object field, which allows editors to select various types of objects. In addition to that, in the Link field, editors may also simply enter a custom URL instead of selecting an object.
The Link field builds on top of the WP Object field, inheriting many of its options:
Even though the Link field works on top of the WP Object field, because of the type of saved data there are no output options. Both get_value
and the_value
will return a URL if something is selected.
You can use the normal field name, as well as <field_name>_target
for retrieving values. Using only the field name will return the URL, while using the target will return either _self
or _blank
.
<a href="<?php the_value( 'button_link' ) ?>" target="<?php the_value( 'button_link_target' ) ?>">
Click me!
</a>
Quick start
- Creating fields and using their values
- Installation
- Administration interface
- Using the PHP API
- Container Settings
Locations
- Overview & Usage
- Post Type
- Options Page
- Taxonomy
- Comment
- User
- Widget
- Shortcode
- Menu Item
- Attachment
- Customizer
Fields
- Fields
- Text
- Textarea
- WYSIWYG
- Password
- Checkbox
- Select
- Multiselect
- Image Select
- File
- Image
- Audio
- Video
- Gallery
- WP Object
- WP Objects
- Link
- Date
- DateTime
- Time
- Color
- Font
- Icon
- Map
- Embed
- Number
- Sidebar
- Complex
- Repeater
- Layout
- Section
- Tab
- Message
Features
- Adding fields to the Customizer
- Conditional Logic
- Front-End Forms
- Administration columns
- Import and Export
- REST API
- JSON Synchronization
- Yoast SEO
Ultimate Post Types
Functions and API
Tutorials