Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('acf/load_value/name=basic_repeater', 'kunst_reorder_repeater', 10, 3);
- /**
- *
- */
- function kunst_reorder_repeater( $value, $post_id, $field ) {
- // vars
- $order = array();
- // bail early if no value
- if( empty($value) ) {
- return $value;
- }
- // populate order
- foreach( $value as $i => $row ) {
- $order[ $i ] = $row['field_6027a4c8e149b'];
- }
- // multisort
- array_multisort( $order, SORT_DESC, $value );
- // return
- return $value;
- }
Add Comment
Please, Sign In to add comment