public static function save_order_field( $group_id, $order ) {
    global $wpdb;

    if( !is_numeric($group_id) ) {
      return false;
    }

    foreach( $order as $key => $value ) {
      $update = $wpdb->update(
        MF_TABLE_CUSTOM_FIELDS,
        array( 'display_order' => $key ),
        array( 'custom_group_id' => $group_id, 'id' => $value ),
        array( '%d' ),
        array( '%d', '%d' )
      );

      if( $update  === false ) {
        return $update;
      }
    }
    return true;
  }
public static function save_order_field( $group_id, $order ) {
    global $wpdb;

    if( !is_numeric($group_id) ) {
      return false;
    }

    foreach( $order as $key => $value ) {
      $update = $wpdb->update(
        MF_TABLE_CUSTOM_FIELDS,
        array( 'display_order' => $key ),
        array( 'custom_group_id' => $group_id, 'id' => $value ),
        array( '%d' ),
        array( '%d', '%d' )
      );

      if( $update  === false ) {
        return $update;
      }
    }
    return true;
  }
public static function save_order_field ( $ group_id , $ order ) { global $ wpdb ; if ( ! is_numeric ( $ group_id ) ) { return false ; } foreach ( $ order as $ key => $ value ) { $ update = $ wpdb -> update ( MF_TABLE_CUSTOM_FIELDS , array ( 'display_order' => $ key ) , array ( 'custom_group_id' => $ group_id , 'id' => $ value ) , array ( '%d' ) , array ( '%d' , '%d' ) ) ; if ( $ update === false ) { return $ update ; } } return true ; }
Save the order of the custom fields
Save the order of the custom fields