base_fields = apply_filters( 'adpresso/groups/fields/base', [ [ 'id' => 'ads_with_weights', 'type' => 'group_ads_assignment', 'label' => '', 'description' => __( 'Select the ads and optionally set a weight for each.', 'adpresso' ), 'multiple' => true, 'box' => Group_Ads_Box::class, ], [ 'id' => 'visible_ads', 'type' => 'select', 'sanitize_type' => 'uint', 'label' => __( 'Visible Ads', 'adpresso' ), 'description' => __( 'Specify the number of ads from this group to be shown at once.', 'adpresso' ), 'box' => Group_Output_Box::class, 'default' => '1', 'options' => array_combine( range( 1, 10 ), range( 1, 10 ) ) + [ 999 => __( 'all', 'adpresso' ) ], ], [ 'id' => 'output', 'type' => 'button_group', 'sanitize_type' => 'key', 'label' => __( 'Group Layout', 'adpresso' ), 'description' => __( 'Select the visual output for this group. Choose Sequence for ordered delivery or Grid for a multi-column display.', 'adpresso' ), 'default' => 'default', 'options' => [ '0' => [ 'label' => __( 'Sequence', 'adpresso' ), 'key' => 'default' ], '1' => [ 'label' => __( 'Grid', 'adpresso' ), 'key' => 'grid' ], '2' => [ 'label' => __( 'Slider', 'adpresso' ), 'key' => 'slider' ], ], 'box' => Group_Output_Box::class, 'depends_on' => [ [ 'field_id' => 'visible_ads', 'operator' => 'greater_than', 'value' => '1', ], ], ], [ 'id' => 'columns', 'type' => 'number', 'sanitize_type' => 'uint', 'label' => __( 'Columns', 'adpresso' ), 'default' => 3, 'min' => 1, 'max' => 100, 'box' => Group_Output_Box::class, 'depends_on' => [ [ 'field_id' => 'visible_ads', 'operator' => 'greater_than', 'value' => '1', ], [ 'field_id' => 'output', 'operator' => 'is', 'value' => 'grid', ], ], ], [ 'id' => 'rows', 'type' => 'number', 'sanitize_type' => 'uint', 'label' => __( 'Rows', 'adpresso' ), 'default' => 2, 'min' => 1, 'max' => 100, 'box' => Group_Output_Box::class, 'depends_on' => [ [ 'field_id' => 'visible_ads', 'operator' => 'greater_than', 'value' => '1', ], [ 'field_id' => 'output', 'operator' => 'is', 'value' => 'grid', ], ], ], [ 'id' => 'inner_margin', 'type' => 'number', 'sanitize_type' => 'uint', 'label' => __( 'Inner Margin in %', 'adpresso' ), 'default' => 3, 'min' => 0, 'max' => 50, 'suffix' => '', 'box' => Group_Output_Box::class, 'depends_on' => [ [ 'field_id' => 'visible_ads', 'operator' => 'greater_than', 'value' => '1', ], [ 'field_id' => 'output', 'operator' => 'is', 'value' => 'grid', ], ], ], [ 'id' => 'min_width', 'type' => 'number', 'sanitize_type' => 'uint', 'label' => __( 'Minimum width per ad (px)', 'adpresso' ), 'min' => 0, 'max' => 9999, 'default' => 250, 'suffix' => '', 'box' => Group_Output_Box::class, 'depends_on' => [ [ 'field_id' => 'visible_ads', 'operator' => 'greater_than', 'value' => '1', ], [ 'field_id' => 'output', 'operator' => 'is', 'value' => 'grid', ], ], ], [ 'id' => 'banner_blindness', 'type' => 'div', 'label' => __( 'Define how ads within this group are ordered.', 'adpresso' ), 'box' => Group_Banner_Blindness_Box::class, ], [ 'id' => 'random', 'type' => 'checkbox', 'sanitize_type' => 'uint', 'default' => 0, 'label' => __( 'Random order', 'adpresso' ), 'description' => __( 'Chose between a random order based on weight instead of the order of the table.', 'adpresso' ), 'box' => Group_Banner_Blindness_Box::class, ], [ 'id' => 'full_width', 'type' => 'number', 'sanitize_type' => 'uint', 'label' => __( 'Full width in px', 'adpresso' ), 'default' => 0, 'min' => 0, 'max' => 9999, 'suffix' => '', 'description' => __( 'Below this browser width, columns are disabled, and ads are displayed at full width one below the other. Enter 0 if you want to disable automatic stacking.', 'adpresso' ), 'box' => Group_Output_Box::class, 'depends_on' => [ [ 'field_id' => 'visible_ads', 'operator' => 'greater_than', 'value' => '1', ], [ 'field_id' => 'output', 'operator' => 'is', 'value' => 'grid', ], ], ], [ 'id' => 'max_impressions_shortcut', 'type' => 'max_impressions', 'label' => __( 'Impression Limit', 'adpresso' ), 'description' => __( 'Limit how many times a visitor sees this group within a time period.', 'adpresso' ), 'default' => [ 'enabled' => false, 'count' => 3, 'period_amount' => 1, 'period_unit' => 'day', 'cooldown_minutes' => 0 ], 'show_enabled_toggle' => true, // Scheduling_Frequency_Box::save() already writes this meta key itself before // delegating to the generic per-field loop; without a real sanitize_type the // loop's fallback (getString()) sees a non-scalar value and stomps it back to // an empty string. 'array:key' keeps the generic pass a harmless no-op re-write. 'sanitize_type' => 'array:key', 'box' => Scheduling_Frequency_Box::class, 'premium' => true, ], ] ); } }