[wp-trac] [WordPress Trac] #63094: Allow ordering by meta_id in a meta query
WordPress Trac
noreply at wordpress.org
Thu Mar 13 08:46:21 UTC 2025
#63094: Allow ordering by meta_id in a meta query
-----------------------------+-----------------------------
Reporter: jamieburchell | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version:
Severity: normal | Keywords:
Focuses: |
-----------------------------+-----------------------------
It is currently not possible to order by wp_postmeta.meta_id during a meta
query. This would be useful because it allows rows to return in the order
they were inserted into the table.
A real use case example is where a custom field plugin exposes a multiple
"Add item" mechanism with the option to reorder them. Pods for example
does this with their relationship type field with multiple selection and
reordering. The meta data is then inserted in to the postmeta table in the
desired order.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/63094>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list