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)
- Query on a repeater date (acf)
- how to separate an array into different arrays and save them into db?
- Display all categories including sub categories under a list ul
- Responsive loop with 3 columns inside row then 2 columns
- How to insert multiple rows and columns in database using array
- Display one random image from Media Library
- How to display MySQL table data which is stored as an array?
- ACF values to Script with auto refresh
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- Looping through dummy posts and showing them in the main index.php
- ACF relationship on user profile page used for allowed access
- Where does php code to load data go?
- ACF – Can’t get custom post type by taxonomy
- Advance custom fields variable with if statement & Function
- ElseIf Statement with ACF Group field
- Adding new divs with custom classes to products on WooCommerce shop page [closed]
- Advanced Custom Forms PHP formatting for do_shortcode
- Custom Loop.php having a loop inside a loop
- Possible to edit custom date field and display?
- Get field value and use as variable in php
- Place product field value as variable in php
- ACF Gallery field images donwload
- cURL needing to loop through all “next_page”
- Display page content in different sections – based on page break block?
- Filtering custom posts by using checkboxes for taxonomy in an ajax loop always gives server 500 error
- Latest posts feed with a specific post always first
- Replace an array (with identical values) with another array in the_content
- ACF under category name in shop page [closed]
- get_template_part() not working with Advanced Custom Fields plugin
- List all ACF field values across every post on one page
- Get list of posts from attachment
- Javascript Tab Gallery with Advanced Custom Fields
- Pulling Products from an API
- WordPress Ajax filter: Create two loops for different output styles?
- How to display sticky post always at the top (before regular post) in wordpress?
- How to filter specific element of an array in wordpress/php?
- adding or removing endforeach; throws error!
- Return to the beginning of the results of a for loop
- How to count posts posts if they are in a separate content page?
- WP post meta – for loop inside for loop
- Adding PHP to an if else loop
- Accordion headings cuts off to second line on collapsing a accordion heading (used acf repeater)
- WordPress Recent Posts – Loop
- PHP/CSS: Shortcode won’t display correctly, and only displays in the head (before content)
- Exclude category and post from loop in custom category.php
- get_category_parents to array
- How can I get my pagination loop to display the correct number of total pages?
- How can I copy an ACF field to AIOSEO field? [closed]
- Notice : Array to string conversion on array_intersect user meta
- Combine multiple queries, array_unique returns nothing
- Store custom field’s multiple values in one user meta key
- Advertisement in Loop Posts wordpress
- How do if all posts has this category ID then do this
- Thumbnail wouldn’t scale to size properly
- Scheduling a post using publish date from a custom field. Resulting post is set as published in the future instead of scheduled
- Remove item from post_meta array via AJAX
- ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
- Generate a radius search of custom post type locations
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- Date of last blog update for specific authors only?
- View tag description on page
- Making list of posts with chosen description
- Fatal error when using array_diff() function inside of wp_update_nav_menu hook?
- Filter loop by ‘price’ with meta_query
- Get current_post in reverse order with pagination
- WooCommerce Custom Tab with ACF Repeater Field
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- Ordering / grouping posts by datepicker ACF
- How fix error in the WordPress loop?
- get_users when from meta key that has serialized values
- make an array in wordpress cusmization api?
- Position a repeated article blocks