<commit_before><?php

class WP_Widget_Collage_Carousel_Panel extends WP_Widget 
{
    public function __construct()
    {
        $widget_opts = array(
            'classname' => '',
            'description' => 'Collage of images with a title for each panel and captions for each image. Expands across multiple panels on smaller screens. Only use this once per page.',
            'customize-selective-refresh' => false
        );
        parent::__construct('nw-collage-panel', 'Photo collage carousel panel', $widget_opts);
    }
    
    public function widget($args, $instance_options)
    {
        echo $args['before_widget'];
        echo '<div class="carousel-panel">';
        $title = empty($instance_options['panel_title']) ? '' : $instance_options['panel_title'];
        echo '<h3 class="carousel-collage-panel-title">' . $title . '</h3>';
        echo '<div class="carousel-panel-collage-wrapper">';
        
        // Default
        if (empty($instance_options['images']))
        {
            $instance_options['images'] = array(array('caption' => 'Test caption'));
        }
        
        foreach ($instance_options['images'] as $image)
        {
            echo '<div class="collage-img-wrapper">';
            
            if (!empty($image['attachment_id']))<commit_msg>Allow having an empty caption on collages<commit_after><?php

class WP_Widget_Collage_Carousel_Panel extends WP_Widget 
{
    public function __construct()
    {
        $widget_opts = array(
            'classname' => '',
            'description' => 'Collage of images with a title for each panel and captions for each image. Expands across multiple panels on smaller screens. Only use this once per page.',
            'customize-selective-refresh' => false
        );
        parent::__construct('nw-collage-panel', 'Photo collage carousel panel', $widget_opts);
    }
    
    public function widget($args, $instance_options)
    {
        echo $args['before_widget'];
        echo '<div class="carousel-panel">';
        $title = empty($instance_options['panel_title']) ? '' : $instance_options['panel_title'];
        echo '<h3 class="carousel-collage-panel-title">' . $title . '</h3>';
        echo '<div class="carousel-panel-collage-wrapper">';
        
        // Default
        if (empty($instance_options['images']))
        {
            $instance_options['images'] = array(array('caption' => ''));
        }
        
        foreach ($instance_options['images'] as $image)
        {
            echo '<div class="collage-img-wrapper">';
            
            if (!empty($image['attachment_id']))
{'fraction_non_alphanumeric': 0.13859111791730475, 'fraction_numerical': 0.0015313935681470138, 'mean_word_length': 2.531081081081081, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '3085572', 'n_tokens_mistral': 708, 'n_tokens_neox': 705, 'n_words': 169}