Plugin Directory

Changeset 3376726


Ignore:
Timestamp:
10/11/2025 04:10:09 PM (6 months ago)
Author:
iomidev
Message:

Release version 1.4.0

Location:
uniqselprotb/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • uniqselprotb/trunk/assets/css/uniqselprotb-admin.css

    r3357146 r3376726  
    6969}
    7070
    71 .form-table-style input  {
     71.form-table-style input:not([type="checkbox"])  {
    7272    width: 100px;
    7373}
     
    107107    padding: 10px;
    108108}
     109
     110.container-icon  {
     111    border: 1px solid #8c8f94;
     112    -webkit-border-radius: 5px;
     113    -moz-border-radius: 5px;
     114    border-radius: 5px;
     115    cursor: pointer;
     116    display: inline-block;
     117    height: 20px;
     118    padding: 4px;
     119    text-align: center;
     120    vertical-align: middle;
     121    width: 20px;
     122}
     123
     124.modal-icons {
     125    display: none;
     126    position: fixed;
     127    z-index: 1;
     128    left: 0;
     129    top: 0;
     130    width: 100%;
     131    height: 100%;
     132    overflow: auto;
     133    background-color: rgb(0,0,0);
     134    background-color: rgba(0,0,0,0.4);
     135}
     136
     137.modal-icons .modal-content {
     138    background-color: #fefefe;
     139    margin: 15% auto;
     140    padding: 20px;
     141    border: 1px solid #888;
     142    width: 50%;
     143}
     144
     145.modal-icons .close {
     146    color: #aaa;
     147    float: right;
     148    font-size: 28px;
     149    font-weight: bold;
     150}
     151
     152.modal-icons .close:hover,
     153.modal-icons .close:focus {
     154    color: black;
     155    text-decoration: none;
     156    cursor: pointer;
     157}
     158
     159.modal-icons .icons  {
     160    margin-top: 50px;
     161}
     162
     163.modal-icons .modal-container-icon  {
     164    border: 1px solid #8c8f94;
     165    -webkit-border-radius: 5px;
     166    -moz-border-radius: 5px;
     167    border-radius: 5px;
     168    cursor: pointer;
     169    display: inline-block;
     170    height: 30px;
     171    margin-left: 10px;
     172    margin-top: 10px;
     173    padding: 4px;
     174    text-align: center;
     175    vertical-align: middle;
     176    width: 30px;
     177}
     178
     179.modal-icons .modal-container-icon i  {
     180    font-size: 24px;
     181}
  • uniqselprotb/trunk/assets/css/uniqselprotb.css

    r3357146 r3376726  
    7373}
    7474
     75.usps-top-banner.header-usps.sticky  {
     76    position: sticky;
     77    top: 0;
     78    z-index: 9999;
     79}
     80
     81.logged-in .usps-top-banner.header-usps.sticky  {
     82    top: 32px;
     83}
     84
    7585@media (max-width: 1024px) {
    7686    .usps-top-banner.header-usps span.usp-item {
  • uniqselprotb/trunk/assets/js/uniqselprotb-admin.js

    r3357146 r3376726  
    44 * @package UNIQSELPROTB
    55 */
     6jQuery(document).ready(function($) {
    67
    7 jQuery( document ).ready(
    8     function ( $ ) {
    9         $( '.unique-selling-propositions-top-banner-color-field' ).wpColorPicker();
     8    // Initialize color picker
     9    $('.unique-selling-propositions-top-banner-color-field').wpColorPicker();
    1010
    11         function showSettingsForm()
    12         {
    13             $( '#form-settings' ).show();
    14             $( '#form-style' ).hide();
     11    // -------------------------
     12    // FORM TOGGLE FUNCTIONS
     13    // -------------------------
     14
     15    function showSettingsForm() {
     16        $('#form-settings').show();
     17        $('#form-style').hide();
     18    }
     19
     20    function showStyleForm() {
     21        $('#form-settings').hide();
     22        $('#form-style').show();
     23    }
     24
     25    // -------------------------
     26    // USP ADD / DELETE LOGIC
     27    // -------------------------
     28
     29    // Add new USP row
     30    function applyClickEventOnAddNewUsp() {
     31        $('#add-new-usp').on('click', function(e) {
     32            e.preventDefault();
     33
     34            const countUsps = $('#form-table-settings tr.tr-heading').length;
     35
     36            // Get the last row pair
     37            const $lastRowTrHeading = $('#form-table-settings tr.tr-heading:last');
     38            const $lastRowTrInputs  = $('#form-table-settings tr.tr-inputs:last');
     39
     40            // Clone rows
     41            const $newRowHeading = $lastRowTrHeading.clone();
     42            const $newRowInputs  = $lastRowTrInputs.clone();
     43
     44            // Update labels and inputs
     45            $newRowHeading.find('th:first label')
     46                .attr('for', 'uniqselprotb_usp_' + countUsps)
     47                .text('USP ' + (countUsps + 1));
     48
     49            $newRowHeading.find('th:last label')
     50                .attr('for', 'uniqselprotb_usp_icon_' + countUsps);
     51
     52            $newRowInputs.find('td:first input[type="text"]')
     53                .attr('id', 'uniqselprotb_settings_usp_' + countUsps)
     54                .attr('name', 'uniqselprotb_settings[usp_' + countUsps + ']')
     55                .val('');
     56
     57            $newRowInputs.find('td:last .container-icon')
     58                .attr('data-index', countUsps);
     59
     60            $newRowInputs.find('td:last input[type="hidden"]')
     61                .attr('id', 'icon-' + countUsps)
     62                .attr('name', 'uniqselprotb_settings[usp_icon_' + countUsps + ']');
     63
     64            // Append new rows
     65            $('#form-table-settings tbody')
     66                .append($newRowHeading)
     67                .append($newRowInputs);
     68        });
     69    }
     70
     71    // Delete USP row (delegated — works for dynamically added rows)
     72    $(document).on('click', '.delete-usp', function() {
     73        const uspsCount = $('tr.tr-inputs').length;
     74
     75        if (uspsCount === 1) {
     76            alert('This item cannot be deleted because it is the only unique selling point (USP) left.');
     77            return;
    1578        }
    1679
    17         function showStyleForm()
    18         {
    19             $( '.form-settings' ).hide();
    20             $( '#form-style' ).show();
     80        const $parentRow = $(this).closest('tr.tr-inputs');
     81        const $headingRow = $parentRow.prev('tr.tr-heading');
     82
     83        $parentRow.remove();
     84        $headingRow.remove();
     85
     86        // Re-index all rows
     87        const $trHeadings = $('tr.tr-heading');
     88        const $trInputs   = $('tr.tr-inputs');
     89
     90        $trHeadings.each(function(index, el) {
     91            $(el).find('.th-usp label')
     92                .attr('for', 'uniqselprotb_usp_' + index)
     93                .text('USP ' + (index + 1));
     94
     95            $(el).find('.th-icon label')
     96                .attr('for', 'uniqselprotb_usp_icon_' + index);
     97        });
     98
     99        $trInputs.each(function(index, el) {
     100            $(el).find('td input[type="text"]')
     101                .attr('id', 'uniqselprotb_settings_usp_' + index)
     102                .attr('name', 'uniqselprotb_settings[usp_' + index + ']');
     103
     104            $(el).find('td:last .container-icon')
     105                .attr('data-index', index);
     106
     107            $(el).find('td input[type="hidden"]')
     108                .attr('id', 'icon-' + index)
     109                .attr('name', 'uniqselprotb_settings[usp_icon_' + index + ']');
     110        });
     111    });
     112
     113    // -------------------------
     114    // MODAL ICON PICKER
     115    // -------------------------
     116
     117    let uspIcon = null;
     118    let uspIndex = 0;
     119
     120    // Open modal and store clicked icon reference
     121    $(document).on('click', '.container-icon, .container-icon i', function() {
     122        const $container = $(this).closest('.container-icon');
     123        uspIcon  = $container.children('i').first(); // safer than find()
     124        uspIndex = $container.data('index');
     125
     126        $('#modal-icons').show();
     127    });
     128
     129    // Close modal (bind once)
     130    $('#modal-icons .close').on('click', function() {
     131        $('#modal-icons').hide();
     132    });
     133
     134    // Select icon inside modal
     135    $('#modal-icons .icons').on('click.iconHandler', '.modal-container-icon, .modal-container-icon i', function() {
     136        if (!uspIcon) return;
     137
     138        const $container = $(this).closest('.modal-container-icon');
     139        const iconClass  = $container.data('icon');
     140
     141        // Apply selected icon
     142        uspIcon.attr('class', iconClass);
     143
     144        // Update hidden input value
     145        $('#icon-' + uspIndex).val(iconClass);
     146
     147        // Close modal
     148        $('#modal-icons').hide();
     149    });
     150
     151    // -------------------------
     152    // TAB SWITCHING
     153    // -------------------------
     154
     155    $('.nav-tab').on('click', function() {
     156        const tabId = $(this).attr('href');
     157
     158        if (tabId === '#form-settings') {
     159            showSettingsForm();
     160        } else if (tabId === '#form-style') {
     161            showStyleForm();
    21162        }
    22163
    23         function applyClickEventOnAddNewUsp()
    24         {
    25             $( '#add-new-usp' ).on(
    26                 'click' ,
    27                 function ( e ) {
     164        $('.nav-tab').removeClass('nav-tab-active');
     165        $(this).addClass('nav-tab-active');
    28166
    29                     e.preventDefault();
     167        return false;
     168    });
    30169
    31                     const countUsps = $( '#form-table-settings tr.tr-heading' ).length;
     170    // -------------------------
     171    // INITIALIZE
     172    // -------------------------
    32173
    33                     // Get the last .tr-heading row inside tbody.
    34                     var $lastRowTrHeading = $( '#form-table-settings tr.tr-heading:last' );
    35                     var $lastRowTrInputs  = $( '#form-table-settings tr.tr-inputs:last' );
     174    showSettingsForm();
     175    applyClickEventOnAddNewUsp();
    36176
    37                     // Clone last row.
    38                     var $newRowHeading = $lastRowTrHeading.clone();
    39 
    40                     var $newRowInputs = $lastRowTrInputs.clone();
    41 
    42                     $newRowHeading.find( 'th:first label' ).attr( 'for', 'uniqselprotb_usp_' + countUsps ).text( 'USP ' + ( countUsps + 1 ) );
    43                     $newRowHeading.find( 'th:last label' ).attr( 'for', 'uniqselprotb_usp_icon_' + countUsps );
    44 
    45                     $newRowInputs.find( 'td:first input' )
    46                     .attr( 'id', 'uniqselprotb_settings_usp_' + countUsps )
    47                     .attr( 'name', 'uniqselprotb_settings[usp_' + countUsps + ']' )
    48                     .val( '' );
    49 
    50                     $newRowInputs.find( 'td:last select' )
    51                     .attr( 'name', 'uniqselprotb_settings[usp_icon_' + countUsps + ']' );
    52 
    53                     // Append the new row to the table.
    54                     $( '#form-table-settings tbody' ).append( $newRowHeading ).append( $newRowInputs );
    55 
    56                     applyClickEventOnDeleteUsp();
    57                 }
    58             );
    59         }
    60 
    61         function applyClickEventOnDeleteUsp()
    62         {
    63             $( '.delete-usp' ).on(
    64                 'click' ,
    65                 function ( e ) {
    66                     const uspsCount = $( 'tr.tr-inputs' ).length;
    67 
    68                     if (uspsCount === 1 ) {
    69                         alert( 'This item cannot be deleted because it is the only unique selling point (USP) left.' );
    70                     } else {
    71                         const parentRow           = $( this ).closest( 'tr.tr-inputs' );
    72                         const previewRowTrHeading = parentRow.prev( 'tr.tr-heading' );
    73 
    74                         parentRow.remove();
    75                         previewRowTrHeading.remove();
    76 
    77                         const trHeadings = $( 'tr.tr-heading' );
    78                         const trInputs   = $( 'tr.tr-inputs' );
    79 
    80                         $.each(
    81                             trHeadings,
    82                             function (index, el) {
    83                                 $( el ).find( '.th-usp label' )
    84                                 .attr( 'for', 'uniqselprotb_usp_' + (index) )
    85                                 .text( 'USP ' + (index + 1) );
    86 
    87                                 $( el ).find( '.th-icon label' )
    88                                 .attr( 'for', 'uniqselprotb_usp_icon_' + (index) );
    89                             }
    90                         );
    91 
    92                         $.each(
    93                             trInputs,
    94                             function (index, el) {
    95                                 $( el ).find( 'td input[type="text"]' )
    96                                 .attr( 'id', 'uniqselprotb_settings_usp_' + (index) )
    97                                 .attr( 'name', 'uniqselprotb_settings[usp_' + index + ']' );
    98 
    99                                 $( el ).find( 'td select' )
    100                                 .attr( 'id', 'icon-' + (index) )
    101                                 .attr( 'name', 'uniqselprotb_settings[usp_icon_' + index + ']' );
    102                             }
    103                         );
    104                     }
    105                 }
    106             );
    107         }
    108 
    109         showSettingsForm();
    110 
    111         $( '.nav-tab' ).on(
    112             'click' ,
    113             function () {
    114                 const tabId = $( this ).attr( 'href' );
    115 
    116                 if (tabId === '#form-settings' ) {
    117                     showSettingsForm()
    118                 } else if (tabId === '#form-style' ) {
    119                     showStyleForm();
    120                 }
    121 
    122                 $( '.nav-tab' ).removeClass( 'nav-tab-active' );
    123                 $( this ).addClass( 'nav-tab-active' );
    124 
    125                 return false;
    126             }
    127         );
    128 
    129         applyClickEventOnAddNewUsp();
    130         applyClickEventOnDeleteUsp();
    131 
    132     }
    133 );
     177});
  • uniqselprotb/trunk/includes/constants/class-uniqselprotb-font-awesome-constant.php

    r3357146 r3376726  
    2323
    2424    const ICONS_LIST = array(
    25         'fa-solid fa-truck'          => 'Truck',
    26         'fa-solid fa-envelope'       => 'Envelope',
    27         'fa-solid fa-map-marker-alt' => 'Map Marker',
    28         'fa-solid fa-phone'          => 'Phone',
    29         'fa-solid fa-box'            => 'Box',
    30         'fa-solid fa-user'           => 'User',
    31         'fa-solid fa-clock'          => 'Clock',
    3225        'fa-solid fa-calendar'       => 'Calendar',
    33         'fa-solid fa-store'          => 'Store',
    3426        'fa-solid fa-shipping-fast'  => 'Fast Shipping',
    35         'fa-solid fa-globe'          => 'Globe',
    3627        'fa-solid fa-clipboard-list' => 'Checklist',
    37         'fa-solid fa-undo'           => 'Returns',
    38         'fa-solid fa-check-circle'   => 'Check Circle',
     28
     29        // --- Trust & Security ---
     30        'fa-solid fa-lock'                => 'Secure Payment',
     31        'fa-solid fa-shield-halved'       => 'Buyer Protection',
     32        'fa-solid fa-certificate'         => 'Certified Quality',
     33        'fa-solid fa-user-shield'         => 'Data Protection',
     34        'fa-solid fa-fingerprint'         => 'Authentication',
     35        'fa-solid fa-check-circle'        => 'Verified Quality',
     36
     37        // --- Shipping & Delivery ---
     38        'fa-solid fa-truck'               => 'Fast Delivery',
     39        'fa-solid fa-truck-fast'          => 'Express Shipping',
     40        'fa-solid fa-box'                 => 'Safe Packaging',
     41        'fa-solid fa-warehouse'           => 'In Stock',
     42        'fa-solid fa-globe'               => 'Worldwide Shipping',
     43        'fa-solid fa-plane'               => 'International Delivery',
     44
     45        // --- Support & Service ---
     46        'fa-solid fa-headset'             => 'Customer Support',
     47        'fa-solid fa-phone'               => '24/7 Hotline',
     48        'fa-solid fa-envelope'            => 'Email Support',
     49        'fa-solid fa-comments'            => 'Live Chat',
     50        'fa-solid fa-user'                => 'Personal Service',
     51        'fa-solid fa-users'               => 'Community Support',
     52
     53        // --- Return & Guarantee ---
     54        'fa-solid fa-rotate-left'         => 'Easy Returns',
     55        'fa-solid fa-undo'                => 'Money-Back Guarantee',
     56
     57        // --- Price & Savings ---
     58        'fa-solid fa-tags'                => 'Best Price',
     59        'fa-solid fa-percent'             => 'Discounts Available',
     60        'fa-solid fa-coins'               => 'Value for Money',
     61        'fa-solid fa-gift'                => 'Free Gifts',
     62
     63        // --- Quality & Materials ---
     64        'fa-solid fa-gem'                 => 'Premium Quality',
     65        'fa-solid fa-crown'               => 'Top Brand',
     66        'fa-solid fa-award'               => 'Award Winning',
     67        'fa-solid fa-hammer'              => 'Durable Materials',
     68
     69        // --- Sustainability & Ethics ---
     70        'fa-solid fa-leaf'                => 'Eco Friendly',
     71        'fa-solid fa-recycle'             => 'Recyclable Packaging',
     72        'fa-solid fa-solar-panel'         => 'Energy Efficient',
     73        'fa-solid fa-hand-holding-heart'  => 'Social Responsibility',
     74
     75        // --- Convenience & Availability ---
     76        'fa-solid fa-clock'               => 'Quick Processing',
     77        'fa-solid fa-store'               => 'Local Pickup',
     78        'fa-solid fa-map-marker-alt'      => 'Find Us Easily',
     79        'fa-solid fa-calendar-check'      => 'Flexible Scheduling',
     80        'fa-solid fa-credit-card'         => 'Multiple Payment Methods',
     81
     82        // --- Technology & Innovation ---
     83        'fa-solid fa-bolt'                => 'Cutting Edge Tech',
     84        'fa-solid fa-microchip'           => 'Smart Features',
     85        'fa-solid fa-robot'               => 'AI Integration',
     86
     87        // --- Brand & Recognition ---
     88        'fa-brands fa-apple'              => 'Apple Compatible',
     89        'fa-brands fa-android'            => 'Android Friendly',
     90        'fa-brands fa-paypal'             => 'PayPal Accepted',
     91        'fa-brands fa-cc-visa'            => 'Visa Support',
     92        'fa-brands fa-cc-mastercard'      => 'Mastercard Support',
    3993    );
    4094}
  • uniqselprotb/trunk/includes/constants/class-uniqselprotb-plugin-constant.php

    r3357146 r3376726  
    6868    const ALLOWED_SETTINGS_FIELDS = array( 'usp_0', 'usp_1', 'usp_2', 'usp_icon_0', 'usp_icon_1', 'usp_icon_2' );
    6969
    70     const ALLOWED_STYLE_FIELDS = array( 'background_color', 'text_color', 'font_size', 'font_size_unit', 'font_weight', 'font_style', 'padding_bottom', 'padding_top', 'padding_left', 'padding_right', 'padding_bottom_unit', 'padding_top_unit', 'padding_left_unit', 'padding_right_unit' );
     70    const ALLOWED_STYLE_FIELDS = array( 'is_sticky', 'background_color', 'text_color', 'font_size', 'font_size_unit', 'font_weight', 'font_style', 'padding_bottom', 'padding_top', 'padding_left', 'padding_right', 'padding_bottom_unit', 'padding_top_unit', 'padding_left_unit', 'padding_right_unit' );
    7171}
  • uniqselprotb/trunk/includes/controllers/class-uniqselprotb-admin-controller.php

    r3357146 r3376726  
    5353     */
    5454    public function uniqselprotb_enqueue_styles() {
     55        if ( ! is_admin() ) {
     56            return;
     57        }
     58
     59        // Enqueue Font Awesome if not already loaded.
     60        if ( ! wp_style_is( 'font-awesome-6', 'enqueued' ) ) {
     61            wp_enqueue_style(
     62                'font-awesome-6',
     63                UNIQSELPROTB_PLUGIN_URL . 'assets/font-awesome/css/all.min.css',
     64                array(),
     65                '6.7.2'
     66            );
     67        }
     68
    5569        wp_enqueue_style(
    5670            'uniqselprotb-admin-style',
     
    165179        }
    166180
     181        $is_sticky = $options_style['is_sticky'] ?? 0;
    167182        $background_color = $options_style['background_color'] ?? UNIQSELPROTB_Plugin_Constant::DEFAULT_BACKGROUND_COLOR;
    168183        $text_color       = $options_style['text_color'] ?? UNIQSELPROTB_Plugin_Constant::DEFAULT_TEXT_COLOR;
     
    348363                    $default_value   = UNIQSELPROTB_Plugin_Constant::DEFAULT_PADDING_RIGHT_UNIT;
    349364                    $sanitized_value = sanitize_text_field( $value );
     365                } elseif ( 'is_sticky' === $key ) {
     366                    $default_value   = 0;
     367                    $sanitized_value = sanitize_text_field( $value );
    350368                }
    351369                $sanitized_style[ $key ] = $sanitized_value ?? $default_value;
  • uniqselprotb/trunk/includes/controllers/class-uniqselprotb-frontend-controller.php

    r3357146 r3376726  
    6161            UNIQSELPROTB_PLUGIN_URL . 'assets/css/uniqselprotb.css',
    6262            array(),
    63             '1.1.0',
     63            '1.4.0',
    6464            'all'
    6565        );
     
    7272                UNIQSELPROTB_PLUGIN_URL . 'assets/js/uniqselprotb-frontend.js',
    7373                array( 'jquery' ),
    74                 '1.1.0',
     74                '1.4.0',
    7575                array( 'strategy' => 'defer' )
    7676            );
     
    8080                UNIQSELPROTB_PLUGIN_URL . 'assets/js/uniqselprotb-frontend.js',
    8181                array( 'jquery' ),
    82                 '1.1.0',
     82                '1.4.0',
    8383                true
    8484            );
     
    359359
    360360        $usps    = array();
    361         $options = get_option( 'uniqselprotb_settings', array() );
    362 
    363         if ( ! is_array( $options ) ) {
    364             $options = array();
    365         }
    366 
    367         if ( ! empty( $options ) ) {
    368             $usps[ $current_language ] = $this->uniqselprotb_build_unique_selling_propositions_by_options( $options );
     361        $optionsSettings = get_option( 'uniqselprotb_settings', array() );
     362
     363        if ( ! is_array( $optionsSettings ) ) {
     364            $optionsSettings = array();
     365        }
     366
     367        if ( ! empty( $optionsSettings ) ) {
     368            $usps[ $current_language ] = $this->uniqselprotb_build_unique_selling_propositions_by_options( $optionsSettings );
     369        }
     370
     371        $optionsStyle = get_option( 'uniqselprotb_style', array() );
     372
     373        if ( ! is_array( $optionsStyle ) ) {
     374            $optionsStyle = array();
    369375        }
    370376
    371377        $current_usps = $usps[ $current_language ] ?? array();
     378
     379        $isSticky = isset($optionsStyle['is_sticky']) && (bool) $optionsStyle['is_sticky'];
    372380
    373381        if ( ! empty( $current_usps ) ) {
    374382            $usp_count = count( $current_usps['usps'] );
    375383
    376             $html  = '<div class="usps-top-banner header-usps">';
     384            $html  = '<div class="usps-top-banner header-usps' . ( $isSticky ? ' sticky' : '' ) . '">';
    377385            $html .= '<div class="header-usps-column column-center full-width">';
    378386
  • uniqselprotb/trunk/includes/views/uniqselprotb-form-settings.php

    r3357146 r3376726  
    6262                            </td>
    6363                            <td>
     64                                <span class="container-icon" data-index="<?php echo esc_attr( $i ) ?>"><i class="<?php echo esc_attr( $icon ) ?>"></i></span>
    6465                                <?php
    6566                                $name   = 'uniqselprotb_settings[usp_icon_' . $i . ']';
    6667                                $css_id = 'icon-' . $i;
    6768                                ?>
    68                                 <select name="<?php echo esc_attr( $name ); ?>" id="<?php echo esc_attr( $css_id ); ?>">
    69                                     <?php
    70                                     foreach ( $icons as $icon_class => $icon_name ) {
    71                                         $selected = false;
    72                                         if ( $icon_class === $icon ) {
    73                                             $selected = true;
    74                                         }
    75                                         if ( $selected ) {
    76                                             echo '<option value="' . esc_attr( $icon_class ) . '" selected><i class="' . sanitize_html_class( $icon_class ) . '"></i>' . esc_html( $icon_name ) . '</option>';
    77                                         } else {
    78                                             echo '<option value="' . esc_attr( $icon_class ) . '">' . esc_html( $icon_name ) . '</option>';
    79                                         }
    80                                     }
    81                                     ?>
    82                                 </select>
     69                                <input type="hidden" name="<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $icon ); ?>" id="<?php echo esc_attr( $css_id ); ?>">
    8370                                <span class="dashicons dashicons-trash delete-usp"></span>
    8471                            </td>
     
    9582        <?php submit_button( 'Save Changes' ); ?>
    9683    </form>
     84    <div class="modal-icons" id="modal-icons" style="border: 2px solid green;">
     85        <div class="modal-content">
     86            <span class="close">&times;</span>
     87
     88            <h3>Font Awesome</h3>
     89            <div class="icons">
     90            <?php
     91
     92            foreach ( $icons as $icon_class => $icon_name ) {
     93
     94
     95                $classes = explode( ' ', $icon_class );
     96                $classes = array_map( 'sanitize_html_class', $classes );
     97                $icon_class = implode( ' ', $classes );
     98
     99                echo '<span class="modal-container-icon" data-icon="' . esc_attr( $icon_class ) . '"><i class="' . esc_attr( $icon_class ) . '"></i></span>';
     100            }
     101            ?>
     102            </div>
     103
     104        </div>
     105    </div>
    97106</div>
  • uniqselprotb/trunk/includes/views/uniqselprotb-form-style.php

    r3357146 r3376726  
    1818 * View for form style in admin panel
    1919 *
     20 * @var string $is_sticky
    2021 * @var string $background_color
    2122 * @var string $text_color
     
    4849        <h3>Style</h3>
    4950        <p id="style-description">Customize the look of your USP banner with options for text color and background color.</p>
    50         <div class="container-table">
     51        <div class="container-table">
     52            <table class="form-table form-table-style">
     53                <tr>
     54                    <th style="width: 200px;">Sticky</th>
     55                    <th style="width: auto;"></th>
     56                </tr>
     57                <tr>
     58                    <td><label for="<?php echo esc_attr( 'uniqselprotb_is_sticky' ); ?>">Is Sticky</label></td>
     59                    <td>
     60                        <input
     61                            type="checkbox"
     62                            id="uniqselprotb_is_sticky"
     63                            class="unique-selling-propositions-top-banner-is-sticky-field"
     64                            name="uniqselprotb_style[is_sticky]"
     65                            value="1"
     66                            <?php checked( $is_sticky, 1 ); ?>
     67                        />
     68
     69                    </td>
     70                </tr>
     71            </table>
     72        </div>
     73        <div class="container-table">
    5174            <table class="form-table form-table-style">
    5275                <tr>
  • uniqselprotb/trunk/readme.txt

    r3357146 r3376726  
    44Tags: unique selling propositions, banner
    55Requires at least: 6.0
    6 Tested up to: 6.8.2
     6Tested up to: 6.8
    77Requires PHP: 8.0
    8 Stable tag: 1.3.0
     8Stable tag: 1.4.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1414== Description ==
    1515
    16 Unique Selling Propositions Top Banner is a lightweight and user-friendly plugin that lets WordPress admins showcase up to three key selling propositions at the very top of their website. Perfect for quickly communicating benefits like free shipping, secure checkout, or fast delivery.
     16Unique Selling Propositions Top Banner is a lightweight and user-friendly plugin that lets WordPress admins showcase unique selling propositions at the very top of their website. Perfect for quickly communicating benefits like free shipping, secure checkout, or fast delivery.
    1717
    1818### Features
     
    9494== Changelog ==
    9595
     96= 1.4.0 =
     97* Added more icons
     98* Added modal box with icons to select for USPs
     99* Added option to make the banner sticky
     100
    96101= 1.3.0 =
    97102* Added support for more than 3 USPs
  • uniqselprotb/trunk/uniqselprotb.php

    r3357146 r3376726  
    2020 * Description:      Unique Selling Propositions Top Banner for WordPress
    2121 *                   with configurable USPs and icons.
    22  * Version:          1.3.0
     22 * Version:          1.4.0
    2323 * Requires at least: 6.0
    2424 * Requires PHP:      8.0
    25  * Tested up to:      6.8.2
     25 * Tested up to:      6.8
    2626 * Created: April 4, 2025
    2727 * Author:          Ioanna Mitroulaki
Note: See TracChangeset for help on using the changeset viewer.