<commit_before><?php
// ACF repeater for content
if ( have_rows('content_list') ) : while ( have_rows('content_list') ) : the_row();

  // Get field data
  $content_objects        = get_sub_field('content_objects');
  $layout                 = get_sub_field('layout');
  $background_color       = get_sub_field('background_color');
  $background_texture     = get_sub_field('background_texture');
  $background_fit         = get_sub_field('background_fit');

  // Generate a unique ID to identify this row
  $uniqid = uniqid();

  // Count the number of objects
  $content_objects_count  = count($content_objects)
?>
<div class="wrap relative <?php echo implode(' ', array($layout, $background_color, $background_texture)); ?>">

<?php
// Loop through each content object individually
foreach ( $content_objects as $key => $content_object ) :

  $content_title           = ( get_field('title_html', $content_object->ID) ) ? get_field('title_html', $content_object->ID) : $content_object->post_title;
  $content_title_class     = ( get_field('title_class', $content_object->ID) ) ? get_field('title_class', $content_object->ID) : '';<commit_msg>enabled sorting of multi-content blocks<commit_after><?php
// ACF repeater for content
if ( have_rows('content_list') ) : while ( have_rows('content_list') ) : the_row();

  // Get field data
  $content_objects        = get_sub_field('content_objects');
  $sort_order             = get_sub_field('sort_order');
  $layout                 = get_sub_field('layout');
  $background_color       = get_sub_field('background_color');
  $background_texture     = get_sub_field('background_texture');
  $background_fit         = get_sub_field('background_fit');

  // Generate a unique ID to identify this row
  $uniqid = uniqid();

  // Count the number of objects
  $content_objects_count  = count($content_objects)
?>
<div class="wrap relative <?php echo implode(' ', array($layout, $background_color, $background_texture)); ?>">

<?php

// Rearrange content objects if sort order is specified
// $sort_order is expected to be a csv of post IDs
if ( $sort_order ) :

  // Convert csv to array, in inverse order
  str_replace(' ', '', $sort_order);
  $sort_order = explode(',', $sort_order);
  $sort_order = array_reverse($sort_order);

  // Loop array of sort values
  foreach ( $sort_order as $sort_order_key => $sort_order_value ) :

    // Find the corresponding content object
    $content_objects_clone = $content_objects;
    foreach ( $content_objects as $content_object_key => $content_object ) :
      if ( $content_object->ID == $sort_order_value ) :

        // Move content object to top
        $matched_content_object = $content_objects_clone[$content_object_key];
        unset( $content_objects_clone[$content_object_key] );
        $content_objects_clone = array_merge( array( $content_object_key => $matched_content_object ), $content_objects_clone );

        unset( $matched_content_object );
      endif;
    endforeach;
    $content_objects = $content_objects_clone;
    unset( $content_objects_clone );

  endforeach;
endif;

// Loop through each content object individually
foreach ( $content_objects as $key => $content_object ) :

  $content_title           = ( get_field('title_html', $content_object->ID) ) ? get_field('title_html', $content_object->ID) : $content_object->post_title;
  $content_title_class     = ( get_field('title_class', $content_object->ID) ) ? get_field('title_class', $content_object->ID) : '';
{'fraction_non_alphanumeric': 0.12862474877978755, 'fraction_numerical': 0.0, 'mean_word_length': 4.2233883058470765, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2647852', 'n_tokens_mistral': 1054, 'n_tokens_neox': 1036, 'n_words': 234}