Take a look at PHP’s array_values
function. Alternatively, you could typecast.
Note that if the array is in serialized form as you have put it above, you will have to unserialize it first, in either case.
$numerical_array = array_values(
unserialize(
'a:1:{s:8:"post-134";s:3:"134";s:8:"post-136";s:3:"136";}'
)
);
or
$numerical_array = (array) unserialize(
'a:1:{s:8:"post-134";s:3:"134";s:8:"post-136";s:3:"136";}'
);
Related Posts:
- Usermeta data unserialize, extract and display in table in WordPress
- Build a content and excerpt grid loop with paging and options for # of posts
- Showing user ID on user main page from screen options
- Using Cookie Data For WP_Query Loop
- wp_delete_post deletes all posts instead of just expired ones
- Alter secondary loop to exclude posts from current page category
- Trim first 2 words of the exceprt
- Display Post co-authored in Author Page
- get_usermeta() deprecated in favor of get_user_meta(). But why doesn’t it make use of it?
- Sorting Posts | Alphabetical Order
- Looking for most performant way to execute several similar WP queries within shortcodes
- Get the last month with posts using a recursive function…
- Create a new usermeta field for users
- How to get a list of all possible values of a specific user meta key?
- How do I display a user’s previous orders as a select box option on a product?
- How to query for pages/post depending on slug?
- WordPress custom slug (endpoint) and compare all links
- wp_query with cat not working
- If Query In Sidebar
- Recent Posts slider, using WP_Query(), loads duplicate sliders
- Compare post-IDs within WP_Query? (Less than / Greater than)
- How to use $query->set with post__in?
- Why do WP_Query results change after updating unrelated Advanced Custom Fields (ACF)?
- Display a specific category of products in shop page and disable code for specific actions
- Creating user status mode in WordPress
- Adding number to date not working [closed]
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Custom query, checking values of multiple meta keys
- Fatal error: Call to a member function query() on a non-object
- Is it possible to retrieve all posts with a certain value for metadata?
- How to get all author posts outside of author templates
- Trouble inputting variable into WP query
- How to override url params with rewrite rules vars?
- WP_Query | IF within $args array | Help me only add specific arguments if the argument is not blank
- How to display SQL query that ran in WC_Order_Query?
- Array to string conversion on array_map
- Store metakey value as an array
- Target post_date_gmt if it’s empty or not set
- Shortcode for Listing Users from Meta Value?
- Get all posts as an array ID => Name
- Post not populating for custom post type based on category selection
- Passing an array into WP_Query as a variable
- Custom query vars filters problem with pagination
- WordPress meta_query >= &
- Do not duplicate posts with multiple categories in multiple loops
- Infinite Loop – WP_Query
- Dividing the loop to style post differently
- Displaying Event within two given time frames
- Remove Post if Advanced Custom Field is checked to fix paging
- WordPress SQL JOIN query
- WP_Query and help with the loop for magazine front page
- Update user repeater meta (ACF) with another user meta field value
- Search AJAX Filters – Multiple Query Loops Into One Loop (Optimization)
- WP_Query: How to get results from both meta_key options?
- How to WP_Query posts order by parent title?
- search.php to search only the post title
- Output product category link from WP_Query
- WP_Query – How to query all of post types categories
- How to work Woocommerce pagination inside shortcode?
- Passing in MySQL prepare statement parameter separately throwing error
- Load more posts using AJAX based on posts inside WP_Query
- Custom search query on WordPress page not working
- User meta needed in query is serialized – how to unserialize safely?
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- How to select post ID for given parent name with nested prepared queries?
- posts_per_page displays only 2 posts instead of 4 posts
- Use WPQuery to match to specific repeater row in post
- WP_QUERY post_in problem
- how to get data from two different table from wordpress database
- Change user metadata on registration (show_admin_bar_front = false)
- Need to show 7 posts from actual date
- Add code to the header of posts by particular author
- Paged WP_Query is quitting on page 3
- Get Child of Child Pages in custom Menu
- WordPress search query, how to modify the sql
- Modify post image in full size
- Update an additional user meta field with a string
- Meta query not showing result properly
- Right way to display the_author_meta fields?
- Help on Wp_query to print an term
- Adding user meta to post meta wp_insert_post() not working
- Ordering / grouping posts by datepicker ACF
- Include search tags and users in my search results system
- Add custom taxonomy to custom search for posts
- making a search.php query
- How can get all users by current user meta (array)?
- My query keeps looping infinitely ! how to stop it?
- Efficient way of querying for a “fallback” post?
- Only Get A Certain Number of Posts From WP_Query
- Create a hierarchical loop at predefined markup requirements
- Use custom get results query to show posts WordPress
- Query seems to be duplicated
- WP Query conflict on tag.php and category.php template
- Keeping the previous get value and add another value when submitted
- Pagination in category.php not functioning
- WP query with variables gives no result for specific user
- Display all categories (with link) of custom post type – WordPress
- How to sort custom sortable column by custom table value
- /page/2/ redirect to 404
- How to use a conditional statement in a post loop but not count towards the “posts_per_page” if false