You can get an array with just the numbers by using
array_values($your_array);
It will return an array with just the numbers. Is this what you need, or a string with a comma separated list of IDs?
If that’s the case, use this:
implode(",",array_values($your_array));
Hope this helps.
Related Posts:
- Make Selected Mutiselect Items “selected”
- Do not replicate items if they exists in a foreach loop
- How to randomise my menu items?
- Combine two foreach Arrays into one table row
- Nice way to print_r arrays
- WordPress: How to use post_class() in an echo
- How do I pass an array as an argument to a WP-CLI command?
- Use Transient API to cache queries for all posts in all categories?
- Error in WP_update_post
- if is_singular array not working as expected
- Looping through WP_Post Object
- Get posts id in array by meta value and key
- Using a javascript file to access a get posts array
- Sort a custom post type array numerically
- Generate an array of parent/child page IDs, based on parent page name
- How to add day number and initial to my post graph?
- How do I output a database option that is an array into a get_posts array?
- How to validate register settings array
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- Check if term object is in array
- Using a variable in is_page(array())
- Remove duplicates – array_unique()
- Recent posts with featured image or fallback image with permalink
- Storing Array from returned database query and using the array in a new query
- get_the_tags() not iterating through for/while loop, but will with foreach
- get a simple array of all of the term names that exist in all taxonomies
- Retrieving multiple values to the Post Meta (using an array)
- How to use $query->set with post__in?
- How to Translate a string of an array inside a class?
- Exclude posts based on meta value
- Update post meta does not serialize array
- Checking array against author id in loop
- Redirect to another page using contact form 7? [closed]
- How to decipher the following array
- How to display line breaked meta values in table?
- Grouping posts by a custom meta value
- Organizing and grouping an array by year
- Error while setting role
- Obtaining values from objects
- How to say if meta_value is greater than 0 in an array?
- Loop over Array and get the distinct ids
- Remove empty terms from array, sort alphabetically, update back to repeating field
- Only show first image in foreach loop
- How can I get all values from my array in a loop in php? [closed]
- Get all posts as an array ID => Name
- Matching slug terms from one array to those in array of WP_Term objects to output term names
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Filter by field with array value in ACF on WP REST API
- Working of foreach loop with array
- Separate array output into a
- Add key and value to an array in another file
- WP Page Options Array
- Array is not working in Filter?
- add the value of a variable returned in a while loop [closed]
- Update value of a associative array with update_post_meta
- Random element in get_post_meta array
- using images in next/previous_post_link [closed]
- MySQL Query Returns Array () In Shortcode
- Convert a column of a table containing an Array as response in HTML
- Create an array with all the links of the years’ archive (of a custom post type)
- Display just one post from a loop of 5 posts?
- Redux option doensn’t seem when include from functions.php
- Creating an array from form inputs before it is posted to the options database
- Retrieve array items without page ID
- How to insert multiple rows and columns in database using array
- Display one random image from Media Library
- How do i fix this “call_user_func_array()” error
- How can I get the content of the current page in my loop while merging post-type
- wp_insert_post($post), add an array of values with update_post_meta
- update_post_meta adding to array instead of replacing value
- Add Array record to Meta Post
- How to output get_tags array list to select box
- get_category_parents to array
- How to add each letter, entity, special character from post title to array
- How i can extract data
- How can get all users by current user meta (array)?
- How can i iterate through this shortcode array?
- Non-array argument in array_merge()-function [closed]
- How do I use foreach to get content from a custom-field in multiple posts?
- Use $wp_customize->add_control to create a selectable “Designed/Powered By” choices select w/ link in footer?
- Page doesn’t load
- How to get values from wordpress listings and use them in javascript array?
- Repeatable field within repeatable group of fields
- Echo the key from a select-box in Array with get_option (Settings API)
- Updating wordpress user meta data array (unexpected multiple arrays)
- update_post_meta array issues
- Update Post Meta for Arrays — Remove/Replace Single Value from Multi Dimensional Array
- How do I retrieve a value from a multi – dimensional array using get_post_meta? [duplicate]
- posting twice from an array?
- Insert dynamic content into posts
- Showing all post from all post type in admin backstage
- Fatal error in my WP
- Use php array outside his function
- How to match data in multidimensional array of post_meta_data?
- how to separate array with commas? [closed]
- Retrieve Array from within Array [closed]
- save array of objects with update_option
- Multipe array in meta_input
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Replace block content with an array