Editing the custom field itself would be the easiest way. In the field, under “Return Format,” you can change it from Post Object to Post ID. That way, when you call for the data, you’ll already have an array of just the IDs.
If you’re not able to change the field for some reason, you could alternatively code it something like
<?php
if (have_rows('studio_blocs')) {
while(have_rows('studio_blocs')) {
the_row();
$news = get_sub_field('studio_bio_list');
if ($news) {
foreach($news as $item) {
$array[] = $item->ID;
}
}
}
print_r($array);
}
?>
but you’re adding a little processing overhead, so changing the field is the better solution.
Related Posts:
- How can I add multiple ‘tax_query’ arrays via a loop?
- Looping through WP_Post Object
- Can an array be used as a meta_query value?
- Must Use Plugin Causing Query Error
- Advanced Custom Fields: Post Object – Not returning data [closed]
- ACF page while loop breaks footer while loop
- Using Advanced Custom Fields to create a per page slider
- Checking array against author id in loop
- Advanced Custom Fields – display label and value only if value entered
- How to get the last category name of a child category?
- Show ACF field with link to ultimate member profile/WordPress user profile below the post (single post layout)
- WordPress loop by meta key that is an array? and how loop multiple arrays
- Only show first image in foreach loop
- Conditional multidimensional arrays and array_map
- Get all posts as an array ID => Name
- in_array not working on dev server but works on localhost
- Show the subcategory name based on current product
- How to output values from a loop into a javascript array
- ACF background-color per post in a WordPress loop
- Make sticky post with FacetWP
- PHP for loop not working as intended
- Display a single row from nested array of custom field data
- Page returning ID from array, how to return the correct values for post in acf wordpress
- WP_Post is not from correct array
- Create Customization Controls from Array
- ACF loop and php formatting
- the_post_thumbnail unless video id is added
- Custom WordPress Function – Adding items from Foreach Loop into an array and Updating Field based on array of IDs (ACF + WooCommerce)
- Unique key for each row in a repeater field
- Store loop into array
- Using a javascript file to access a get posts array
- Generate an array of parent/child page IDs, based on parent page name
- How do I output a database option that is an array into a get_posts array?
- Show Custom Taxonomy Title
- How to exclude specific category from the get_the_category(); array
- spliting posts into two columns
- Looking for most performant way to execute several similar WP queries within shortcodes
- How to Display a Single Post Excerpt
- Trouble With Conditional Logic in PHP
- Recent posts with featured image or fallback image with permalink
- Storing Array from returned database query and using the array in a new query
- Changing layout with wp_customise
- get_the_tags() not iterating through for/while loop, but will with foreach
- Why my filterable portfolio page work not perfectly between slug button and slug output WORDRPESS?
- Iterate through posts based on array of categories
- get author_name from queried post
- Exclude posts based on meta value
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- post thumbnail, conditions, else wont work
- wp_force_remove_style’ not found
- How can I access string value in an array?
- I’m trying to create an array with a foreach loop, but the array only stores the last item [closed]
- Filtering a function’ output for a new continued function
- Why in my theme I can’t see all the statics content under the posts?
- How to unlink all posts from tracking same amount of views
- If Array Values Match Another Array’s Values, Then
- I’m unable to call img path using single quotes in an array?
- Problem with custom loop and wp_list_pluck [closed]
- Refactoring long if/else php chains
- Get the id of all images in a post
- Output category list inside array
- Update post meta – Custom field does not match meta-key
- First post article different on Archives template
- How to add title attribute to archive items
- How To Pass Array To get_the_category_by_ID() and Get An Array Back?
- Strip from or something better?
- Add custom fields from different posts
- Display acf taxonomy attachment
- Nested Queries of decreasing specificity
- ACF: Display Google Map in frontend issues
- How to Create Carousel Indicators in PHP Loop using wp_get_attachment_url function?
- Get title of page containing post grid within the posts
- Is there anyway I can call the year once?
- How to display MySQL table data which is stored as an array?
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- Latest posts feed with a specific post always first
- get_category_parents to array
- How fix error in the WordPress loop?
- How can i iterate through this shortcode array?
- Efficient way of querying for a “fallback” post?
- Loop 1 user randomly
- Create a hierarchical loop at predefined markup requirements
- enumerating custom taxonomies?
- Non-array argument in array_merge()-function [closed]
- Sort by multiple options in custom field
- 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
- Pagenav Not appearing on custom Template
- Remove the_content From Loop
- Adding if statement to content for homepage
- Tables not showing divs and loop/php items
- Showing all post from all post type in admin backstage
- Pagination in category.php not functioning
- How to handle parent and child pages?
- How to create a loop that will display one post and stop?
- I want to show image from custom field image on my custom page template
- Replace block content with an array
- Count the number of matching post names in foreach loop
- ACF number less than comparison not working