To retrieve a value after using add_settings_field() you should use get_option().
So you could do something like this…
$value = esc_html(get_option('option_name'));
if ($value) {
echo '<a href="' . $value . '">Click Here</a>';
}
You just need to change option_name
to your field name. The code will grab the value and if it isn’t false echo the link. Also added the escaping.
*Updated after OP gave more details
Related Posts:
- Custom Fields Not Working In Footer
- Add subtitle to Woocommerce product title
- ‘Preview Changes’ for custom meta boxes?
- Add metabox to document tab in gutenberg
- Change wp_get_attachment_image attributes (src and srcset) on specific custom field
- Move from old custom field to new post_thumbnails
- How to use custom fields in post title?
- query_posts and only show results if a custom field is not empty
- User Profile / Add Custom Fields
- Convert jQuery Datepicker Format to SQL Date Format
- Date, Time, and Timezones
- Only show metabox when date-value in other metabox is over?
- Is it possible to store arrays in a custom field?
- Making a configurable field translatable
- importing data from non-wordpress mysql db
- How to convert custom field value to tag
- Use WP 3.1 Internal Linking ‘widget’ as a meta_box
- Comments form custom fields order
- Order posts according to user defined order for meta values?
- Calculate the sum of certain the_sub_fields
- Is it possible to order posts by two meta values?
- how to save multiple custom fields for a post in one go?
- My metabox class
- ACF won’t load from a custom JSON location
- Custom User Profile Fields
- Custom Fields with get_post()
- wp_editor not saving data, and text area showing html tags
- Get specific custom field keys from a post and put into an array
- Importing from XML is ignoring serialized custom field
- How to check for specific meta box value on front end and output accordingly
- Loop to display random posts only if a custom field matches category
- WP Query Returning All Posts
- WordPress User Profile Upload – If page is saved file reset
- How to add field above password section in profile page
- How can I store a file in the database in the same way WordPress and ACF do?
- Select multiple options in WordPress custom meta filed
- Custom Field Create Bulk via SQL Query
- Get content from pages with same meta_key from Database
- How to add an extra field in a post and show it on the template
- Exclude images uploaded via meta boxes from WordPress gallery
- Front-end editing with custom fields?
- If meta key exists in get posts function otherwise create it
- How do i save and retrieve custom attachment meta?
- Show values of dynamically created custom meta keys
- List taxonomy term “Last Name” + “First Name” (taxonomy custom field) in a post loop
- Filter by custom field (meta_key) using JSON API
- Bulk append custom field to post content
- Pass current post title to a predefined link
- More efficient to add content to custom fields or the content area?
- Migrating old posts to new wp, how to extrapolate infos from the post body to custom fields?
- Custom field query without duplicates results
- how to display an excerpt of the latest post on the homepage?
- shortcode in a custom metabox
- Vimeo thumbnails
- querying a custom field
- meta_value and meta_key filtering returning no posts [closed]
- Woocommerce Retrieving custom field value from orders
- If one meta key value is empty, try to get another meta key, and if both meta keys are empty show something else?
- Save attachment ID instead of URL in custom field
- Displaying a custom field containing a list creates unwanted markup
- Output custom field as ul list
- How to change permalink on headlines in rss feeds?
- Multiple Custom Field Query
- How to order posts by number of Vimeo Likes
- Displaying a video on the homepage via a custom field inside a php widget
- Displaying custom field meta within WP_query loop
- Custom Field is getting the value of another page/post instead of the current one?
- Custom Field Date Problem
- Approach to creating a site with this structure
- how to create meta key name in wp_usermeta table in database
- Display the output from Custom User Fields from a WordPress user profile on a WordPress Custom Page
- Meta field bulk editing no longer working in WP 6.0 [closed]
- get_field values for each post on home page using wp_add_inline_style
- how to turn a link field into a button or link text
- Use value from ACF to populate other fields
- Dynamically populate query source in Elementor post widget
- Why does my numeric meta query work only on one meta key and not the other?
- Is there a way to determine which user changed a custom field (and when)?
- Metabox/Custom fields are not saving input data
- Show image depending on the number in the custom fields
- Show echo ready in single.php
- Save, update, get and sanitize post meta as HTML not plain
- author global display format
- Order categories by sum of custom fields
- how to modify a field’s size in a metabox : ROWS height, and scroll control?
- Saved Post Meta Array Returns as String
- Term specific featured post on taxonomy archive pages
- Thirtieth century date for a post
- Saving metadata of related post on save_post
- Custom field in external Javascript
- Custom field value link title
- How to Order Posts by Custom Fields?
- Analyze uploaded images to get colour values
- Turn Current Date in Custom Field Ouput Green or Red
- added a meta box to post however when saving menu while debug on throws a warning
- How can i get the actor birthday by date?
- list pages by custom_field?
- Post rating using Custom Field
- Inserting custom fields into new-post.php without using the Custom Fields Template plugin?
- Send checkout page custom field in order email