Support

Account

Home Forums Backend Issues (wp-admin) Sort Repeater in BACK end, Where Data is Entered Reply To: Sort Repeater in BACK end, Where Data is Entered

  • When I put define('WP_DEBUG', true); in wp-config.php. And have this in my functions.php file:

    function my_acf_load_value( $rows ) {
    	foreach ( $rows as $key => $row ) {
    		$column_id[ $key ] = $row[ 'field_593c04d244712' ];
    	}
    	array_multisort( $column_id, SORT_ASC, $rows );
    	return $rows;
    }

    I get the following errors on the front end:

    Warning: Invalid argument supplied for foreach() in functions.php on line 110
    
    Warning: array_multisort(): Argument #1 is expected to be an array or a sort flag in functions.php on line 113

    Line 110:
    foreach ( $rows as $key => $row ) {

    Line 113:
    array_multisort( $column_id, SORT_ASC, $rows );

    Not sure how to keep this filter functional AND prevent these Warnings. What do I need to do to prevent them?