Is there a way to reorder the layouts in a flexible content field using PHP? Can update_field() be used for this?
The reason for this is that i would like the users to be able to reorder content inside of a flexible content field on my website from the front end or the customizer.
I’m searching for the same functionality.
I wish to reorder content in frontend and update the order of flexible layouts in backend.
Someone has any suggestions to achieve this?
Thanks in advance.
I can’t help you with this, all I can say is I’ve never seen this asked or answered in the years I’ve been helping here. You would be looking at building your own editor. You would need to somehow record the information on the current row order and the new row order and then submit that information to the server. Then you’d need to get the value of the flex field and alter the order of the rows based on this input and then save the value. If you can figure out how to get the information to the server I may be able to help you figure out what to do in PHP.