This is not really a WordPress question.
However you probably need the implode php function, using a comma as glue.
foreach( $fields as $field ) {
$value = get_field( $field['name'], 'user_'. $author_id );
if(!empty($value)) {
if ($value) {
$v = implode(',', $value);
}
}
}
Related Posts:
- Conditionally loading JavaScript based on the Advanced Custom Fields in the post
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- Run shortcode at certain resolution
- Advanced Custom Fields: Post Object – Not returning data [closed]
- Trigger popup in a php if/else statement
- How can I add multiple ‘tax_query’ arrays via a loop?
- ACF page while loop breaks footer while loop
- Using Advanced Custom Fields to create a per page slider
- Creating own shortcode – echoeing php variable based on JS variable
- Redirect to another page using contact form 7? [closed]
- 2nd page displaying the exact same posts as my first page (minus the very first post)
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- Calling PHP Titles inside Javascript Markup
- Including Custom fields within the_content
- How to store checkbox data for individual users?
- using shortcodes inside gravity forms
- Get title of page containing post grid within the posts
- ACF values to Script with auto refresh
- Advanced Custom Forms PHP formatting for do_shortcode
- ACF – Get ID of relationship field in flexible content
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Show the subcategory name based on current product
- Javascript Tab Gallery with Advanced Custom Fields
- Pulling Products from an API
- Replacing entire tag with shortcode – JavaScript [duplicate]
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- ACF background-color per post in a WordPress loop
- Generate a radius search of custom post type locations
- PHP for loop not working as intended
- Force ‘permanent’ post cache of shortcode results
- Is there a reason why my wordpress PHP page isn’t loading into my PHP template
- ACF + WP + Slick Slider Repeater Slide Group PHP not Displaying [closed]
- How can i iterate through this shortcode array?
- ACF loop and php formatting
- How can I put a custom field as the link of a button shortcode?
- the_post_thumbnail unless video id is added
- Custom field within shortcode
- Set variable in javascript and using in my shortcode
- Is there a better way to output HTML as a shortcode?
- Show Login Errors In WordPress/Elementor (Code “works”, but breaks site)
- Return HTML Template Page with PHP Function
- How to use the php if statement [closed]
- lazy load comments wordpress on click
- Store loop into array
- How to return multiples lines in a shortcode?
- Minify HTML, CSS, JS with PHPWee?
- Run a Parallel PHP Application with WordPress
- Access/update database with jQuery
- Show Custom Taxonomy Title
- Pass PHP variable to JavaScript without inline JS
- PHP code inside shortcodes
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- How do I display a user’s previous orders as a select box option on a product?
- Menu jumping when calling it via PHP
- Remove echo from shortcode
- Shortcode to show the code
- How to optimize the IF condition with many conditions and same output [closed]
- Advanced Custom Fields – display label and value only if value entered
- admin-ajax Firing Error 400 When Logged In
- Jquery window.send_to_editor function
- $wpdb returns duplicate posts
- How to put a form with php code into a variable or shortcode?
- Handling PHP/HTML inside the output of a shortcode function
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Problem with custom loop and wp_list_pluck [closed]
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- Refactoring long if/else php chains
- Update post meta – Custom field does not match meta-key
- Run JS Code on userlog out
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- How to exclude labels from certain categories in a shortcode?
- Hot to check if new posts have been published since page load and notify online users?
- Time Delay a URL Redirect for Specific Page
- Cascading dropdown select search based on Parent Page & Child Page
- Trying to call dynamic content into a 3rd party shortcode
- Nested Queries of decreasing specificity
- Unable to display multiple parameters from url by javascript through shortcodes
- How to Create Carousel Indicators in PHP Loop using wp_get_attachment_url function?
- Block error message in foreach loop when looping through ACF field
- shortcodes, custom php and their errors
- I have a lot of JavaScript erorrs after SSL someone can help me?
- Store data from JavaScript object to custom table in user account
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- Move Jquery.js to Footer
- Offset with ajax load more posts duplicates
- How fix error in the WordPress loop?
- Efficient way of querying for a “fallback” post?
- Shortcode in a $output statement
- Need help with PHP functions
- Create a hierarchical loop at predefined markup requirements
- When using shortcode, content stops generating after the_content
- enumerating custom taxonomies?
- add bootstrap modal after login in wordpress
- If or/and statement advanced custom fields [closed]
- Top menu disapears in Category Pages when filtering using ACF
- How to display thumbnail if post is assigned one otherwise not
- Tables not showing divs and loop/php items
- Add specific phrase after every product title including the discounted price? [closed]
- Shortcode to include PHP file, pass various parameters to include?