section_heading( '✍', __( 'Content & message', 'aaweb-announcement-bar' ), __( 'Choose plain text or safe HTML and control the announcement copy.', 'aaweb-announcement-bar' ), 'content-all' ); ?>
subsection_heading( __( 'Main message', 'aaweb-announcement-bar' ), 'content-main' ); ?>
checkbox_field( 'enabled', __( 'Enable announcement bar', 'aaweb-announcement-bar' ), $settings, __( 'Turn the frontend bar on or off.', 'aaweb-announcement-bar' ) ); ?>
select_field( 'content_mode', __( 'Content mode', 'aaweb-announcement-bar' ), $settings, array( 'text' => __( 'Plain text', 'aaweb-announcement-bar' ), 'html' => __( 'Safe HTML', 'aaweb-announcement-bar' ) ) ); ?>
textarea_field( 'text', __( 'Text message', 'aaweb-announcement-bar' ), $settings, 4, __( 'Used when content mode is Plain text.', 'aaweb-announcement-bar' ) ); ?>
textarea_field( 'html_content', __( 'HTML content', 'aaweb-announcement-bar' ), $settings, 7, __( 'Used when content mode is Safe HTML. WordPress safe post HTML filtering is applied.', 'aaweb-announcement-bar' ) ); ?>
subsection_heading( __( 'Mobile message override', 'aaweb-announcement-bar' ), 'mobile' ); ?>
checkbox_field( 'mobile_text_enabled', __( 'Use a different message on mobile', 'aaweb-announcement-bar' ), $settings, __( 'Below 768px, replace the main message with this shorter mobile text.', 'aaweb-announcement-bar' ) ); ?>
textarea_field( 'mobile_text', __( 'Mobile text', 'aaweb-announcement-bar' ), $settings, 3, __( 'Plain text only. Leave empty to fall back to the main message.', 'aaweb-announcement-bar' ) ); ?>
section_heading( '🎟', __( 'Coupon / discount code', 'aaweb-announcement-bar' ), __( 'Show an existing discount code in the announcement bar so visitors can copy it with one click.', 'aaweb-announcement-bar' ), 'coupon' ); ?>
checkbox_field( 'coupon_enabled', __( 'Enable click-to-copy coupon', 'aaweb-announcement-bar' ), $settings, __( 'Show the coupon code as a clickable copy control in the announcement bar.', 'aaweb-announcement-bar' ) ); ?>
text_field( 'coupon_code', __( 'Discount code', 'aaweb-announcement-bar' ), $settings, 'text', 'SAVE10', __( 'Enter the exact coupon code the visitor should copy.', 'aaweb-announcement-bar' ) ); ?>
text_field( 'coupon_label', __( 'Label before code', 'aaweb-announcement-bar' ), $settings, 'text', __( 'Code', 'aaweb-announcement-bar' ) ); ?>
section_heading( '↗', __( 'CTA button', 'aaweb-announcement-bar' ), __( 'Style the call-to-action independently from the text so both stay aligned and clickable.', 'aaweb-announcement-bar' ), 'button-all' ); ?>
subsection_heading( __( 'Button content & behavior', 'aaweb-announcement-bar' ), 'button-main' ); ?>
checkbox_field( 'button_enabled', __( 'Enable CTA button', 'aaweb-announcement-bar' ), $settings ); ?>
select_field( 'link_target', __( 'Open link', 'aaweb-announcement-bar' ), $settings, array( '_self' => __( 'Same tab', 'aaweb-announcement-bar' ), '_blank' => __( 'New tab', 'aaweb-announcement-bar' ) ) ); ?>
text_field( 'link_url', __( 'Button URL', 'aaweb-announcement-bar' ), $settings, 'url', 'https://example.com' ); ?>
text_field( 'link_text', __( 'Button text', 'aaweb-announcement-bar' ), $settings ); ?>
select_field( 'button_position', __( 'Button position', 'aaweb-announcement-bar' ), $settings, array( 'after' => __( 'After content', 'aaweb-announcement-bar' ), 'before' => __( 'Before content', 'aaweb-announcement-bar' ) ) ); ?>
select_field( 'button_visibility', __( 'Button visibility', 'aaweb-announcement-bar' ), $settings, array( 'all' => __( 'All devices', 'aaweb-announcement-bar' ), 'desktop' => __( 'Desktop only', 'aaweb-announcement-bar' ), 'mobile' => __( 'Mobile only', 'aaweb-announcement-bar' ) ) ); ?>
select_field( 'button_animation', __( 'Button animation', 'aaweb-announcement-bar' ), $settings, array( 'none' => __( 'None', 'aaweb-announcement-bar' ), 'pulse' => __( 'Pulse', 'aaweb-announcement-bar' ), 'bounce' => __( 'Bounce', 'aaweb-announcement-bar' ), 'glow' => __( 'Glow', 'aaweb-announcement-bar' ) ) ); ?>
subsection_heading( __( 'Button style', 'aaweb-announcement-bar' ), 'button-style' ); ?>
text_field( 'button_bg_color', __( 'Background', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'button_text_color', __( 'Text color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'button_hover_bg_color', __( 'Hover background', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'button_hover_text_color', __( 'Hover text', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'button_border_color', __( 'Border color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
number_field( 'button_border_width', __( 'Border width', 'aaweb-announcement-bar' ), $settings, 0, 8, 'px' ); ?>
number_field( 'button_radius', __( 'Radius', 'aaweb-announcement-bar' ), $settings, 0, 999, 'px' ); ?>
number_field( 'button_padding_y', __( 'Padding Y', 'aaweb-announcement-bar' ), $settings, 0, 30, 'px' ); ?>
number_field( 'button_padding_x', __( 'Padding X', 'aaweb-announcement-bar' ), $settings, 0, 60, 'px' ); ?>
number_field( 'button_font_size', __( 'Font size', 'aaweb-announcement-bar' ), $settings, 10, 40, 'px' ); ?>
select_field( 'button_font_weight', __( 'Font weight', 'aaweb-announcement-bar' ), $settings, array( '400' => '400', '500' => '500', '600' => '600', '700' => '700' ) ); ?>
number_field( 'button_margin_left', __( 'Margin left', 'aaweb-announcement-bar' ), $settings, 0, 80, 'px' ); ?>
number_field( 'button_margin_right', __( 'Margin right', 'aaweb-announcement-bar' ), $settings, 0, 80, 'px' ); ?>
section_heading( '🎨', __( 'Design & layout', 'aaweb-announcement-bar' ), __( 'Control colors, typography, width and the horizontal / vertical alignment of text and button.', 'aaweb-announcement-bar' ), 'design-all' ); ?>
subsection_heading( __( 'Colors & typography', 'aaweb-announcement-bar' ), 'design-colors' ); ?>
text_field( 'background_color', __( 'Background', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'text_color', __( 'Text color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'link_color', __( 'Link color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'border_color', __( 'Border color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
number_field( 'font_size', __( 'Font size', 'aaweb-announcement-bar' ), $settings, 10, 40, 'px' ); ?>
select_field( 'font_weight', __( 'Font weight', 'aaweb-announcement-bar' ), $settings, array( '400' => '400', '500' => '500', '600' => '600', '700' => '700' ) ); ?>
subsection_heading( __( 'Layout & positioning', 'aaweb-announcement-bar' ), 'design-layout' ); ?>
number_field( 'container_width', __( 'Container width', 'aaweb-announcement-bar' ), $settings, 0, 2400, 'px', __( 'Leave empty or 0 for full width.', 'aaweb-announcement-bar' ), true ); ?>
select_field( 'horizontal_align', __( 'Horizontal alignment', 'aaweb-announcement-bar' ), $settings, array( 'left' => __( 'Left', 'aaweb-announcement-bar' ), 'center' => __( 'Center', 'aaweb-announcement-bar' ), 'right' => __( 'Right', 'aaweb-announcement-bar' ) ) ); ?>
select_field( 'vertical_align', __( 'Vertical alignment', 'aaweb-announcement-bar' ), $settings, array( 'top' => __( 'Top', 'aaweb-announcement-bar' ), 'center' => __( 'Middle', 'aaweb-announcement-bar' ), 'bottom' => __( 'Bottom', 'aaweb-announcement-bar' ) ) ); ?>
checkbox_field( 'sticky', __( 'Sticky at top', 'aaweb-announcement-bar' ), $settings ); ?>
checkbox_field( 'border_bottom', __( 'Show bottom border', 'aaweb-announcement-bar' ), $settings ); ?>
section_heading( '👁', __( 'Visibility & schedule', 'aaweb-announcement-bar' ), __( 'Choose where, when and on which devices the bar appears.', 'aaweb-announcement-bar' ), 'rules-all' ); ?>
subsection_heading( __( 'Display targeting & schedule', 'aaweb-announcement-bar' ), 'rules-display' ); ?>
select_field( 'display_rule', __( 'Display rule', 'aaweb-announcement-bar' ), $settings, array( 'sitewide' => __( 'Sitewide', 'aaweb-announcement-bar' ), 'homepage' => __( 'Homepage only', 'aaweb-announcement-bar' ), 'exclude_wc_pages' => __( 'Everywhere except cart / checkout / account', 'aaweb-announcement-bar' ), 'woo_products' => __( 'Selected WooCommerce products only', 'aaweb-announcement-bar' ), 'woo_categories' => __( 'Selected WooCommerce product categories', 'aaweb-announcement-bar' ) ) ); ?>
select_field( 'device_visibility', __( 'Devices', 'aaweb-announcement-bar' ), $settings, array( 'all' => __( 'All devices', 'aaweb-announcement-bar' ), 'desktop' => __( 'Desktop only', 'aaweb-announcement-bar' ), 'mobile' => __( 'Mobile only', 'aaweb-announcement-bar' ) ) ); ?>
text_field( 'exclude_page_ids', __( 'Exclude page IDs', 'aaweb-announcement-bar' ), $settings, 'text', '12,34,56', __( 'Comma separated IDs.', 'aaweb-announcement-bar' ) ); ?>
text_field( 'start_date', __( 'Start date', 'aaweb-announcement-bar' ), $settings, 'date' ); ?>
text_field( 'end_date', __( 'End date', 'aaweb-announcement-bar' ), $settings, 'date' ); ?>
text_field( 'target_product_ids', __( 'Target product IDs', 'aaweb-announcement-bar' ), $settings, 'text', '123,456', __( 'Used with “Selected WooCommerce products only”. Comma separated product IDs.', 'aaweb-announcement-bar' ) ); ?>
text_field( 'target_category_ids', __( 'Target product category IDs', 'aaweb-announcement-bar' ), $settings, 'text', '12,34', __( 'Used with “Selected WooCommerce product categories”. Shows on matching category archives and products in those categories.', 'aaweb-announcement-bar' ) ); ?>
subsection_heading( __( 'Countdown', 'aaweb-announcement-bar' ), 'countdown' ); ?>
checkbox_field( 'countdown_enabled', __( 'Show countdown to end date', 'aaweb-announcement-bar' ), $settings, __( 'Counts down to 23:59:59 on the selected end date using the WordPress site timezone.', 'aaweb-announcement-bar' ) ); ?>
text_field( 'countdown_label', __( 'Countdown label', 'aaweb-announcement-bar' ), $settings, 'text', __( 'Ends in', 'aaweb-announcement-bar' ) ); ?>
subsection_heading( __( 'Dismiss behavior', 'aaweb-announcement-bar' ), 'dismiss' ); ?>
checkbox_field( 'dismissible', __( 'Allow visitors to close the bar', 'aaweb-announcement-bar' ), $settings, __( 'Uses a small browser cookie/local storage key so the bar stays hidden for the selected days.', 'aaweb-announcement-bar' ) ); ?>
number_field( 'dismiss_days', __( 'Show again after', 'aaweb-announcement-bar' ), $settings, 1, 365, __( 'days', 'aaweb-announcement-bar' ) ); ?>
subsection_heading( __( 'Close button appearance (×)', 'aaweb-announcement-bar' ), 'close-style' ); ?>
text_field( 'close_bg_color', __( 'Button background color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'close_text_color', __( 'Icon color ×', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'close_hover_bg_color', __( 'Hover background color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'close_hover_text_color', __( 'Hover icon color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
text_field( 'close_border_color', __( 'Border color', 'aaweb-announcement-bar' ), $settings, 'color' ); ?>
number_field( 'close_border_width', __( 'Border width', 'aaweb-announcement-bar' ), $settings, 0, 8, 'px' ); ?>
number_field( 'close_size', __( 'Button size', 'aaweb-announcement-bar' ), $settings, 24, 64, 'px' ); ?>
number_field( 'close_icon_size', __( 'Icon size ×', 'aaweb-announcement-bar' ), $settings, 12, 40, 'px' ); ?>
number_field( 'close_radius', __( 'Border radius', 'aaweb-announcement-bar' ), $settings, 0, 999, 'px' ); ?>
number_field( 'close_right', __( 'Right spacing', 'aaweb-announcement-bar' ), $settings, 0, 80, 'px' ); ?>
section_heading( '⚙', __( 'Advanced', 'aaweb-announcement-bar' ), __( 'Developer-friendly options and preview helper.', 'aaweb-announcement-bar' ), 'advanced' ); ?>
text_field( 'custom_class', __( 'Custom CSS class', 'aaweb-announcement-bar' ), $settings, 'text', 'my-announcement-bar' ); ?>
[aaweb_announcement_bar_preview]