Support Forum
Support › Meta Box Group › Change order
Hi! The plugin works great!
But is there a way to change the order of the Boxes in the backend (also for groups)?
When I want to add a new box at the beginning, I would need to shift all data in the fields below.
Is there an easier way to do this??
Thank you
Hi, as we're using code to register meta boxes and fields, the only way with coding to change fields' order is changing code. There's no easier way to do that :(.
Best regards.
i understand. how can you change the code so the the newest field entries are being returned first by the frontend?
All you need to do is moving the array of the latest field to the first place in the fields
array, something like in this screenshot:
i actually meant returning the new record first. so a new data record is entered, which is only possible to be entered at the bottom in the backend, but should be the first in the frontend. like being sorted by date, newest entries first. 🙂
Are you using get_post_custom
to get post meta? Because from what you said, it looks like you display fields in the backend in one order and display fields in the frontend in another order, and as we don't have a function to list all fields in the frontend, the only way to do that I guess is get_post_custom
function.
If so, I'm afraid there's no way to achieve that. The order you register fields = the order fields are displayed in the backend = the order WP processes data and stores in the DB = the order you get with get_post_custom
.
Or maybe you should do something like array_reverse
as a trick before displaying fields in the frontend?
yes, thank you! good idea! array_reverse
does what i wanted!
for future updates please consider a way to sort data records in the backend, would be very helpful!
thank you again!
Cool, glad it helps 🙂
I'd think about order to records fields. Thanks for your idea!