Home Forums Add-ons Repeater Field Order repeater and update_sub_field


Order repeater and update_sub_field

  • Hello,

    I’m sorting my repeater with multisort. But I also have a update_sub_field() function in the repeater. On every page update the rows change place. It seems like update_sub_field() updates the wrong row?


    if( have_rows('betters', 309) ):
       while( have_rows('betters', 309) ) : the_row();
          update_sub_field('field_5963e28c37f7b', "{$points}");


    function my_acf_load_value( $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_5963e28c37f7b'];
    	// multisort
    	array_multisort( $order, SORT_DESC, $value );
    	// return
    	return $value;
    add_filter('acf/load_value/name=betters', 'my_acf_load_value', 10, 3);
    • dano23

    • July 21, 2019 at 3:15 am

    Hi @felixzb2 I have this exact problem. Did you ever figure out a solution?

  • No, sorry!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.