The best thing to do here is use the tools that WordPress has provided for you to construct your URLs.
In this solution you’re building an array of URL parameters with keys and values, then you’re “attaching” these parameters to the array using add_query_arg.
You can reuse this approach for all your URLs, and simply add/adjust your $parameters array as you need it, and the URL.
$parameters = [
'event' => get_field( 'fl_name' ),
];
$final_url = add_query_arg( $parameters, site_url( '/enquiry/' ) );
then simply echo out your $final_url wherever you need it:
<a href="<?php echo $final_url; ?>">Make a request</a>
A one-liner version of all of this is:
<a href="<?php echo add_query_arg( [ 'event' => get_field( 'fl_name' ) ], site_url( '/enquiry/' ) ) ;?>">Make a request</a>
Related Posts:
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- The values of custom fields are not available functions.php
- Problem with ACF shortcode with Repeater Field in WordPress? [closed]
- ACF: how do I get the fields and its values of a specific group?
- Download PDF after CF7 form submission
- How to create an ACF shortcode with Repeater Field in WordPress? [duplicate]
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- How can I count ACF sub_field with a certain value
- Problem with adding custom CSS class to image in ACF Photo Gallery plugin [closed]
- Delete images from media library when user deletes an image from ACF Gallery
- Advance custom fields variable with if statement & Function
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Page returning ID from array, how to return the correct values for post in acf wordpress
- ACF Date fileds to Age Convert [closed]
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Creating posts with php-script + csv
- ACF number less than comparison not working
- “acf/load_field” Critical error upon saving/updating WooCommerce products [closed]
- Put ACF function output code the_terms
- Display all values of custom a field created with ACF on a page
- Allowed memory size of 268435456 bytes exhausted (tried to allocate 7146491840906359738 bytes)
- If Custom Field is empty don’t display div
- How do I get the author’s page url from their ID?
- Remove class that has been added by parent theme
- How to check from which page the user is coming to the current page?
- Design view breaking on Pages
- Execute only on a certain page
- How do I know what variables are passed in a filter/action and what their meaning is?
- Wrap each shortcode in array to div
- Warning: array_pop() expects parameter 1 to be array, boolean given
- Replace comment avatars and links at the same time
- Check if Product is in a Specific Category in Functions.php
- Adding ads code between comments
- Create Logout Link WordPress Admin Menu
- How to Display Image Meta underneath EVERY image in EVERY post
- Limiting woocommerce line_total decimal length
- Shortcode content filter?
- Swapping wp_dropdown_categories function with wp_category_checklist
- Display PHP within HTML values
- only show container with next/prev links if they exist?
- JS file work only in index page
- Unable to write multiple values back to ACF user field – PHP
- Error in custom php function doesn’t exist
- Update grandchild repeater field with value per row
- Custom shortcode outputs plain text instead of HTML at top of post
- how can i use $_COOKIE[] + PostID to execute the below code?
- Create Page To Count Comments For Each Post In WordPress Site
- Query Pages and post excerpts dynamically
- Filtering a function’ output for a new continued function
- Shortcode to find and replace URL
- Deleting Certain terms from appearing on the front end as links
- first instantiated SimplePie object cosumes 5mb?
- Function Reference Documenting Template Tags for use in Custom Theme Templates?
- Need php code’s output to display underneath a Divi Module
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- How to make function appear in sentence?
- How to define a variable already defined in a plugin function?
- woocommerce specific quantities for product
- How to use mysql LIKE with wpdb?
- woocommerce related product title length
- what is the method to echo class attribute inside the i tag? [closed]
- Custom query vars filters problem with pagination
- Query for user roles
- Use SCSSPHP to compile Theme Customizer Values into .SCSS files ready to compile to CSS
- Displaying Event within two given time frames
- Remove Post if Advanced Custom Field is checked to fix paging
- Is there a way to create a “copy post” link?
- Taxonomy term description with style, only if the description exists?
- Use of antispambot with $curauth->email
- Restrict post to current user in postmeta
- copy fields value to another field
- posts_per_page displays only 2 posts instead of 4 posts
- Get parent category name when only child category is applied to a product
- ACF relationship on user profile page used for allowed access
- Adding product permalink on admin order page throwing error
- Before & After Content – After Content directly below Before Content when using require_once
- Taxonomy Child Term, Counter is staying on 0
- Access to “My Site” is missing from the admin bar
- How to redirect (301) trashed post to it’s parent taxonomy TERM ARCHIVE instead of 404 page
- How to call WordPress PHP file using external js file
- Using get_theme_mod with checkbox to display content
- use system script advertising in wordpress multisite
- Styling admin page rows in order of importance (checkboxes)
- Insert wordpress tags below posts via functions.php
- Help with my first Metabox helper class
- Pagenav Not appearing on custom Template
- ISOTOPE – Missing/Invalid Arguement Get Terms
- My title is showing after the shortcode
- Load a Header in wordpress
- Trouble figuring out how to get my button to submit comment
- Adding multiple conditional tags in a function?
- Understanding responsive imagery
- Show button in header when product custom field is not empty
- Why a class property becomes empty?
- How to get meta box labels?
- How do I stylize selected comments?
- How do I make a shortcode to display Dokan seller badge list?
- Function extension
- Developing a “fallback” for empty wp_query results based on post dates
- How can I process a form submission from an HTTP POST request?