Plugin Directory

Changeset 3415975


Ignore:
Timestamp:
12/10/2025 04:39:05 AM (5 weeks ago)
Author:
pickplugins
Message:

version update

Location:
related-post/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • related-post/trunk/assets/settings-tabs/settings-tabs.css

    r2817020 r3415975  
    2525
    2626
     27.settings-tabs .disabled {
     28    color: #f00;
     29}
    2730
    2831/* Collapsible */
     
    5356    display: block;
    5457}
     58
    5559
    5660
     
    7882
    7983.settings-tabs .tab-nav {
    80     width: 200px;
     84    width: 250px;
    8185    padding: 12px 10px;
    8286    background: #f1f1f1;
     
    8488    border-bottom: 1px solid #eee;
    8589    cursor: pointer;
    86     font-size: 13px;
     90    font-size: 16px;
     91    border-bottom: 1px solid #ddd;
     92    box-sizing: border-box;
    8793}
    8894
     
    106112
    107113.settings-tabs .tab-content {
    108     margin-left: 220px;
     114    margin-left: 250px;
    109115    padding: 0px 0;
    110116    background: #f1f1f159;
     
    174180
    175181
    176 
    177 
    178 
    179 
     182.radio-img .name {
     183
     184    padding: 5px;
     185    text-align: center;
     186    position: absolute;
     187    bottom: 0;
     188    width: 100%;
     189    left: 0;
     190}
     191
     192
     193
     194
     195.radio-img label {
     196    display: inline-block;
     197    vertical-align: top;
     198    margin: 5px;
     199    padding: 5px;
     200    background: #eee;
     201    position: relative;
     202    border-radius: 5px;
     203    overflow: hidden;
     204    padding-bottom: 30px;
     205}
     206
     207.radio-img label.active .name {
     208    background: #1976ec;
     209
     210}
     211
     212
     213.radio-img label.active {
     214    background: #1976ec;
     215    color: #fff;
     216    font-weight: bold;
     217}
     218
     219.radio-img label.disabled {
     220    background: #e2e2e2;
     221
     222}
     223
     224.radio-img label.disabled img {
     225    background: #e2e2e2;
     226    opacity: .3;
     227}
     228
     229.radio-img label.disabled .pro-msg {
     230    background: #ffd87f;
     231    position: absolute;
     232    top: 50%;
     233    left: 50%;
     234    transform: translate(-50%, -50%);
     235    padding: 0 10px;
     236
     237}
     238
     239.radio-img label .link {
     240    background: hsl(200, 7%, 42%);
     241    position: absolute;
     242    top: 2px;
     243    /* transform: translate(0%,-50%); */
     244    padding: 3px 14px;
     245    text-decoration: none;
     246    font-size: 14px;
     247    color: #fff;
     248    right: 2px;
     249
     250}
     251
     252
     253.radio-img input[type=radio] {
     254    display: none;
     255}
     256
     257.radio-img img {
     258
     259    vertical-align: top;
     260    width: 100%;
     261}
    180262
    181263
     
    191273.settings-tabs .section-title {
    192274    padding: 0 15px;
    193     font-size: 16px;
     275    font-size: 24px;
    194276    font-weight: 600;
    195277}
     
    198280    padding: 0 15px;
    199281    margin-bottom: 25px;
     282    font-size: 16px;
     283
    200284}
    201285
     
    207291}
    208292
     293.settings-tabs input[type="text"],
     294.settings-tabs input[type="number"],
     295.settings-tabs .range-slider,
     296.settings-tabs input[type="email"],
     297.settings-tabs textarea,
     298.settings-tabs select,
     299.settings-tabs input[type="range"] {
     300    border: 2px solid #2563eb69;
     301    border-radius: 0;
     302    padding: 5px 10px;
     303
     304}
     305
     306.settings-tabs input[type=radio],
     307.settings-tabs input[type=checkbox] {
     308    background: #fff;
     309    padding: 5px 10px;
     310    border: 1px solid #2563eb69;
     311
     312
     313}
     314
     315.settings-tabs input[type=radio]:checked {
     316    background: #2563eb69;
     317    padding: 5px 10px;
     318
     319}
     320
     321.settings-tabs input[type=radio]:checked::before {
     322    border: 3px solid #fff;
     323    background: #2563eb69;
     324}
     325
     326
     327.settings-tabs input[type=checkbox] {
     328    border-radius: 0;
     329}
     330
     331.settings-tabs input[type=checkbox]:checked {}
     332
     333.settings-tabs input[type=checkbox]:checked::before {}
     334
    209335.settings-tabs .setting-field:last-child {}
    210336
     
    214340    width: 270px;
    215341    float: left;
    216     font-size: 14px;
     342    font-size: 18px;
    217343    word-break: break-word;
     344    font-weight: 600;
    218345}
    219346
     
    224351.settings-tabs .setting-field .description {
    225352    word-break: break-word;
     353    font-size: 16px;
     354    margin: 10px 0;
     355
    226356}
    227357
     
    241371
    242372.settings-tabs .expandable .setting-field {
    243     padding: 0 15px 15px 0px;
     373    padding: 10px 0;
     374    margin: 10px 0;
    244375}
    245376
     
    250381.settings-tabs .expandable .setting-field .field-input {
    251382    margin-left: 270px;
    252 }
    253 
    254 
    255 .settings-tabs .expandable .setting-field {
    256     padding: 0 15px 15px 0px;
    257383}
    258384
     
    344470
    345471.settings-tabs input[type="text"],
     472.settings-tabs input[type="number"],
    346473.settings-tabs .range-slider,
    347474.settings-tabs input[type="email"],
     
    350477.settings-tabs input[type="range"] {
    351478    width: 360px;
    352     background: #f1f1f1;
     479    background: #ffffff;
    353480}
    354481
     
    418545
    419546
    420 .settings-tabs .expandable {}
    421547
    422548.settings-tabs .expandable .item {
    423 
    424549    margin: 1px 0;
    425 
    426 }
    427 
    428 
    429 .settings-tabs .expandable .header label {}
    430 
    431 
     550}
    432551
    433552.settings-tabs .expandable .header {
    434553    background: #eee none repeat scroll 0 0;
    435 
    436 }
    437 
    438 
    439 .settings-tabs .expandable {}
     554}
    440555
    441556.settings-tabs .expandable .options {
    442     background: #bde6fc;
    443557    display: none;
    444558    padding: 10px;
    445559}
    446560
    447 
    448 
    449 .settings-tabs .expandable .options {
    450     background: #f1f1f1;
    451     display: none;
    452     padding: 10px;
    453 }
    454 
    455 
    456561.settings-tabs .expandable .item.ui-sortable-helper {
    457562    border: 1px dashed rgb(153, 153, 153);
     
    462567.settings-tabs .expandable .header {
    463568    padding: 10px 15px;
     569    position: relative;
    464570    display: flex;
    465571    align-items: center;
     572
    466573}
    467574
     
    482589}
    483590
    484 
    485 /*.settings-tabs .expandable .active .options {*/
    486 
    487 /*    display: block;*/
    488 
    489 /*}*/
    490 
    491591.settings-tabs .expandable .options.active {
    492 
    493592    display: block;
    494 
    495593}
    496594
     
    524622    padding: 5px;
    525623    cursor: pointer;
    526     width: 100%;
    527 }
     624    margin-right: 10px;
     625}
     626
     627.settings-tabs .expandable .item .header-text {
     628
     629    width: 90%;
     630}
     631
    528632
    529633.settings-tabs .expandable .remove {
     
    581685
    582686
     687.range-input {}
     688
     689        .range-input .range-value {
     690          display: inline-block;
     691          vertical-align: top;
     692          margin: 0 0;
     693          padding: 4px 10px;
     694          background: #eee;
     695        }
     696
     697.text-icon {}
     698
     699        .text-icon .icon {
     700          /* width: 30px; */
     701          background: #ddd;
     702          /* height: 28px; */
     703          display: inline-block;
     704          vertical-align: top;
     705          text-align: center;
     706          font-size: 14px;
     707          padding: 5px 10px;
     708          line-height: normal;
     709        }
     710
     711
     712
     713
     714
     715
     716
     717
     718
     719
    583720
    584721@media only screen and (min-width: 1024px) {}
  • related-post/trunk/assets/settings-tabs/settings-tabs.js

    r2817020 r3415975  
    1 
    21(function ($) {
    3 
     2    //jQuery(document).ready(function($){
    43    $(document).ready(function () {
    5 
    64        $(".settings-tabs-loading").fadeOut();
    75        $(".settings-tabs").fadeIn();
     
    1311            collapsible: true,
    1412        });
    15 
     13        $(".color-picker").wpColorPicker();
    1614        $(".settings-tabs [colorPicker]").wpColorPicker();
    17 
     15        $(".datepicker").datepicker({
     16            dateFormat: ""
     17        });
     18
     19        $(document).on("keyup", ".text-icon input", function () {
     20            val = $(this).val();
     21            if (val) {
     22                $(this).parent().children(".icon").html(val);
     23            }
     24        })
     25
     26        wp.codeEditor.initialize($('.code-editor'), { type: "text/javascript" });
     27        wp.codeEditor.initialize($('.css_editor'), { type: "text/css" });
     28
     29        $(document).on("change", ".range", function () {
     30            val = $(this).val();
     31            if (val) {
     32                $(this).parent().children(".range-value").html(val);
     33            }
     34        })
    1835
    1936        $(".settings-tabs .accordion[sortable='true']").sortable({
     
    4562
    4663
    47             //console.log('Hello click');
    48             //console.log(id);
     64
    4965
    5066            $(this).parent().parent().children('.tab-content').removeClass('active');
     
    98114                src_filename = attachment.filename;
    99115
    100                 //console.log(attachment);
     116
    101117
    102118                $(this_).prev().val(attachmentId);
     
    137153                attachmentId = attachment.id;
    138154                src_url = attachment.url;
    139                 //console.log(attachment);
     155
    140156
    141157                $(this_).prev().val(src_url);
     
    158174        })
    159175
    160         $(document).on('click', '.settings-tabs .input-text-multi-wrapper .add-item', function () {
     176
     177        jQuery(document).on('click', '.settings-tabs .input-text-multi-wrapper .add-item', function () {
    161178
    162179            dataName = $(this).attr('data-name');
     
    179196
    180197
    181             html += ' <span class="button remove" onclick="$(this).parent().remove()"><i class="fas fa-times"></i></span>';
     198            html += ' <span class="button remove" onclick="jQuery(this).parent().remove()"><i class="fas fa-times"></i></span>';
    182199            html += '</div>';
    183200
    184201
    185             $(this).parent().children('.field-list').append(html);
    186 
    187 
    188 
    189         })
    190 
    191 
    192 
    193         $(document).on("click", ".settings-tabs .field-repeatable-wrapper .collapsible .header .title-text", function () {
    194             if ($(this).parent().parent().hasClass("active")) {
    195                 $(this).parent().parent().removeClass("active");
     202            jQuery(this).parent().children('.field-list').append(html);
     203
     204
     205
     206        })
     207
     208
     209        jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .collapsible .header .title-text", function () {
     210            if (jQuery(this).parent().parent().hasClass("active")) {
     211                jQuery(this).parent().parent().removeClass("active");
    196212            } else {
    197                 $(this).parent().parent().addClass("active");
     213                jQuery(this).parent().parent().addClass("active");
    198214                textarea_to_editor();
    199215            }
    200216        })
    201217
    202         $(document).on("click", ".settings-tabs .field-repeatable-wrapper .add-repeat-field", function () {
    203             now = $.now();
    204             add_html = $(this).attr('add_html');
    205 
    206             repeatable_html = add_html.replace(/TIMEINDEX/g, now);
    207 
    208             $(this).parent().children('.repeatable-field-list').append(repeatable_html);
    209 
    210             textarea_to_editor();
    211 
    212 
    213         })
     218        // jQuery(document).on("click", ".settings-tabs .field-repeatable-wrapper .add-repeat-field", function () {
     219        //     now = jQuery.now();
     220        //     add_html = $(this).attr('add_html');
     221
     222        //     //console.log($(this));
     223
     224        //     repeatable_html = add_html.replace(/TIMEINDEX/g, now);
     225
     226        //     $(this).parent().children('.repeatable-field-list').append(repeatable_html);
     227
     228        //     textarea_to_editor();
     229
     230
     231        // })
     232
     233
     234        document.querySelectorAll(".add-repeat-field").forEach(item => {
     235            item.addEventListener("click", function (e) {
     236                const timestamp = Date.now();
     237
     238                const wrapperid = e.target.getAttribute("data-wrapper-id");
     239                const add_html = e.target.getAttribute("data-add_html");
     240                repeatable_html = add_html.replace(/TIMEINDEX/g, timestamp);
     241
     242                console.log(wrapperid);
     243                console.log(repeatable_html);
     244
     245                e.target.parentElement.querySelector('.repeatable-field-list').insertAdjacentHTML('beforeend', repeatable_html);
     246                textarea_to_editor();
     247            });
     248        });
     249
     250
     251
     252
     253
     254
     255
    214256
    215257
     
    228270
    229271
    230                 //console.log(typeof wp.editor);
     272
    231273
    232274                if (el_attr == 'no' && typeof wp.editor != 'undefined') {
     
    237279                            toolbar1: 'bold italic underline strikethrough | bullist numlist | blockquote hr wp_more | alignleft aligncenter alignright | link unlink | fullscreen |  wp_adv',
    238280                            toolbar2: 'formatselect alignjustify forecolor | pastetext removeformat charmap table | outdent indent | undo redo | wp_help',
     281
    239282                        },
    240283                        quicktags: true,
     
    257300
    258301
    259             //console.log(typeof wp.editor);
     302
    260303
    261304            if (editor_enabled == 'no' && typeof wp.editor != 'undefined') {
     
    275318        })
    276319
    277 
    278 
    279 
    280         $(document).on("click", ".settings-tabs .select-reset", function () {
     320        jQuery(document).on("click", ".settings-tabs .select-reset", function () {
    281321
    282322            $(this).prev('select').val('');
     
    301341        })
    302342
    303 
    304 
    305 
     343        // radio-img
     344
     345        $(document).on("click", ".radio-img label", function () {
     346            if ($(this).hasClass('disabled')) {
     347                return;
     348            }
     349
     350            $(this).parent().children("label").removeClass("active");
     351            $(this).addClass("active");
     352
     353        })
     354
     355        $(function () {
     356            //$('.lazy').Lazy();
     357        });
    306358
    307359
    308360
    309361    });
    310 
    311362})(jQuery);
  • related-post/trunk/includes/class-data-upgrade.php

    r3402168 r3415975  
    3232            <div class="update-nag">
    3333                <?php
    34                 /* translators: plugin name */
     34
    3535                echo sprintf(
    3636                    wp_kses_post(
     37                        /* translators: plugin name */
    3738                        __('Data update required for <b>%1$s &raquo; <a href="%2$s">Update</a></b>', 'related-post')
    3839                    ),
     
    6667    {
    6768
    68         $nonce = isset($_GET['_wpnonce']) ? sanitize_text_field($_GET['_wpnonce']) : '';
     69        $nonce = isset($_GET['_wpnonce']) ? sanitize_text_field(wp_unslash($_GET['_wpnonce'])) : '';
    6970        $related_post_info = get_option('related_post_info');
    7071        ?>
    7172        <div class="wrap">
    7273            <h2><?php
    73                 /* translators: plugin name */
     74
    7475                echo esc_html(
    7576                    sprintf(
     77                        /* translators: plugin name */
    7678                        __('%s Data Upgrade', 'related-post'),
    7779                        esc_html(related_post_plugin_name)
  • related-post/trunk/includes/class-settings-tabs.php

    r3402168 r3415975  
    11<?php
    2 if (! defined('ABSPATH')) exit;  // if direct access
    3 
    4 if (! class_exists('pickp_settings_tabs_field')) {
    5     class pickp_settings_tabs_field
    6     {
    7 
    8         //public $asset_dir_url = '';
    9         public $textdomain = 'settings-tabs';
    10 
    11         public function __construct()
    12         {
    13 
    14             //        $this->asset_dir_url = isset($args['asset_dir_url']) ? $args['asset_dir_url'] : '';
    15             //        $this->textdomain = isset($args['textdomain']) ? $args['textdomain'] : '';
    16 
    17 
    18 
    19         }
    20 
    21 
    22         function admin_scripts()
    23         {
    24 
    25 
    26             wp_enqueue_script('jquery');
    27             wp_enqueue_script('jquery-ui-sortable');
    28             wp_enqueue_script('jquery-ui-core');
    29             wp_enqueue_script('jquery-ui-accordion');
    30             wp_enqueue_style('jquery-ui');
    31             wp_enqueue_script('jquery-ui-tabs');
    32 
    33 
    34             wp_enqueue_script('wp-color-picker');
    35             wp_enqueue_style('wp-color-picker');
    36 
    37 
    38             wp_enqueue_style('font-awesome-5');
    39 
    40             wp_enqueue_style('settings-tabs');
    41             wp_enqueue_script('settings-tabs');
    42 
    43             wp_enqueue_script('code-editor');
    44             wp_enqueue_style('code-editor');
    45 
    46             wp_enqueue_script('jquery.lazy');
    47 
    48             if (function_exists('wp_enqueue_editor')) {
    49                 wp_enqueue_editor();
    50             }
    51         }
    52 
    53         function field_template($option)
    54         {
    55 
    56             $id             = isset($option['id']) ? $option['id'] : "";
    57             $wraper_class            = isset($option['wraper_class']) ? $option['wraper_class'] : "";
    58             $conditions     = isset($option['conditions']) ? $option['conditions'] : array();
    59 
    60             $is_error             = isset($option['is_error']) ? $option['is_error'] : false;
    61             $error_details             = isset($option['error_details']) ? $option['error_details'] : '';
    62 
    63 
    64 
    65             if (!empty($conditions)):
    66 
    67                 $depends = '';
    68 
    69                 $field = isset($conditions['field']) ? $conditions['field'] : '';
    70                 $cond_value = isset($conditions['value']) ? $conditions['value'] : '';
    71                 $type = isset($conditions['type']) ? $conditions['type'] : '';
    72                 $pattern = isset($conditions['pattern']) ? $conditions['pattern'] : '';
    73                 $modifier = isset($conditions['modifier']) ? $conditions['modifier'] : '';
    74                 $like = isset($conditions['like']) ? $conditions['like'] : '';
    75                 $strict = isset($conditions['strict']) ? $conditions['strict'] : '';
    76                 $empty = isset($conditions['empty']) ? $conditions['empty'] : '';
    77                 $sign = isset($conditions['sign']) ? $conditions['sign'] : '';
    78                 $min = isset($conditions['min']) ? $conditions['min'] : '';
    79                 $max = isset($conditions['max']) ? $conditions['max'] : '';
    80 
    81                 $depends .= "{'[name=$field]':";
    82                 $depends .= '{';
    83 
    84                 if (!empty($type)):
    85                     $depends .= "'type':";
    86                     $depends .= "'" . $type . "'";
     2if (!defined('ABSPATH')) exit;  // if direct access
     3if (!class_exists('settings_tabs_field')) {
     4  class settings_tabs_field
     5  {
     6
     7    public function allowed()
     8    {
     9
     10      return  wp_kses_allowed_html('post');
     11    }
     12    public $custom = array(
     13      'select' => array(
     14        'name'     => true,
     15        'id'       => true,
     16        'class'    => true,
     17        'multiple' => true,
     18      ),
     19      'option' => array(
     20        'value'    => true,
     21        'selected' => true,
     22      ),
     23      'optgroup' => array(
     24        'label' => true,
     25      ),
     26      'input' => array(
     27        'type'  => true,
     28        'name'  => true,
     29        'value' => true,
     30        'class' => true,
     31        'id'    => true,
     32        'checked' => true,
     33        'placeholder' => true,
     34      ),
     35      'label' => array(
     36        'for'   => true,
     37        'class' => true,
     38      ),
     39    );
     40
     41    public function allowed_html()
     42    {
     43
     44      return  array_merge($this->allowed(), $this->custom);
     45    }
     46
     47
     48    //public $asset_dir_url = '';
     49    public function __construct() {}
     50
     51
     52
     53
     54
     55
     56
     57
     58
     59    function admin_scripts()
     60    {
     61      wp_enqueue_script('jquery');
     62      wp_enqueue_script('jquery-ui-sortable');
     63      wp_enqueue_script('jquery-ui-core');
     64      wp_enqueue_script('jquery-ui-accordion');
     65      wp_enqueue_style('jquery-ui');
     66      wp_enqueue_script('wp-color-picker');
     67      wp_enqueue_style('wp-color-picker');
     68      wp_enqueue_style('select2');
     69      wp_enqueue_script('select2');
     70      wp_enqueue_style('font-awesome-5');
     71      wp_enqueue_style('settings-tabs');
     72      wp_enqueue_script('settings-tabs');
     73      wp_enqueue_script('code-editor');
     74      wp_enqueue_style('code-editor');
     75      wp_enqueue_script('jquery.lazy');
     76      wp_enqueue_script('jquery-ui-datepicker');
     77
     78      if (function_exists('wp_enqueue_editor')) {
     79        wp_enqueue_editor();
     80      }
     81    }
     82    function field_template($option)
     83    {
     84      $id             = isset($option['id']) ? $option['id'] : "";
     85      $wraper_class            = isset($option['wraper_class']) ? $option['wraper_class'] : "";
     86      $conditions     = isset($option['conditions']) ? $option['conditions'] : array();
     87      $is_error             = isset($option['is_error']) ? $option['is_error'] : false;
     88      $error_details             = isset($option['error_details']) ? $option['error_details'] : '';
     89      if (!empty($conditions)) :
     90        $depends = '';
     91        $field = isset($conditions['field']) ? $conditions['field'] : '';
     92        $cond_value = isset($conditions['value']) ? $conditions['value'] : '';
     93        $type = isset($conditions['type']) ? $conditions['type'] : '';
     94        $pattern = isset($conditions['pattern']) ? $conditions['pattern'] : '';
     95        $modifier = isset($conditions['modifier']) ? $conditions['modifier'] : '';
     96        $like = isset($conditions['like']) ? $conditions['like'] : '';
     97        $strict = isset($conditions['strict']) ? $conditions['strict'] : '';
     98        $empty = isset($conditions['empty']) ? $conditions['empty'] : '';
     99        $sign = isset($conditions['sign']) ? $conditions['sign'] : '';
     100        $min = isset($conditions['min']) ? $conditions['min'] : '';
     101        $max = isset($conditions['max']) ? $conditions['max'] : '';
     102        $depends .= "{'[name=$field]':";
     103        $depends .= '{';
     104        if (!empty($type)) :
     105          $depends .= "'type':";
     106          $depends .= "'" . $type . "'";
     107        endif;
     108        if (!empty($modifier)) :
     109          $depends .= ",'modifier':";
     110          $depends .= "'" . $modifier . "'";
     111        endif;
     112        if (!empty($like)) :
     113          $depends .= ",'like':";
     114          $depends .= "'" . $like . "'";
     115        endif;
     116        if (!empty($strict)) :
     117          $depends .= ",'strict':";
     118          $depends .= "'" . $strict . "'";
     119        endif;
     120        if (!empty($empty)) :
     121          $depends .= ",'empty':";
     122          $depends .= "'" . $empty . "'";
     123        endif;
     124        if (!empty($sign)) :
     125          $depends .= ",'sign':";
     126          $depends .= "'" . $sign . "'";
     127        endif;
     128        if (!empty($min)) :
     129          $depends .= ",'min':";
     130          $depends .= "'" . $min . "'";
     131        endif;
     132        if (!empty($max)) :
     133          $depends .= ",'max':";
     134          $depends .= "'" . $max . "'";
     135        endif;
     136        if (!empty($cond_value)) :
     137          $depends .= ",'value':";
     138          if (is_array($cond_value)) :
     139            $count = count($cond_value);
     140            $i = 1;
     141            $depends .= "[";
     142            foreach ($cond_value as $val) :
     143              $depends .= "'" . $val . "'";
     144              if ($i < $count)
     145                $depends .= ",";
     146              $i++;
     147            endforeach;
     148            $depends .= "]";
     149          else :
     150            $depends .= "[";
     151            $depends .= "'" . $cond_value . "'";
     152            $depends .= "]";
     153          endif;
     154        endif;
     155        $depends .= '}}';
     156      endif;
     157      ob_start();
     158?>
     159      <div <?php if (!empty($depends)) { ?> data-depends="[<?php echo esc_attr($depends); ?>]" <?php } ?> class="setting-field <?php if ($is_error) echo 'field-error';  ?> <?php echo esc_attr($wraper_class); ?> <?php if (!empty($depends)) echo 'dependency-field'; ?>">
     160        <div class="field-lable ">%s</div>
     161        <div class="field-input">%s
     162          <p class="description">%s</p>
     163          <?php if ($is_error && !empty($error_details)) : ?>
     164            <p class="error-details"><i class="fas fa-exclamation-circle"></i> <?php echo esc_html($error_details); ?></p>
     165          <?php endif; ?>
     166        </div>
     167      </div>
     168    <?php
     169      return ob_get_clean();
     170    }
     171    function generate_field($option)
     172    {
     173      $id         = isset($option['id']) ? $option['id'] : "";
     174      $type         = isset($option['type']) ? $option['type'] : "";
     175      $details     = isset($option['details']) ? $option['details'] : "";
     176      if (empty($id)) return;
     177      if (isset($option['type']) && $option['type'] === 'select')                 $this->field_select($option);
     178      elseif (isset($option['type']) && $option['type'] === 'select2')            $this->field_select2($option);
     179      elseif (isset($option['type']) && $option['type'] === 'checkbox')            $this->field_checkbox($option);
     180      elseif (isset($option['type']) && $option['type'] === 'radio')                $this->field_radio($option);
     181      elseif (isset($option['type']) && $option['type'] === 'radio_image')        $this->field_radio_image($option);
     182      elseif (isset($option['type']) && $option['type'] === 'textarea')            $this->field_textarea($option);
     183      elseif (isset($option['type']) && $option['type'] === 'scripts_js')            $this->field_scripts_js($option);
     184      elseif (isset($option['type']) && $option['type'] === 'scripts_css')        $this->field_scripts_css($option);
     185      elseif (isset($option['type']) && $option['type'] === 'number')             $this->field_number($option);
     186      elseif (isset($option['type']) && $option['type'] === 'text')                 $this->field_text($option);
     187      elseif (isset($option['type']) && $option['type'] === 'text_icon')         $this->field_text_icon($option);
     188      elseif (isset($option['type']) && $option['type'] === 'text_multi')         $this->field_text_multi($option);
     189      elseif (isset($option['type']) && $option['type'] === 'hidden')             $this->field_hidden($option);
     190      elseif (isset($option['type']) && $option['type'] === 'range')             $this->field_range($option);
     191      elseif (isset($option['type']) && $option['type'] === 'colorpicker')        $this->field_colorpicker($option);
     192      elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi')  $this->field_colorpicker_multi($option);
     193      elseif (isset($option['type']) && $option['type'] === 'datepicker')            $this->field_datepicker($option);
     194      elseif (isset($option['type']) && $option['type'] === 'faq')                $this->field_faq($option);
     195      elseif (isset($option['type']) && $option['type'] === 'addons_grid')        $this->field_addons_grid($option);
     196      elseif (isset($option['type']) && $option['type'] === 'custom_html')        $this->field_custom_html($option);
     197      elseif (isset($option['type']) && $option['type'] === 'repeatable')            $this->field_repeatable($option);
     198      elseif (isset($option['type']) && $option['type'] === 'media')                $this->field_media($option);
     199      elseif (isset($option['type']) && $option['type'] === 'media_url')            $this->field_media_url($option);
     200      elseif (isset($option['type']) && $option['type'] === 'option_group')        $this->field_option_group($option);
     201      elseif (isset($option['type']) && $option['type'] === 'option_group_accordion')        $this->field_option_group_accordion($option);
     202      elseif (isset($option['type']) && $option['type'] === 'wp_editor')        $this->field_wp_editor($option);
     203      elseif (isset($option['type']) && $option['type'] === 'textarea_editor')        $this->field_textarea_editor($option);
     204      elseif (isset($option['type']) && $option['type'] === $type)     do_action("settings_tabs_field_$type", $option);
     205    }
     206    public function field_option_group_accordion($option)
     207    {
     208      $id             = isset($option['id']) ? $option['id'] : "";
     209      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     210      $sortable             = isset($option['sortable']) ? $option['sortable'] : false;
     211      $args_index     = isset($option['args_index']) ? $option['args_index'] : array();
     212      $args_index_default     = isset($option['args_index_default']) ? $option['args_index_default'] : array();
     213      $args_index_hide     = isset($option['args_index_hide']) ? $option['args_index_hide'] : array();
     214      $args_index = !empty($args_index) ? $args_index : $args_index_default;
     215      $args     = isset($option['args']) ? $option['args'] : array();
     216      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     217      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     218      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     219      $title            = isset($option['title']) ? $option['title'] : "";
     220      $group_details             = isset($option['details']) ? $option['details'] : "";
     221      if ($is_pro == true) {
     222        $group_details = '<span class="pro-feature">' . $pro_text . '</span> ' . $group_details;
     223      }
     224      ob_start();
     225    ?>
     226      <div class="option-group-accordion-wrap" id="<?php echo esc_attr($css_id); ?>">
     227        <div sortable="<?php echo esc_attr($sortable) ? 'true' :  'false'; ?>" class='option-group-accordion accordion'>
     228          <?php
     229          if (!empty($args_index))
     230            foreach ($args_index as $index) :
     231              //foreach( $args as $key => $value ):
     232              $group_title = isset($args[$index]['title']) ? $args[$index]['title'] : '';
     233              $is_hide = isset($args_index_hide[$index]) ? $args_index_hide[$index] : false;
     234              //$link = $value['link'];
     235              $options = isset($args[$index]['options']) ? $args[$index]['options'] : array();
     236          ?>
     237            <div class="group">
     238              <h3 class="accordion-title">
     239                <?php if ($sortable) : ?>
     240                  <span class="sort"><i class="fas fa-sort"></i></span>
     241                <?php endif; ?>
     242                <span class="title-text"><?php echo esc_html($group_title); ?></span>
     243              </h3>
     244              <div class="accordion-content">
     245                <?php
     246                if (!empty($options)) :
     247                  foreach ($options as $option) :
     248                    $id         = isset($option['id']) ? $option['id'] : "";
     249                    $type         = isset($option['type']) ? $option['type'] : "";
     250                    $details     = isset($option['details']) ? $option['details'] : "";
     251                    if (isset($option['type']) && $option['type'] === 'select')                 $this->field_select($option);
     252                    elseif (isset($option['type']) && $option['type'] === 'select2')            $this->field_select2($option);
     253                    elseif (isset($option['type']) && $option['type'] === 'checkbox')            $this->field_checkbox($option);
     254                    elseif (isset($option['type']) && $option['type'] === 'radio')                $this->field_radio($option);
     255                    elseif (isset($option['type']) && $option['type'] === 'radio_image')        $this->field_radio_image($option);
     256                    elseif (isset($option['type']) && $option['type'] === 'textarea')            $this->field_textarea($option);
     257                    elseif (isset($option['type']) && $option['type'] === 'scripts_js')            $this->field_scripts_js($option);
     258                    elseif (isset($option['type']) && $option['type'] === 'scripts_css')        $this->field_scripts_css($option);
     259                    elseif (isset($option['type']) && $option['type'] === 'number')             $this->field_number($option);
     260                    elseif (isset($option['type']) && $option['type'] === 'text')                 $this->field_text($option);
     261                    elseif (isset($option['type']) && $option['type'] === 'text_icon')         $this->field_text_icon($option);
     262                    elseif (isset($option['type']) && $option['type'] === 'text_multi')         $this->field_text_multi($option);
     263                    elseif (isset($option['type']) && $option['type'] === 'hidden')                 $this->field_hidden($option);
     264                    elseif (isset($option['type']) && $option['type'] === 'range')             $this->field_range($option);
     265                    elseif (isset($option['type']) && $option['type'] === 'colorpicker')        $this->field_colorpicker($option);
     266                    elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi')  $this->field_colorpicker_multi($option);
     267                    elseif (isset($option['type']) && $option['type'] === 'datepicker')            $this->field_datepicker($option);
     268                    elseif (isset($option['type']) && $option['type'] === 'faq')                $this->field_faq($option);
     269                    elseif (isset($option['type']) && $option['type'] === 'addons_grid')        $this->field_addons_grid($option);
     270                    elseif (isset($option['type']) && $option['type'] === 'custom_html')        $this->field_custom_html($option);
     271                    elseif (isset($option['type']) && $option['type'] === 'repeatable')            $this->field_repeatable($option);
     272                    elseif (isset($option['type']) && $option['type'] === 'media')                $this->field_media($option);
     273                    elseif (isset($option['type']) && $option['type'] === 'media_url')            $this->field_media_url($option);
     274                  endforeach;
    87275                endif;
    88 
    89                 if (!empty($modifier)):
    90                     $depends .= ",'modifier':";
    91                     $depends .= "'" . $modifier . "'";
    92                 endif;
    93 
    94                 if (!empty($like)):
    95                     $depends .= ",'like':";
    96                     $depends .= "'" . $like . "'";
    97                 endif;
    98 
    99                 if (!empty($strict)):
    100                     $depends .= ",'strict':";
    101                     $depends .= "'" . $strict . "'";
    102                 endif;
    103 
    104                 if (!empty($empty)):
    105                     $depends .= ",'empty':";
    106                     $depends .= "'" . $empty . "'";
    107                 endif;
    108 
    109                 if (!empty($sign)):
    110                     $depends .= ",'sign':";
    111                     $depends .= "'" . $sign . "'";
    112                 endif;
    113 
    114                 if (!empty($min)):
    115                     $depends .= ",'min':";
    116                     $depends .= "'" . $min . "'";
    117                 endif;
    118 
    119                 if (!empty($max)):
    120                     $depends .= ",'max':";
    121                     $depends .= "'" . $max . "'";
    122                 endif;
    123                 if (!empty($cond_value)):
    124                     $depends .= ",'value':";
    125                     if (is_array($cond_value)):
    126                         $count = count($cond_value);
    127                         $i = 1;
    128                         $depends .= "[";
    129                         foreach ($cond_value as $val):
    130                             $depends .= "'" . $val . "'";
    131                             if ($i < $count)
    132                                 $depends .= ",";
    133                             $i++;
    134                         endforeach;
    135                         $depends .= "]";
    136                     else:
    137                         $depends .= "[";
    138                         $depends .= "'" . $cond_value . "'";
    139                         $depends .= "]";
    140                     endif;
    141                 endif;
    142                 $depends .= '}}';
    143 
    144             endif;
    145 
    146 
    147 
    148             ob_start();
    149 
    150 ?>
    151             <div <?php if (!empty($depends)) { ?> data-depends="[<?php echo $depends; ?>]" <?php } ?> class="setting-field <?php if ($is_error) echo 'field-error';  ?> <?php echo $wraper_class; ?> <?php if (!empty($depends)) echo 'dependency-field'; ?>">
    152                 <div class="field-lable">%s</div>
    153                 <div class="field-input">%s
    154                     <p class="description">%s</p>
    155                     <?php if ($is_error && !empty($error_details)): ?>
    156                         <p class="error-details"><i class="fas fa-exclamation-circle"></i> <?php echo $error_details; ?></p>
    157                     <?php endif; ?>
    158 
    159                 </div>
    160             </div>
     276                ?>
     277              </div> <!-- ..accordion-content -->
     278            </div><!-- .group -->
     279          <?php
     280            //endforeach;
     281            endforeach;
     282          ?>
     283        </div> <!-- .option-group-accordion -->
     284      </div><!-- .option-group-accordion-wrap -->
     285    <?php
     286      $input_html = ob_get_clean();
     287      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($group_details)));
     288    }
     289    public function field_option_group($option)
     290    {
     291      $id             = isset($option['id']) ? $option['id'] : "";
     292      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     293      $options     = isset($option['options']) ? $option['options'] : array();
     294      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     295      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     296      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     297      $title            = isset($option['title']) ? $option['title'] : "";
     298      $group_details             = isset($option['details']) ? $option['details'] : "";
     299      if ($is_pro == true) {
     300        $group_details = '<span class="pro-feature">' . $pro_text . '</span> ' . $group_details;
     301      }
     302      ob_start();
     303    ?>
     304      <div id="<?php echo esc_attr($css_id); ?>">
    161305        <?php
    162 
    163             return ob_get_clean();
    164         }
    165 
    166 
    167 
    168 
    169 
    170 
    171         function generate_field($option)
    172         {
    173 
     306        if (!empty($options)) :
     307          foreach ($options as $option) :
    174308            $id         = isset($option['id']) ? $option['id'] : "";
    175309            $type         = isset($option['type']) ? $option['type'] : "";
    176310            $details     = isset($option['details']) ? $option['details'] : "";
    177 
    178 
    179 
    180 
    181 
    182 
    183             if (empty($id)) return;
    184 
    185311            if (isset($option['type']) && $option['type'] === 'select')                 $this->field_select($option);
    186312            elseif (isset($option['type']) && $option['type'] === 'select2')            $this->field_select2($option);
     
    196322            elseif (isset($option['type']) && $option['type'] === 'text_multi')         $this->field_text_multi($option);
    197323            elseif (isset($option['type']) && $option['type'] === 'hidden')             $this->field_hidden($option);
    198 
    199324            elseif (isset($option['type']) && $option['type'] === 'range')             $this->field_range($option);
    200325            elseif (isset($option['type']) && $option['type'] === 'colorpicker')        $this->field_colorpicker($option);
    201326            elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi')  $this->field_colorpicker_multi($option);
    202 
    203327            elseif (isset($option['type']) && $option['type'] === 'datepicker')            $this->field_datepicker($option);
    204328            elseif (isset($option['type']) && $option['type'] === 'faq')                $this->field_faq($option);
     
    208332            elseif (isset($option['type']) && $option['type'] === 'media')                $this->field_media($option);
    209333            elseif (isset($option['type']) && $option['type'] === 'media_url')            $this->field_media_url($option);
    210 
    211             elseif (isset($option['type']) && $option['type'] === 'option_group')        $this->field_option_group($option);
    212             elseif (isset($option['type']) && $option['type'] === 'option_group_accordion')        $this->field_option_group_accordion($option);
    213             elseif (isset($option['type']) && $option['type'] === 'wp_editor')        $this->field_wp_editor($option);
    214             elseif (isset($option['type']) && $option['type'] === 'textarea_editor')        $this->field_textarea_editor($option);
    215 
    216 
    217 
    218             elseif (isset($option['type']) && $option['type'] === $type)     do_action("pickp_settings_tabs_field_$type", $option);
    219 
    220 
    221             //if( !empty( $details ) ) echo "<p class='description'>$details</p>";
    222 
    223 
    224 
    225 
    226 
    227         }
    228 
    229 
    230         public function field_option_group_accordion($option)
    231         {
    232 
    233             $id             = isset($option['id']) ? $option['id'] : "";
    234             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    235             $sortable             = isset($option['sortable']) ? $option['sortable'] : false;
    236 
    237             $args_index     = isset($option['args_index']) ? $option['args_index'] : array();
    238             $args_index_default     = isset($option['args_index_default']) ? $option['args_index_default'] : array();
    239             $args_index_hide     = isset($option['args_index_hide']) ? $option['args_index_hide'] : array();
    240 
    241             $args_index = !empty($args_index) ? $args_index : $args_index_default;
    242 
    243             $args     = isset($option['args']) ? $option['args'] : array();
    244 
    245             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    246 
    247             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    248             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    249 
    250 
    251             $title            = isset($option['title']) ? $option['title'] : "";
    252             $group_details             = isset($option['details']) ? $option['details'] : "";
    253 
    254             if ($is_pro == true) {
    255                 $group_details = '<span class="pro-feature">' . $pro_text . '</span> ' . $group_details;
    256             }
    257 
    258 
    259             ob_start();
     334          endforeach;
     335        endif;
    260336        ?>
    261             <div class="option-group-accordion-wrap" id="<?php echo $css_id; ?>">
    262                 <div sortable="<?php echo ($sortable) ? 'true' :  'false'; ?>" class='option-group-accordion accordion'>
    263                     <?php
    264 
    265                     if (!empty($args_index))
    266                         foreach ($args_index as $index):
    267 
    268                             //foreach( $args as $key => $value ):
    269 
    270                             $group_title = isset($args[$index]['title']) ? $args[$index]['title'] : '';
    271                             $is_hide = isset($args_index_hide[$index]) ? $args_index_hide[$index] : false;
    272 
    273 
    274                             //$link = $value['link'];
    275                             $options = isset($args[$index]['options']) ? $args[$index]['options'] : array();
    276 
    277                     ?>
    278                         <div class="group">
    279                             <h3 class="accordion-title">
    280 
    281 
    282                                 <?php if ($sortable): ?>
    283                                     <span class="sort"><i class="fas fa-sort"></i></span>
    284                                 <?php endif; ?>
    285 
    286                                 <span class="title-text"><?php echo $group_title; ?></span>
    287                             </h3>
    288                             <div class="accordion-content">
    289 
    290                                 <?php
    291 
    292                                 if (!empty($options)):
    293                                     foreach ($options as $option):
    294 
    295                                         $id         = isset($option['id']) ? $option['id'] : "";
    296                                         $type         = isset($option['type']) ? $option['type'] : "";
    297                                         $details     = isset($option['details']) ? $option['details'] : "";
    298 
    299                                         if (isset($option['type']) && $option['type'] === 'select')                 $this->field_select($option);
    300                                         elseif (isset($option['type']) && $option['type'] === 'select2')            $this->field_select2($option);
    301                                         elseif (isset($option['type']) && $option['type'] === 'checkbox')            $this->field_checkbox($option);
    302                                         elseif (isset($option['type']) && $option['type'] === 'radio')                $this->field_radio($option);
    303                                         elseif (isset($option['type']) && $option['type'] === 'radio_image')        $this->field_radio_image($option);
    304                                         elseif (isset($option['type']) && $option['type'] === 'textarea')            $this->field_textarea($option);
    305                                         elseif (isset($option['type']) && $option['type'] === 'scripts_js')            $this->field_scripts_js($option);
    306                                         elseif (isset($option['type']) && $option['type'] === 'scripts_css')        $this->field_scripts_css($option);
    307                                         elseif (isset($option['type']) && $option['type'] === 'number')             $this->field_number($option);
    308                                         elseif (isset($option['type']) && $option['type'] === 'text')                 $this->field_text($option);
    309                                         elseif (isset($option['type']) && $option['type'] === 'text_icon')         $this->field_text_icon($option);
    310                                         elseif (isset($option['type']) && $option['type'] === 'text_multi')         $this->field_text_multi($option);
    311                                         elseif (isset($option['type']) && $option['type'] === 'hidden')                 $this->field_hidden($option);
    312 
    313                                         elseif (isset($option['type']) && $option['type'] === 'range')             $this->field_range($option);
    314                                         elseif (isset($option['type']) && $option['type'] === 'colorpicker')        $this->field_colorpicker($option);
    315                                         elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi')  $this->field_colorpicker_multi($option);
    316 
    317                                         elseif (isset($option['type']) && $option['type'] === 'datepicker')            $this->field_datepicker($option);
    318                                         elseif (isset($option['type']) && $option['type'] === 'faq')                $this->field_faq($option);
    319                                         elseif (isset($option['type']) && $option['type'] === 'addons_grid')        $this->field_addons_grid($option);
    320                                         elseif (isset($option['type']) && $option['type'] === 'custom_html')        $this->field_custom_html($option);
    321                                         elseif (isset($option['type']) && $option['type'] === 'repeatable')            $this->field_repeatable($option);
    322                                         elseif (isset($option['type']) && $option['type'] === 'media')                $this->field_media($option);
    323                                         elseif (isset($option['type']) && $option['type'] === 'media_url')            $this->field_media_url($option);
    324 
    325                                     endforeach;
    326                                 endif;
    327                                 ?>
    328                             </div> <!-- ..accordion-content -->
    329                         </div><!-- .group -->
    330 
    331 
    332                     <?php
    333                         //endforeach;
    334 
    335                         endforeach;
    336 
    337 
    338                     ?>
    339                 </div> <!-- .option-group-accordion -->
    340             </div><!-- .option-group-accordion-wrap -->
    341 
     337      </div>
     338    <?php
     339      $input_html = ob_get_clean();
     340      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($group_details)), $this->allowed_html());
     341    }
     342    public function field_media($option)
     343    {
     344      $id            = isset($option['id']) ? $option['id'] : "";
     345      if (empty($id)) return;
     346      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     347      $field_name     = isset($option['field_name']) ? $option['field_name'] : $id;
     348      $parent             = isset($option['parent']) ? $option['parent'] : "";
     349      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     350      $title            = isset($option['title']) ? $option['title'] : "";
     351      $placeholder    = isset($option['placeholder']) ? $option['placeholder'] : "";
     352      $details             = isset($option['details']) ? $option['details'] : "";
     353      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     354      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     355      $default            = isset($option['default']) ? $option['default'] : '';
     356      $value            = isset($option['value']) ? $option['value'] : '';
     357      $value          = !empty($value) ?  $value : $default;
     358      $media_url    = wp_get_attachment_url($value);
     359      $media_type    = get_post_mime_type($value);
     360      $media_title = !empty($value) ? get_the_title($value) : "Placeholder";
     361      $media_url = !empty($media_url) ? $media_url : $default;
     362      $media_url = !empty($media_url) ? $media_url : $placeholder;
     363      $media_basename = wp_basename($media_type);
     364      $field_name     = !empty($field_name) ? $field_name : $id;
     365      $field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
     366      ob_start();
     367      //wp_enqueue_media();
     368    ?>
     369      <div id="input-wrapper-<?php echo esc_attr($css_id); ?>" class="input-wrapper field-media-wrapper
     370            field-media-wrapper-<?php echo esc_attr($css_id); ?>">
     371        <div class="media-preview-wrap" style="width: 150px;margin-bottom: 10px;background: #eee;padding: 5px;    text-align: center;word-break: break-all;">
     372          <?php
     373          if ("audio/mpeg" == $media_type) {
     374          ?>
     375            <div class="media-preview" class="dashicons dashicons-format-audio" style="font-size: 70px;display: inline;"></div>
     376            <div class="media-title"><?php echo esc_html($media_title); ?></div>
     377          <?php
     378          } elseif (
     379            "images/png" == $media_type ||
     380            "image/png" == $media_type ||
     381            "images/gif" == $media_type  ||
     382            "image/gif" == $media_type  ||
     383            "images/jpeg" == $media_type ||
     384            "image/jpeg" == $media_type ||
     385            "images/jpg" == $media_type ||
     386            "image/jpg" == $media_type ||
     387            "images/ico" == $media_type ||
     388            "image/ico" == $media_type
     389          ) {
     390          ?>
     391            <img class="media-preview" src="<?php echo esc_url($media_url); ?>" style="width:100%" />
     392            <div class="media-title"><?php echo esc_html($media_title); ?></div>
     393          <?php
     394          } else {
     395          ?>
     396            <img class="media-preview" src="<?php echo esc_url($media_url); ?>" style="width:100%" />
     397            <div class="media-title"><?php echo esc_html($media_title); ?></div>
     398          <?php
     399          }
     400          ?>
     401        </div>
     402        <input class="media-input-value" type="hidden" name="<?php echo esc_attr($field_name); ?>" id="media_input_<?php echo esc_attr($css_id); ?>" value="<?php echo esc_attr($value); ?>" />
     403        <div class="media-upload button" id="media_upload_<?php echo esc_attr($css_id); ?>">
     404          <?php echo "Upload"; ?></div>
     405        <div placeholder="<?php echo esc_attr($placeholder); ?>" class="clear button" id="media_clear_<?php echo esc_attr($css_id); ?>"><?php echo 'Clear'; ?></div>
     406        <div class="error-mgs"></div>
     407      </div>
     408    <?php
     409      $input_html = ob_get_clean();
     410      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     411    }
     412    public function field_media_url($option)
     413    {
     414      $id            = isset($option['id']) ? $option['id'] : "";
     415      if (empty($id)) return;
     416      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     417      $field_name     = isset($option['field_name']) ? $option['field_name'] : $id;
     418      $parent             = isset($option['parent']) ? $option['parent'] : "";
     419      $placeholder    = isset($option['placeholder']) ? $option['placeholder'] : "";
     420      $placeholder_img    = isset($option['placeholder_img']) ? $option['placeholder_img'] : "";
     421      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     422      $title            = isset($option['title']) ? $option['title'] : "";
     423      $details             = isset($option['details']) ? $option['details'] : "";
     424      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     425      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     426      $default            = isset($option['default']) ? $option['default'] : '';
     427      $value            = isset($option['value']) ? $option['value'] : '';
     428      $value          = !empty($value) ?  $value : $default;
     429      $media_url    = $value;
     430      $media_type    = get_post_mime_type($value);
     431      $media_title = get_the_title($value);
     432      $media_url = !empty($media_url) ? $media_url : '';
     433      $media_url = !empty($media_url) ? $media_url : $placeholder_img;
     434      $field_name     = !empty($field_name) ? $field_name : $id;
     435      $field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
     436      wp_enqueue_media();
     437      ob_start();
     438    ?>
     439      <div id="input-wrapper-<?php echo esc_attr($css_id); ?>" class="input-wrapper field-media-url-wrapper
     440            field-media-wrapper-<?php echo esc_attr($css_id); ?>">
     441        <div class="media-preview-wrap" style="width: 150px;margin-bottom: 10px;background: #eee;padding: 5px;    text-align: center;">
     442          <?php
     443          if ("audio/mpeg" == $media_type) {
     444          ?>
     445            <div class="media-preview" class="dashicons dashicons-format-audio" style="font-size: 70px;display: inline;"></div>
     446          <?php
     447          } elseif (
     448            "images/png" == $media_type || "images/jpg" == $media_type || "images/jpeg" == $media_type ||
     449            "images/gif" == $media_type  ||
     450            "images/ico" == $media_type
     451          ) {
     452          ?>
     453            <img class="media-preview" src="<?php echo esc_url($media_url); ?>" style="width:100%" />
     454          <?php
     455          } else {
     456          ?>
     457            <img class="media-preview" src="<?php echo esc_url($media_url); ?>" style="width:100%" />
     458          <?php
     459          }
     460          ?>
     461        </div>
     462        <input type="text" placeholder="<?php echo esc_attr($placeholder); ?>" name="<?php echo esc_attr($field_name); ?>" id="media_input_<?php echo esc_attr($css_id); ?>" value="<?php echo esc_attr($value); ?>" />
     463        <div class="media-upload button" id="media_upload_<?php echo esc_attr($css_id); ?>">
     464          <?php echo 'Upload'; ?></div>
     465        <div class="clear button" id="media_clear_<?php echo esc_attr($css_id); ?>">
     466          <?php echo 'Clear'; ?></div>
     467        <div class="error-mgs"></div>
     468      </div>
     469    <?php
     470      $input_html = ob_get_clean();
     471      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     472    }
     473    public function field_repeatable($option)
     474    {
     475      $id             = isset($option['id']) ? $option['id'] : "";
     476      if (empty($id)) return;
     477      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     478      $parent             = isset($option['parent']) ? $option['parent'] : "";
     479      $field_name     = isset($option['field_name']) ? $option['field_name'] : $id;
     480      $field_name     = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
     481      $sortable         = isset($option['sortable']) ? $option['sortable'] : true;
     482      $collapsible     = isset($option['collapsible']) ? $option['collapsible'] : true;
     483      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     484      $values            = isset($option['value']) ? $option['value'] : array();
     485      $fields         = isset($option['fields']) ? $option['fields'] : array();
     486      $title_field     = isset($option['title_field']) ? $option['title_field'] : '';
     487      $remove_text     = isset($option['remove_text']) ? $option['remove_text'] : '<i class="fas fa-times"></i>';
     488      $limit             = isset($option['limit']) ? $option['limit'] : '';
     489      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     490      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     491      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     492      $title            = isset($option['title']) ? $option['title'] : "";
     493      $details             = isset($option['details']) ? $option['details'] : "";
     494      $settings_tabs_field = new settings_tabs_field();
     495      ob_start();
     496    ?>
     497      <div class="item-wrap collapsible">
     498        <div class="header">
     499          <span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo wp_kses_post($remove_text); ?></span>
     500          <?php
     501          if ($sortable) :
     502          ?>
     503            <span class="sort"><i class="fas fa-arrows-alt"></i></span>
     504          <?php
     505          endif;
     506          ?>
     507          <span class="title-text">#TIMEINDEX</span>
     508        </div>
    342509        <?php
    343 
    344             $input_html = ob_get_clean();
    345 
    346             echo sprintf($field_template, $title, $input_html, $group_details);
    347         }
    348 
    349 
    350         public function field_option_group($option)
    351         {
    352 
    353             $id             = isset($option['id']) ? $option['id'] : "";
    354             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    355             $options     = isset($option['options']) ? $option['options'] : array();
    356             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    357 
    358             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    359             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    360 
    361 
    362             $title            = isset($option['title']) ? $option['title'] : "";
    363             $group_details             = isset($option['details']) ? $option['details'] : "";
    364 
    365             if ($is_pro == true) {
    366                 $group_details = '<span class="pro-feature">' . $pro_text . '</span> ' . $group_details;
    367             }
    368 
    369 
    370             ob_start();
     510        if (!empty($fields)) :
     511          foreach ($fields as $field) :
     512            $fieldType = isset($field['type']) ? $field['type'] : '';
     513            $field['parent'] = $field_name . '[TIMEINDEX]';
    371514        ?>
    372             <div id="<?php echo $css_id; ?>">
     515            <div class="item">
     516              <?php if ($collapsible) : ?>
     517                <div class="content">
     518                <?php endif; ?>
    373519                <?php
    374 
    375                 if (!empty($options)):
    376                     foreach ($options as $option):
    377 
    378                         $id         = isset($option['id']) ? $option['id'] : "";
    379                         $type         = isset($option['type']) ? $option['type'] : "";
    380                         $details     = isset($option['details']) ? $option['details'] : "";
    381 
    382                         if (isset($option['type']) && $option['type'] === 'select')                 $this->field_select($option);
    383                         elseif (isset($option['type']) && $option['type'] === 'select2')            $this->field_select2($option);
    384                         elseif (isset($option['type']) && $option['type'] === 'checkbox')            $this->field_checkbox($option);
    385                         elseif (isset($option['type']) && $option['type'] === 'radio')                $this->field_radio($option);
    386                         elseif (isset($option['type']) && $option['type'] === 'radio_image')        $this->field_radio_image($option);
    387                         elseif (isset($option['type']) && $option['type'] === 'textarea')            $this->field_textarea($option);
    388                         elseif (isset($option['type']) && $option['type'] === 'scripts_js')            $this->field_scripts_js($option);
    389                         elseif (isset($option['type']) && $option['type'] === 'scripts_css')        $this->field_scripts_css($option);
    390                         elseif (isset($option['type']) && $option['type'] === 'number')             $this->field_number($option);
    391                         elseif (isset($option['type']) && $option['type'] === 'text')                 $this->field_text($option);
    392                         elseif (isset($option['type']) && $option['type'] === 'text_icon')         $this->field_text_icon($option);
    393                         elseif (isset($option['type']) && $option['type'] === 'text_multi')         $this->field_text_multi($option);
    394                         elseif (isset($option['type']) && $option['type'] === 'hidden')             $this->field_hidden($option);
    395 
    396                         elseif (isset($option['type']) && $option['type'] === 'range')             $this->field_range($option);
    397                         elseif (isset($option['type']) && $option['type'] === 'colorpicker')        $this->field_colorpicker($option);
    398                         elseif (isset($option['type']) && $option['type'] === 'colorpicker_multi')  $this->field_colorpicker_multi($option);
    399 
    400                         elseif (isset($option['type']) && $option['type'] === 'datepicker')            $this->field_datepicker($option);
    401                         elseif (isset($option['type']) && $option['type'] === 'faq')                $this->field_faq($option);
    402                         elseif (isset($option['type']) && $option['type'] === 'addons_grid')        $this->field_addons_grid($option);
    403                         elseif (isset($option['type']) && $option['type'] === 'custom_html')        $this->field_custom_html($option);
    404                         elseif (isset($option['type']) && $option['type'] === 'repeatable')            $this->field_repeatable($option);
    405                         elseif (isset($option['type']) && $option['type'] === 'media')                $this->field_media($option);
    406                         elseif (isset($option['type']) && $option['type'] === 'media_url')            $this->field_media_url($option);
    407 
    408                     endforeach;
    409                 endif;
     520                $settings_tabs_field->generate_field($field);
    410521                ?>
     522                <?php if ($collapsible) : ?>
     523                </div>
     524              <?php endif; ?>
    411525            </div>
    412526        <?php
    413 
    414             $input_html = ob_get_clean();
    415 
    416             echo sprintf($field_template, $title, $input_html, $group_details);
    417         }
    418 
    419 
    420         public function field_media($option)
    421         {
    422 
    423 
    424 
    425             $id            = isset($option['id']) ? $option['id'] : "";
    426             if (empty($id)) return;
    427             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    428             $field_name     = isset($option['field_name']) ? $option['field_name'] : $id;
    429             $parent             = isset($option['parent']) ? $option['parent'] : "";
    430             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    431             $title            = isset($option['title']) ? $option['title'] : "";
    432             $placeholder    = isset($option['placeholder']) ? $option['placeholder'] : "";
    433 
    434             $details             = isset($option['details']) ? $option['details'] : "";
    435 
    436             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    437             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    438 
    439             $default            = isset($option['default']) ? $option['default'] : '';
    440             $value            = isset($option['value']) ? $option['value'] : '';
    441             $value          = !empty($value) ?  $value : $default;
    442 
    443             $media_url    = wp_get_attachment_url($value);
    444             $media_type    = get_post_mime_type($value);
    445             $media_title = !empty($value) ? get_the_title($value) : __('Placeholder.jpg', $this->textdomain);
    446 
    447 
    448             $media_url = !empty($media_url) ? $media_url : $default;
    449             $media_url = !empty($media_url) ? $media_url : $placeholder;
    450             $media_basename = wp_basename($media_type);
    451 
    452             $field_name     = !empty($field_name) ? $field_name : $id;
    453             $field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
    454 
    455 
    456 
    457             ob_start();
    458             //wp_enqueue_media();
    459 
     527          endforeach;
     528        endif;
    460529        ?>
    461             <div id="input-wrapper-<?php echo $css_id; ?>" class="input-wrapper field-media-wrapper
    462             field-media-wrapper-<?php echo $css_id; ?>">
    463                 <div class="media-preview-wrap" style="width: 150px;margin-bottom: 10px;background: #eee;padding: 5px;    text-align: center;word-break: break-all;">
    464                     <?php
    465 
    466                     //var_dump($media_type);
    467 
    468                     if ("audio/mpeg" == $media_type) {
    469                     ?>
    470                         <div class="media-preview" class="dashicons dashicons-format-audio" style="font-size: 70px;display: inline;"></div>
    471                         <div class="media-title"><?php echo $media_title; ?></div>
    472                     <?php
    473                     } elseif (
    474                         "images/png" == $media_type ||
    475                         "image/png" == $media_type ||
    476                         "images/gif" == $media_type  ||
    477                         "image/gif" == $media_type  ||
    478                         "images/jpeg" == $media_type ||
    479                         "image/jpeg" == $media_type ||
    480                         "images/jpg" == $media_type ||
    481                         "image/jpg" == $media_type ||
    482                         "images/ico" == $media_type ||
    483                         "image/ico" == $media_type
    484                     ) {
    485                     ?>
    486                         <img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
    487                         <div class="media-title"><?php echo $media_title; ?></div>
    488                     <?php
    489                     } else {
    490                     ?>
    491                         <img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
    492                         <div class="media-title"><?php echo $media_title; ?></div>
    493 
    494                     <?php
    495                     }
    496                     ?>
    497                 </div>
    498                 <input class="media-input-value" type="hidden" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
    499                 <div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php esc_html_e('Upload', $this->textdomain); ?></div>
    500                 <div placeholder="<?php echo $placeholder; ?>" class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php esc_html_e('Clear', $this->textdomain); ?></div>
    501                 <div class="error-mgs"></div>
     530      </div>
     531      <?php
     532      $fieldHtml = ob_get_clean();
     533      $fieldHtml = preg_replace("/[\r\n]+/", "\n", $fieldHtml);
     534      $fieldHtml = preg_replace("/\s+/", ' ', $fieldHtml);
     535      ob_start();
     536      ?>
     537      <div id="input-wrapper-<?php echo esc_attr($css_id); ?>" class=" input-wrapper field-repeatable-wrapper
     538            field-repeatable-wrapper-<?php echo esc_attr($css_id); ?>">
     539        <div data-add_html="<?php echo esc_attr($fieldHtml); ?>" class="add-repeat-field" data-wrapper-id="<?php echo esc_attr($css_id); ?>"><i class="far fa-plus-square"></i>
     540          <?php echo 'Add'; ?></div>
     541        <div class="repeatable-field-list sortable" id="<?php echo esc_attr($css_id); ?>">
     542          <?php
     543          if (!empty($values)) :
     544            $count = 1;
     545            foreach ($values as $index => $val) :
     546              $title_field_val = !empty($val[$title_field]) ? $val[$title_field] : '#' . $count;
     547          ?>
     548              <div class="item-wrap <?php if ($collapsible) echo 'collapsible'; ?>" index="<?php echo esc_attr($index); ?>">
     549                <?php if ($collapsible) : ?>
     550                  <div class="header">
     551                  <?php endif; ?>
     552                  <span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo wp_kses_post($remove_text); ?></span>
     553                  <?php if ($sortable) : ?>
     554                    <span class="sort"><i class="fas fa-arrows-alt"></i></span>
     555                  <?php endif; ?>
     556                  <span class="title-text"><?php echo esc_html($title_field_val); ?></span>
     557                  <?php if ($collapsible) : ?>
     558                  </div>
     559                <?php endif; ?>
     560                <?php
     561                foreach ($fields as $field_index => $field) :
     562                  $fieldId = $field['id'];
     563                  $field_css_id = isset($field['css_id']) ? str_replace('TIMEINDEX', $index, $field['css_id']) : '';
     564                  $title_field_class = ($title_field == $field_index) ? 'title-field' : '';
     565                ?>
     566                  <div class="item <?php echo esc_attr($title_field_class); ?>">
     567                    <?php if ($collapsible) : ?>
     568                      <div class="content">
     569                      <?php endif; ?>
     570                      <?php
     571                      $field['parent'] = $field_name . '[' . $index . ']';
     572                      $field['css_id'] = $field_css_id;
     573                      $field['value'] = isset($val[$fieldId]) ? $val[$fieldId] : '';
     574                      $settings_tabs_field->generate_field($field);
     575                      if ($collapsible) : ?>
     576                      </div>
     577                    <?php endif; ?>
     578                  </div>
     579                <?php
     580                endforeach; ?>
     581              </div>
     582            <?php
     583              $count++;
     584            endforeach;
     585          else :
     586            ?>
     587          <?php
     588          endif;
     589          ?>
     590        </div>
     591        <div class="error-mgs"></div>
     592      </div>
     593    <?php
     594      $input_html = ob_get_clean();
     595      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     596    }
     597    public function field_select($option)
     598    {
     599      $id             = isset($option['id']) ? $option['id'] : "";
     600      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     601      $parent             = isset($option['parent']) ? $option['parent'] : "";
     602      $args     = isset($option['args']) ? $option['args'] : array();
     603      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     604      $disabled     = isset($option['disabled']) ? $option['disabled'] : false;
     605      $disabledMessage     = isset($option['disabledMessage']) ? $option['disabledMessage'] : '';
     606      $multiple     = isset($option['multiple']) ? $option['multiple'] : false;
     607      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     608      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     609      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     610      $title            = isset($option['title']) ? $option['title'] : "";
     611      $details             = isset($option['details']) ? $option['details'] : "";
     612      if ($is_pro == true) {
     613        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     614      }
     615      if ($multiple) {
     616        $value     = isset($option['value']) ? $option['value'] : array();
     617        $field_name = !empty($parent) ? $parent . '[' . $id . '][]' : $id . '[]';
     618        $default     = isset($option['default']) ? $option['default'] : array();
     619      } else {
     620        $value     = isset($option['value']) ? $option['value'] : '';
     621        $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     622        $default     = isset($option['default']) ? $option['default'] : '';
     623      }
     624      $value = !empty($value) ? $value : $default;
     625      ob_start();
     626    ?>
     627      <select <?php if ($multiple) echo 'multiple'; ?> <?php if ($disabled) echo 'disabled'; ?> name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>">
     628        <?php
     629        foreach ($args as $key => $name) :
     630          if ($multiple) {
     631            $selected =  in_array($key, $value) ? "selected" : "";
     632          } else {
     633            $selected = $value == $key ? "selected" : "";
     634          }
     635        ?>
     636          <option <?php echo esc_attr($selected); ?> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($name); ?>
     637          </option>
     638        <?php
     639        endforeach;
     640        ?>
     641      </select>
     642      <?php
     643      if ($multiple) :
     644      ?>
     645        <div class="button select-reset"><?php echo 'Reset'; ?></div><br>
     646      <?php
     647      endif;
     648      ?>
     649      <?php if ($disabled) : ?>
     650        <div class="disabled"><?php echo wp_kses_post($disabledMessage); ?></div>
     651      <?php endif; ?>
     652    <?php
     653      $input_html = ob_get_clean();
     654      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     655    }
     656    public function field_select2($option)
     657    {
     658      $id                 = isset($option['id']) ? $option['id'] : "";
     659      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     660      $parent             = isset($option['parent']) ? $option['parent'] : "";
     661      $args                 = isset($option['args']) ? $option['args'] : array();
     662      $multiple             = isset($option['multiple']) ? $option['multiple'] : "";
     663      $attributes         = isset($option['attributes']) ? $option['attributes'] : array();
     664      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     665      $is_pro             = isset($option['is_pro']) ? $option['is_pro'] : false;
     666      $pro_text             = isset($option['pro_text']) ? $option['pro_text'] : '';
     667      if ($multiple) {
     668        $value     = isset($option['value']) ? $option['value'] : array();
     669        $field_name = !empty($parent) ? $parent . '[' . $id . '][]' : $id . '[]';
     670        $default     = isset($option['default']) ? $option['default'] : array();
     671      } else {
     672        $value     = isset($option['value']) ? $option['value'] : '';
     673        $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     674        $default     = isset($option['default']) ? $option['default'] : '';
     675      }
     676      $value = !empty($value) ? $value : $default;
     677      //$value  = get_post_meta( $post_id, $id, true );
     678      $title            = isset($option['title']) ? $option['title'] : "";
     679      $details             = isset($option['details']) ? $option['details'] : "";
     680      $attributes_html = '';
     681      foreach ($attributes as $attributeId => $attribute) :
     682        $attributes_html = $attributeId . '=' . $attribute . ' ';
     683      endforeach;
     684      ob_start();
     685    ?>
     686      <select <?php echo esc_attr($attributes_html); ?> class="select2" <?php if ($multiple) echo 'multiple'; ?> name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>">
     687        <?php
     688        foreach ($args as $key => $name) :
     689          if ($multiple) {
     690            $selected = in_array($key, $value) ? "selected" : "";
     691          } else {
     692            $selected = ($key == $value) ? "selected" : "";
     693          }
     694        ?>
     695          <option <?php echo esc_attr($selected); ?> value="<?php echo esc_attr($key); ?>"><?php echo esc_html($name); ?>
     696          </option>
     697        <?php
     698        endforeach;
     699        ?>
     700      </select>
     701    <?php
     702      $input_html = ob_get_clean();
     703      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     704    }
     705    public function field_text_multi($option)
     706    {
     707      $id             = isset($option['id']) ? $option['id'] : "";
     708      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     709      $parent             = isset($option['parent']) ? $option['parent'] : "";
     710      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     711      $default     = isset($option['default']) ? $option['default'] : array();
     712      $values     = isset($option['value']) ? $option['value'] : $default;
     713      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     714      $remove_text     = isset($option['remove_text']) ? $option['remove_text'] : '<i class="fas fa-times"></i>';
     715      $sortable         = isset($option['sortable']) ? $option['sortable'] : true;
     716      $allow_clone         = isset($option['allow_clone']) ? $option['allow_clone'] : false;
     717      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     718      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     719      $title            = isset($option['title']) ? $option['title'] : "";
     720      $details             = isset($option['details']) ? $option['details'] : "";
     721      if ($is_pro == true) {
     722        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     723      }
     724      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     725      ob_start();
     726    ?>
     727      <div id="input-wrapper-<?php echo esc_attr($id); ?>" class="input-wrapper input-text-multi-wrapper
     728            input-text-multi-wrapper-<?php echo esc_attr($css_id); ?>">
     729        <span data-placeholder="<?php echo esc_attr($placeholder); ?>" data-sort="<?php echo esc_attr($sortable); ?>" data-clone="<?php echo esc_attr($allow_clone); ?>" data-name="<?php echo esc_attr($field_name); ?>[]" class="button add-item"><?php echo 'Add'; ?></span>
     730        <div class="field-list <?php if ($sortable) {
     731                                  echo 'sortable';
     732                                } ?>" id="<?php echo esc_attr($css_id); ?>">
     733          <?php
     734          if (!empty($values)) :
     735            foreach ($values as $value) :
     736          ?>
     737              <div class="item">
     738                <input type="text" name="<?php echo esc_attr($field_name); ?>[]" placeholder="<?php
     739                                                                                              echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
     740                <?php if ($allow_clone) : ?>
     741                  <span class="button clone"><i class="far fa-clone"></i></span>
     742                <?php endif; ?>
     743                <?php if ($sortable) : ?>
     744                  <span class="button sort"><i class="fas fa-arrows-alt"></i></span>
     745                <?php endif; ?>
     746                <span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo wp_kses_post($remove_text); ?></span>
     747              </div>
     748            <?php
     749            endforeach;
     750          else :
     751            ?>
     752            <div class="item">
     753              <input type="text" name="<?php echo esc_attr($field_name); ?>[]" placeholder="<?php
     754                                                                                            echo esc_attr($placeholder); ?>" value="" />
     755              <?php if ($allow_clone) : ?>
     756                <span class="button clone"><i class="far fa-clone"></i></span>
     757              <?php endif; ?>
     758              <?php if ($sortable) : ?>
     759                <span class="button sort"><i class="fas fa-arrows-alt"></i></span>
     760              <?php endif; ?>
     761              <span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo wp_kses_post($remove_text); ?></span>
    502762            </div>
    503 
     763          <?php
     764          endif;
     765          ?>
     766        </div>
     767        <div class="error-mgs"></div>
     768      </div>
     769    <?php
     770      $input_html = ob_get_clean();
     771      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     772    }
     773    public function field_hidden($option)
     774    {
     775      $id             = isset($option['id']) ? $option['id'] : "";
     776      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     777      $parent             = isset($option['parent']) ? $option['parent'] : "";
     778      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     779      $value     = isset($option['value']) ? $option['value'] : '';
     780      $default     = isset($option['default']) ? $option['default'] : '';
     781      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     782      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     783      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     784      $value = !empty($value) ? $value : $default;
     785      $title            = isset($option['title']) ? $option['title'] : "";
     786      $details             = isset($option['details']) ? $option['details'] : "";
     787      if ($is_pro == true) {
     788        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     789      }
     790      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     791      ob_start();
     792    ?>
     793      <input type="hidden" class="" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
     794    <?php
     795      $input_html = ob_get_clean();
     796      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     797    }
     798    public function field_text($option)
     799    {
     800      $id             = isset($option['id']) ? $option['id'] : "";
     801      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     802      $parent             = isset($option['parent']) ? $option['parent'] : "";
     803      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     804      $default     = isset($option['default']) ? $option['default'] : '';
     805      $value     = isset($option['value']) ? $option['value'] : $default;
     806      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     807      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     808      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     809      $title            = isset($option['title']) ? $option['title'] : "";
     810      $details             = isset($option['details']) ? $option['details'] : "";
     811      if ($is_pro == true) {
     812        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     813      }
     814      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     815      ob_start();
     816    ?>
     817      <input type="text" class="" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
     818    <?php
     819      $input_html = ob_get_clean();
     820      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     821    }
     822    public function field_number($option)
     823    {
     824      $id             = isset($option['id']) ? $option['id'] : "";
     825      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     826      $parent             = isset($option['parent']) ? $option['parent'] : "";
     827      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     828      $value     = isset($option['value']) ? $option['value'] : '';
     829      $default     = isset($option['default']) ? $option['default'] : '';
     830      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     831      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     832      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     833      $value = !empty($value) ? $value : $default;
     834      $title            = isset($option['title']) ? $option['title'] : "";
     835      $details             = isset($option['details']) ? $option['details'] : "";
     836      if ($is_pro == true) {
     837        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     838      }
     839      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     840      ob_start();
     841    ?>
     842      <input type="number" class="" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
     843    <?php
     844      $input_html = ob_get_clean();
     845      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     846    }
     847    public function field_wp_editor($option)
     848    {
     849      $id             = isset($option['id']) ? $option['id'] : "";
     850      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     851      $parent             = isset($option['parent']) ? $option['parent'] : "";
     852      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     853      $value     = isset($option['value']) ? $option['value'] : '';
     854      $default     = isset($option['default']) ? $option['default'] : '';
     855      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     856      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     857      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     858      $value = !empty($value) ? $value : $default;
     859      $title            = isset($option['title']) ? $option['title'] : "";
     860      $details             = isset($option['details']) ? $option['details'] : "";
     861      if ($is_pro == true) {
     862        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     863      }
     864      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     865      $editor_settings = isset($option['editor_settings']) ? $option['editor_settings'] : array('textarea_name' => $field_name, 'teeny' => true,  'textarea_rows' => 15,);
     866      ob_start();
     867    ?>
     868      <div id="field-wrapper-<?php echo esc_attr($id); ?>" class="<?php if (!empty($depends)) echo 'dependency-field'; ?> field-wrapper field-wp_editor-wrapper
     869            field-wp_editor-wrapper-<?php echo esc_attr($id); ?>">
    504870        <?php
    505 
    506 
    507             $input_html = ob_get_clean();
    508 
    509             echo sprintf($field_template, $title, $input_html, $details);
    510         }
    511 
    512 
    513 
    514 
    515         public function field_media_url($option)
    516         {
    517 
    518 
    519 
    520             $id            = isset($option['id']) ? $option['id'] : "";
    521             if (empty($id)) return;
    522             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    523             $field_name     = isset($option['field_name']) ? $option['field_name'] : $id;
    524             $parent             = isset($option['parent']) ? $option['parent'] : "";
    525             $placeholder    = isset($option['placeholder']) ? $option['placeholder'] : "";
    526             $placeholder_img    = isset($option['placeholder_img']) ? $option['placeholder_img'] : "";
    527 
    528             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    529             $title            = isset($option['title']) ? $option['title'] : "";
    530             $details             = isset($option['details']) ? $option['details'] : "";
    531 
    532             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    533             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    534 
    535             $default            = isset($option['default']) ? $option['default'] : '';
    536             $value            = isset($option['value']) ? $option['value'] : '';
    537             $value          = !empty($value) ?  $value : $default;
    538 
    539             $media_url    = $value;
    540             $media_type    = get_post_mime_type($value);
    541             $media_title = get_the_title($value);
    542             $media_url = !empty($media_url) ? $media_url : '';
    543             $media_url = !empty($media_url) ? $media_url : $placeholder_img;
    544 
    545             $field_name     = !empty($field_name) ? $field_name : $id;
    546             $field_name = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
    547 
    548 
    549             wp_enqueue_media();
    550             ob_start();
    551 
    552 
     871        wp_editor($value, $css_id, $editor_settings);
    553872        ?>
    554             <div id="input-wrapper-<?php echo $css_id; ?>" class="input-wrapper field-media-url-wrapper
    555             field-media-wrapper-<?php echo $css_id; ?>">
    556                 <div class="media-preview-wrap" style="width: 150px;margin-bottom: 10px;background: #eee;padding: 5px;    text-align: center;">
    557                     <?php
    558 
    559                     if ("audio/mpeg" == $media_type) {
    560                     ?>
    561                         <div class="media-preview" class="dashicons dashicons-format-audio" style="font-size: 70px;display: inline;"></div>
    562 
    563                     <?php
    564                     } elseif (
    565                         "images/png" == $media_type || "images/jpg" == $media_type || "images/jpeg" == $media_type ||
    566                         "images/gif" == $media_type  ||
    567                         "images/ico" == $media_type
    568                     ) {
    569                     ?>
    570                         <img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
    571 
    572                     <?php
    573                     } else {
    574                     ?>
    575                         <img class="media-preview" src="<?php echo $media_url; ?>" style="width:100%" />
    576 
    577                     <?php
    578                     }
    579                     ?>
    580                 </div>
    581                 <input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
    582                 <div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php esc_html_e('Upload', $this->textdomain); ?></div>
    583                 <div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php esc_html_e('Clear', 'post-grid'); ?></div>
    584                 <div class="error-mgs"></div>
    585             </div>
    586 
     873        <div class="error-mgs"></div>
     874      </div>
     875    <?php
     876      $input_html = ob_get_clean();
     877      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     878    }
     879    public function field_text_icon($option)
     880    {
     881      $id             = isset($option['id']) ? $option['id'] : "";
     882      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     883      $parent             = isset($option['parent']) ? $option['parent'] : "";
     884      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     885      $value     = isset($option['value']) ? $option['value'] : '';
     886      $default     = isset($option['default']) ? $option['default'] : '';
     887      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     888      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     889      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     890      $title            = isset($option['title']) ? $option['title'] : "";
     891      $details             = isset($option['details']) ? $option['details'] : "";
     892      $option_value = empty($value) ? $default : $value;
     893      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     894      ob_start();
     895    ?>
     896      <div class="text-icon">
     897        <span class="icon"><?php echo esc_html($option_value); ?></span><input type="text" class="" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($option_value); ?>" />
     898      </div>
     899
     900
     901    <?php
     902      $input_html = ob_get_clean();
     903      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     904    }
     905    public function field_range($option)
     906    {
     907      $id             = isset($option['id']) ? $option['id'] : "";
     908      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     909      $parent             = isset($option['parent']) ? $option['parent'] : "";
     910      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     911      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     912      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     913      $value     = isset($option['value']) ? $option['value'] : '';
     914      $default     = isset($option['default']) ? $option['default'] : '';
     915      $value = !empty($value) ? $value : $default;
     916      $args     = isset($option['args']) ? $option['args'] : "";
     917      $min = isset($args['min']) ? $args['min'] : '';
     918      $max = isset($args['max']) ? $args['max'] : '';
     919      $step = isset($args['step']) ? $args['step'] : '';
     920      $title            = isset($option['title']) ? $option['title'] : "";
     921      $details             = isset($option['details']) ? $option['details'] : "";
     922      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     923      ob_start();
     924    ?>
     925      <div class="range-input">
     926        <span class="range-value"><?php echo esc_html($value); ?></span><input type="range" min="<?php if ($min) echo esc_attr($min); ?>" max="<?php if ($max) echo esc_attr($max); ?>" step="<?php if ($step) echo esc_attr($step); ?>" class="" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" class="range" value="<?php echo esc_attr($value); ?>" />
     927      </div>
     928
     929
     930    <?php
     931      $input_html = ob_get_clean();
     932      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     933    }
     934    public function field_textarea($option)
     935    {
     936      $id             = isset($option['id']) ? $option['id'] : "";
     937      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     938      $parent             = isset($option['parent']) ? $option['parent'] : "";
     939      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     940      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     941      $value     = isset($option['value']) ? $option['value'] : '';
     942      $default     = isset($option['default']) ? $option['default'] : '';
     943      $value = !empty($value) ? $value : $default;
     944      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     945      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     946      $title            = isset($option['title']) ? $option['title'] : "";
     947      $details             = isset($option['details']) ? $option['details'] : "";
     948      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     949      if ($is_pro == true) {
     950        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     951      }
     952      ob_start();
     953    ?>
     954      <textarea name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" cols="40" rows="5" placeholder="<?php echo esc_attr($placeholder); ?>"><?php echo esc_html($value); ?></textarea>
     955    <?php
     956      $input_html = ob_get_clean();
     957      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     958    }
     959    public function field_textarea_editor($option)
     960    {
     961      $id             = isset($option['id']) ? $option['id'] : "";
     962      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     963      $parent             = isset($option['parent']) ? $option['parent'] : "";
     964      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     965      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     966      $value     = isset($option['value']) ? $option['value'] : '';
     967      $default     = isset($option['default']) ? $option['default'] : '';
     968      $value = !empty($value) ? $value : $default;
     969      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     970      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     971      $title            = isset($option['title']) ? $option['title'] : "";
     972      $details             = isset($option['details']) ? $option['details'] : "";
     973      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     974      if ($is_pro == true) {
     975        $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
     976      }
     977      ob_start();
     978    ?>
     979      <textarea editor_enabled="no" class="textarea-editor" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" cols="40" rows="5" placeholder="<?php echo esc_attr($placeholder); ?>"><?php echo esc_html($value); ?></textarea>
     980    <?php
     981      $input_html = ob_get_clean();
     982      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     983    }
     984    public function field_scripts_js($option)
     985    {
     986      $id             = isset($option['id']) ? $option['id'] : "";
     987      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     988      $parent             = isset($option['parent']) ? $option['parent'] : "";
     989      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     990      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     991      $value     = isset($option['value']) ? $option['value'] : '';
     992      $default     = isset($option['default']) ? $option['default'] : '';
     993      $value = !empty($value) ? $value : $default;
     994      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     995      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     996      $title            = isset($option['title']) ? $option['title'] : "";
     997      $details             = isset($option['details']) ? $option['details'] : "";
     998      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     999      ob_start();
     1000    ?>
     1001      <textarea name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" class="code-editor" cols="40" rows="5" placeholder="<?php echo esc_attr($placeholder); ?>"><?php echo esc_html($value); ?></textarea>
     1002
     1003    <?php
     1004      $input_html = ob_get_clean();
     1005      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1006    }
     1007    public function field_scripts_css($option)
     1008    {
     1009      $id             = isset($option['id']) ? $option['id'] : "";
     1010      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1011      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1012      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1013      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     1014      $value     = isset($option['value']) ? $option['value'] : '';
     1015      $default     = isset($option['default']) ? $option['default'] : '';
     1016      $value = !empty($value) ? $value : $default;
     1017      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1018      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1019      $title            = isset($option['title']) ? $option['title'] : "";
     1020      $details         = isset($option['details']) ? $option['details'] : "";
     1021      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1022    ?>
     1023      <?php
     1024      ob_start();
     1025      ?>
     1026      <textarea name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" class="css_editor" cols="40" rows="5" placeholder="<?php echo esc_attr($placeholder); ?>"><?php echo esc_html($value); ?></textarea>
     1027
     1028    <?php
     1029      $input_html = ob_get_clean();
     1030      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1031    }
     1032    public function field_checkbox($option)
     1033    {
     1034      $id                = isset($option['id']) ? $option['id'] : "";
     1035      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1036      $title            = isset($option['title']) ? $option['title'] : "";
     1037      $details         = isset($option['details']) ? $option['details'] : "";
     1038      $for         = isset($option['for']) ? $option['for'] : "";
     1039      $args            = isset($option['args']) ? $option['args'] : array();
     1040      $style            = isset($option['style']) ? $option['style'] : array();
     1041      $style_inline            = isset($style['inline']) ? $style['inline'] : true;
     1042      $option_value     = isset($option['value']) ? $option['value'] : '';
     1043      $default     = isset($option['default']) ? $option['default'] : '';
     1044      $option_value = !empty($option_value) ? $option_value : $default;
     1045      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1046    ?>
     1047      <div class="setting-field">
     1048        <div class="field-lable"><?php if (!empty($title)) echo esc_html($title);  ?></div>
     1049        <div class="field-input">
     1050          <?php
     1051          if (!empty($args))
     1052            foreach ($args as $key => $value) :
     1053              //$checked = ( $key == $option_value ) ? "checked" : "";
     1054              $checked = in_array($key, $option_value) ? "checked" : "";
     1055              $for = !empty($for) ? $for . '-' . $id . "-" . $key : $id . "-" . $key;
     1056          ?>
     1057            <label for='<?php echo esc_attr($for); ?>'><input name='<?php echo esc_attr($field_name); ?>[]' type='checkbox' id='<?php echo esc_attr($for); ?>' value='<?php echo esc_attr($key); ?>' <?php echo esc_attr($checked); ?>><span><?php echo esc_html($value); ?></span></label>
     1058            <?php
     1059              if (!$style_inline) {
     1060            ?>
     1061              <br>
     1062          <?php
     1063              }
     1064            endforeach;
     1065          ?>
     1066          <p class="description"><?php if (!empty($details)) echo esc_html($details);  ?></p>
     1067        </div>
     1068      </div>
     1069      <?php
     1070    }
     1071    public function field_radio($option)
     1072    {
     1073      $id                = isset($option['id']) ? $option['id'] : "";
     1074      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1075      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1076      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1077      $title            = isset($option['title']) ? $option['title'] : "";
     1078      $details         = isset($option['details']) ? $option['details'] : "";
     1079      $for         = isset($option['for']) ? $option['for'] : "";
     1080      $args            = isset($option['args']) ? $option['args'] : array();
     1081      $style            = isset($option['style']) ? $option['style'] : array();
     1082      $style_inline            = isset($style['inline']) ? $style['inline'] : true;
     1083      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1084      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1085      $option_value     = isset($option['value']) ? $option['value'] : '';
     1086      $default     = isset($option['default']) ? $option['default'] : '';
     1087      $option_value = !empty($option_value) ? $option_value : $default;
     1088      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1089      ob_start();
     1090      if (!empty($args))
     1091        foreach ($args as $key => $value) :
     1092          $for = '';
     1093          $checked = ($key == $option_value) ? "checked" : "";
     1094          $for = !empty($for) ? $for . '-' . $css_id . "-" . $key : $css_id . "-" . $key;
     1095      ?>
     1096        <label for="<?php echo esc_attr($for); ?>"><input name="<?php echo esc_attr($field_name); ?>" type="radio" id="<?php echo esc_attr($for); ?>" value="<?php echo esc_attr($key); ?>" <?php echo esc_attr($checked); ?>><span><?php echo esc_html($value); ?></span></label>
    5871097        <?php
    588 
    589 
    590             $input_html = ob_get_clean();
    591 
    592             echo sprintf($field_template, $title, $input_html, $details);
    593         }
    594 
    595 
    596 
    597         public function field_repeatable($option)
    598         {
    599 
    600             $id             = isset($option['id']) ? $option['id'] : "";
    601             if (empty($id)) return;
    602             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    603             $parent             = isset($option['parent']) ? $option['parent'] : "";
    604             $field_name     = isset($option['field_name']) ? $option['field_name'] : $id;
    605             $field_name     = !empty($parent) ? $parent . '[' . $field_name . ']' : $field_name;
    606 
    607             $sortable         = isset($option['sortable']) ? $option['sortable'] : true;
    608             $collapsible     = isset($option['collapsible']) ? $option['collapsible'] : true;
    609             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    610             $values            = isset($option['value']) ? $option['value'] : array();
    611             $fields         = isset($option['fields']) ? $option['fields'] : array();
    612             $title_field     = isset($option['title_field']) ? $option['title_field'] : '';
    613             $remove_text     = isset($option['remove_text']) ? $option['remove_text'] : '<i class="fas fa-times"></i>';
    614             $limit             = isset($option['limit']) ? $option['limit'] : '';
    615 
    616             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    617             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    618 
    619             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    620             $title            = isset($option['title']) ? $option['title'] : "";
    621             $details             = isset($option['details']) ? $option['details'] : "";
    622 
    623             $pickp_settings_tabs_field = new pickp_settings_tabs_field();
    624 
    625 
    626             ob_start();
     1098          if (!$style_inline) {
    6271099        ?>
    628             <div class="item-wrap collapsible">
    629                 <div class="header">
    630                     <span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo $remove_text; ?></span>
    631                     <?php
    632                     if ($sortable):
    633                     ?>
    634                         <span class="sort"><i class="fas fa-arrows-alt"></i></span>
    635                     <?php
    636                     endif;
    637                     ?>
    638                     <span class="title-text">#TIMEINDEX</span>
    639                 </div>
    640                 <?php
    641 
    642 
    643                 if (!empty($fields)):
    644                     foreach ($fields as $field):
    645 
    646                         $fieldType = isset($field['type']) ? $field['type'] : '';
    647                         $field['parent'] = $field_name . '[TIMEINDEX]';
    648 
    649 
    650                 ?>
    651                         <div class="item">
    652                             <?php if ($collapsible): ?>
    653                                 <div class="content">
    654                                 <?php endif; ?>
    655 
    656                                 <?php
    657                                 $pickp_settings_tabs_field->generate_field($field);
    658                                 ?>
    659                                 <?php if ($collapsible): ?>
    660                                 </div>
    661                             <?php endif; ?>
    662 
    663                         </div>
    664                 <?php
    665 
    666                     endforeach;
    667                 endif;
    668                 ?>
    669             </div>
     1100          <br>
     1101      <?php
     1102          }
     1103        endforeach;
     1104      $input_html = ob_get_clean();
     1105      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1106    }
     1107    public function field_radio_image($option)
     1108    {
     1109      $id                = isset($option['id']) ? $option['id'] : "";
     1110      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1111      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1112      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1113      $args            = isset($option['args']) ? $option['args'] : array();
     1114      //$args           = is_array( $args ) ? $args : $this->generate_args_from_string( $args );
     1115      $option_value     = isset($option['value']) ? $option['value'] : '';
     1116      $default     = isset($option['default']) ? $option['default'] : '';
     1117      $lazy_load_img     = isset($option['lazy_load_img']) ? $option['lazy_load_img'] : '';
     1118      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1119      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1120      $title            = isset($option['title']) ? $option['title'] : "";
     1121      $details             = isset($option['details']) ? $option['details'] : "";
     1122      $width             = isset($option['width']) ? $option['width'] : "250px";
     1123      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1124      $option_value = empty($option_value) ? $default : $option_value;
     1125      ob_start();
     1126      ?>
     1127      <div class="radio-img">
     1128        <?php
     1129        foreach ($args as $key => $value) :
     1130          $name = isset($value['name']) ? $value['name'] : '';
     1131          $thumb = isset($value['thumb']) ? $value['thumb'] : '';
     1132          $disabled = isset($value['disabled']) ? $value['disabled'] : '';
     1133          $pro_msg = isset($value['pro_msg']) ? $value['pro_msg'] : '';
     1134          $link = isset($value['link']) ? $value['link'] : '';
     1135          $link_text = isset($value['link_text']) ? $value['link_text'] : 'Go';
     1136          $checked = ($key == $option_value) ? "checked" : "";
     1137        ?>
     1138          <label style="width: <?php echo esc_attr($width); ?>;" title="<?php echo esc_attr($name); ?>" data-value="<?php echo esc_attr($key); ?>" class="<?php if ($checked == 'checked') echo 'active'; ?> <?php if ($disabled == true) echo 'disabled'; ?>">
     1139            <input <?php if ($disabled) echo 'disabled'; ?> name="<?php echo esc_attr($field_name); ?>" type="radio" id="<?php echo esc_attr($css_id); ?>-<?php echo esc_attr($key); ?>" value="<?php echo esc_attr($key); ?>" <?php echo esc_attr($checked); ?>>
    6701140            <?php
    671 
    672             $fieldHtml = ob_get_clean();
    673 
    674             $fieldHtml = preg_replace("/[\r\n]+/", "\n", $fieldHtml);
    675             $fieldHtml = preg_replace("/\s+/", ' ', $fieldHtml);
    676 
    677 
    678             ob_start();
     1141            if (!empty($thumb)) :
    6791142            ?>
    680 
    681 
    682             <div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
    683             field-repeatable-wrapper-<?php echo $css_id; ?>">
    684                 <div add_html="<?php echo esc_attr($fieldHtml); ?>" class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add', 'post-grid'); ?></div>
    685                 <div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
    686                     <?php
    687                     if (!empty($values)):
    688                         $count = 1;
    689                         foreach ($values as $index => $val):
    690                             $title_field_val = !empty($val[$title_field]) ? $val[$title_field] : '#' . $count;
    691 
    692                             //var_dump($index);
    693 
    694                     ?>
    695                             <div class="item-wrap <?php if ($collapsible) echo 'collapsible'; ?>" index="<?php echo $index; ?>">
    696                                 <?php if ($collapsible): ?>
    697                                     <div class="header">
    698                                     <?php endif; ?>
    699                                     <span class="remove" onclick="jQuery(this).parent().parent().remove()"><?php echo $remove_text; ?></span>
    700                                     <?php if ($sortable): ?>
    701                                         <span class="sort"><i class="fas fa-arrows-alt"></i></span>
    702                                     <?php endif; ?>
    703 
    704                                     <span class="title-text"><?php echo $title_field_val; ?></span>
    705                                     <?php if ($collapsible): ?>
    706                                     </div>
    707                                 <?php endif; ?>
    708                                 <?php
    709 
    710 
    711 
    712                                 foreach ($fields as $field_index => $field):
    713                                     $fieldId = $field['id'];
    714                                     $field_css_id = isset($field['css_id']) ? str_replace('TIMEINDEX', $index, $field['css_id']) : '';
    715 
    716                                     //var_dump($field_css_id);
    717 
    718                                     $title_field_class = ($title_field == $field_index) ? 'title-field' : '';
    719                                 ?>
    720                                     <div class="item <?php echo $title_field_class; ?>">
    721                                         <?php if ($collapsible): ?>
    722                                             <div class="content">
    723                                             <?php endif; ?>
    724 
    725                                             <?php
    726                                             $field['parent'] = $field_name . '[' . $index . ']';
    727                                             $field['css_id'] = $field_css_id;
    728 
    729                                             $field['value'] = isset($val[$fieldId]) ? $val[$fieldId] : '';
    730 
    731                                             $pickp_settings_tabs_field->generate_field($field);
    732 
    733 
    734                                             if ($collapsible): ?>
    735                                             </div>
    736                                         <?php endif; ?>
    737                                     </div>
    738                                 <?php
    739 
    740                                 endforeach; ?>
    741                             </div>
    742                         <?php
    743                             $count++;
    744                         endforeach;
    745                     else:
    746                         ?>
    747                     <?php
    748                     endif;
    749                     ?>
    750                 </div>
    751                 <div class="error-mgs"></div>
    752             </div>
    753 
    754         <?php
    755 
    756             $input_html = ob_get_clean();
    757 
    758             echo sprintf($field_template, $title, $input_html, $details);
    759         }
    760 
    761 
    762 
    763 
    764 
    765 
    766 
    767 
    768         public function field_select($option)
    769         {
    770 
    771             $id             = isset($option['id']) ? $option['id'] : "";
    772             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    773             $parent             = isset($option['parent']) ? $option['parent'] : "";
    774             $args     = isset($option['args']) ? $option['args'] : array();
    775             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    776             $multiple     = isset($option['multiple']) ? $option['multiple'] : false;
    777             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    778 
    779             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    780             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    781 
    782 
    783             $title            = isset($option['title']) ? $option['title'] : "";
    784             $details             = isset($option['details']) ? $option['details'] : "";
    785 
    786             if ($is_pro == true) {
    787                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    788             }
    789 
    790 
    791             if ($multiple) {
    792                 $value     = isset($option['value']) ? $option['value'] : array();
    793                 $field_name = !empty($parent) ? $parent . '[' . $id . '][]' : $id . '[]';
    794                 $default     = isset($option['default']) ? $option['default'] : array();
    795             } else {
    796                 $value     = isset($option['value']) ? $option['value'] : '';
    797                 $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    798                 $default     = isset($option['default']) ? $option['default'] : '';
    799             }
    800 
    801 
    802             $value = !empty($value) ? $value : $default;
    803 
    804 
    805 
    806 
    807             ob_start();
    808         ?>
    809 
    810             <select <?php if ($multiple) echo 'multiple'; ?> name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>">
    811                 <?php
    812                 foreach ($args as $key => $name):
    813                     if ($multiple) {
    814                         $selected =  in_array($key, $value) ? "selected" : "";
    815                     } else {
    816                         $selected = $value == $key ? "selected" : "";
    817                     }
    818 
    819 
    820                 ?>
    821                     <option <?php echo $selected; ?> value="<?php echo $key; ?>"><?php echo $name; ?></option>
    822                 <?php
    823                 endforeach;
    824                 ?>
    825             </select>
     1143              <img alt="<?php echo esc_attr($name); ?>" src="<?php echo esc_url($thumb); ?>">
     1144              <div class="name"><?php echo esc_html($name); ?></div>
    8261145            <?php
    827             if ($multiple):
    828             ?>
    829                 <div class="button select-reset">Reset</div><br>
    830             <?php
     1146            else :
     1147              echo esc_html($name);
    8311148            endif;
    8321149            ?>
    833 
     1150            <?php if ($disabled == true) : ?>
     1151              <span class="pro-msg"><?php echo esc_html($pro_msg); ?></span>
     1152            <?php endif; ?>
     1153            <?php if (!empty($link)) : ?>
     1154              <a target="_blank" class="link" href="<?php echo esc_url($link); ?>"><?php echo esc_html($link_text); ?></a>
     1155            <?php endif; ?>
     1156          </label>
    8341157        <?php
    835 
    836             $input_html = ob_get_clean();
    837 
    838             echo sprintf($field_template, $title, $input_html, $details);
    839         }
    840 
    841         public function field_select2($option)
    842         {
    843 
    844             $id                 = isset($option['id']) ? $option['id'] : "";
    845             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    846             $parent             = isset($option['parent']) ? $option['parent'] : "";
    847             $args                 = isset($option['args']) ? $option['args'] : array();
    848             $multiple             = isset($option['multiple']) ? $option['multiple'] : "";
    849             $attributes         = isset($option['attributes']) ? $option['attributes'] : array();
    850             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    851 
    852             $is_pro             = isset($option['is_pro']) ? $option['is_pro'] : false;
    853             $pro_text             = isset($option['pro_text']) ? $option['pro_text'] : '';
    854 
    855 
    856             //var_dump($css_id);
    857 
    858             if ($multiple) {
    859                 $value     = isset($option['value']) ? $option['value'] : array();
    860                 $field_name = !empty($parent) ? $parent . '[' . $id . '][]' : $id . '[]';
    861                 $default     = isset($option['default']) ? $option['default'] : array();
    862             } else {
    863                 $value     = isset($option['value']) ? $option['value'] : '';
    864                 $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    865                 $default     = isset($option['default']) ? $option['default'] : '';
    866             }
    867 
    868             $value = !empty($value) ? $value : $default;
    869 
    870             //$value    = get_post_meta( $post_id, $id, true );
    871             $title            = isset($option['title']) ? $option['title'] : "";
    872             $details             = isset($option['details']) ? $option['details'] : "";
    873 
    874             $attributes_html = '';
    875 
    876             foreach ($attributes as $attributeId => $attribute):
    877 
    878                 $attributes_html = $attributeId . '=' . $attribute . ' ';
    879 
    880             endforeach;
    881 
    882 
    883             ob_start();
     1158        endforeach;
    8841159        ?>
    885             <select <?php echo $attributes_html; ?> class="select2" <?php if ($multiple) echo 'multiple'; ?> name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>">
    886                 <?php
    887                 foreach ($args as $key => $name):
    888 
    889                     if ($multiple) {
    890                         $selected = in_array($key, $value) ? "selected" : "";
    891                     } else {
    892                         $selected = ($key == $value) ? "selected" : "";
    893                     }
    894 
    895                 ?>
    896                     <option <?php echo $selected; ?> value="<?php echo $key; ?>"><?php echo $name; ?></option>
    897                 <?php
    898                 endforeach;
    899                 ?>
    900             </select>
    901         <?php
    902 
    903             $input_html = ob_get_clean();
    904 
    905             echo sprintf($field_template, $title, $input_html, $details);
    906         }
    907 
    908 
    909 
    910 
    911 
    912         public function field_text_multi($option)
    913         {
    914 
    915             $id             = isset($option['id']) ? $option['id'] : "";
    916             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    917             $parent             = isset($option['parent']) ? $option['parent'] : "";
    918             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    919 
    920             $default     = isset($option['default']) ? $option['default'] : array();
    921             $values     = isset($option['value']) ? $option['value'] : $default;
    922 
    923             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    924 
    925             $remove_text     = isset($option['remove_text']) ? $option['remove_text'] : '<i class="fas fa-times"></i>';
    926             $sortable         = isset($option['sortable']) ? $option['sortable'] : true;
    927             $allow_clone         = isset($option['allow_clone']) ? $option['allow_clone'] : false;
    928 
    929 
    930             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    931             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    932 
    933 
    934             $title            = isset($option['title']) ? $option['title'] : "";
    935             $details             = isset($option['details']) ? $option['details'] : "";
    936 
    937             if ($is_pro == true) {
    938                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    939             }
    940 
    941             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    942 
    943 
    944             ob_start();
    945         ?>
    946             <div id="input-wrapper-<?php echo $id; ?>" class="input-wrapper input-text-multi-wrapper
    947             input-text-multi-wrapper-<?php echo $css_id; ?>">
    948                 <span data-placeholder="<?php echo esc_attr($placeholder); ?>" data-sort="<?php echo $sortable; ?>" data-clone="<?php echo $allow_clone; ?>" data-name="<?php echo $field_name; ?>[]" class="button add-item"><?php esc_html_e('Add', $this->textdomain); ?></span>
    949                 <div class="field-list <?php if ($sortable) {
    950                                             echo 'sortable';
    951                                         } ?>" id="<?php echo $css_id; ?>">
    952                     <?php
    953                     if (!empty($values)):
    954                         foreach ($values as $value):
    955                     ?>
    956                             <div class="item">
    957                                 <input type="text" name="<?php echo esc_attr($field_name); ?>[]" placeholder="<?php
    958                                                                                                                 echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
    959 
    960                                 <?php if ($allow_clone): ?>
    961                                     <span class="button clone"><i class="far fa-clone"></i></span>
    962                                 <?php endif; ?>
    963 
    964 
    965                                 <?php if ($sortable): ?>
    966                                     <span class="button sort"><i class="fas fa-arrows-alt"></i></span>
    967                                 <?php endif; ?>
    968 
    969                                 <span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo ($remove_text); ?></span>
    970                             </div>
    971                         <?php
    972                         endforeach;
    973 
    974                     else:
    975 
    976                         ?>
    977                         <div class="item">
    978                             <input type="text" name="<?php echo esc_attr($field_name); ?>[]" placeholder="<?php
    979                                                                                                             echo esc_attr($placeholder); ?>" value="" />
    980 
    981                             <?php if ($allow_clone): ?>
    982                                 <span class="button clone"><i class="far fa-clone"></i></span>
    983                             <?php endif; ?>
    984 
    985 
    986                             <?php if ($sortable): ?>
    987                                 <span class="button sort"><i class="fas fa-arrows-alt"></i></span>
    988                             <?php endif; ?>
    989 
    990                             <span class="button remove" onclick="jQuery(this).parent().remove()"><?php echo ($remove_text); ?></span>
    991                         </div>
    992                     <?php
    993 
    994                     endif;
    995                     ?>
    996                 </div>
    997                 <div class="error-mgs"></div>
    998 
    999 
    1000             </div>
    1001 
    1002         <?php
    1003 
    1004             $input_html = ob_get_clean();
    1005 
    1006             echo sprintf($field_template, $title, $input_html, $details);
    1007         }
    1008 
    1009         public function field_hidden($option)
    1010         {
    1011 
    1012             $id             = isset($option['id']) ? $option['id'] : "";
    1013             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1014             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1015             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1016             $value     = isset($option['value']) ? $option['value'] : '';
    1017             $default     = isset($option['default']) ? $option['default'] : '';
    1018             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1019 
    1020             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1021             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1022 
    1023             $value = !empty($value) ? $value : $default;
    1024 
    1025             $title            = isset($option['title']) ? $option['title'] : "";
    1026             $details             = isset($option['details']) ? $option['details'] : "";
    1027 
    1028             if ($is_pro == true) {
    1029                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    1030             }
    1031 
    1032             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1033 
    1034 
    1035             ob_start();
    1036         ?>
    1037             <input type="hidden" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo esc_attr($value); ?>" />
    1038         <?php
    1039 
    1040             $input_html = ob_get_clean();
    1041 
    1042             echo sprintf($field_template, $title, $input_html, $details);
    1043         }
    1044 
    1045 
    1046         public function field_text($option)
    1047         {
    1048 
    1049             $id             = isset($option['id']) ? $option['id'] : "";
    1050             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1051             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1052             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1053             $value     = isset($option['value']) ? $option['value'] : '';
    1054             $default     = isset($option['default']) ? $option['default'] : '';
    1055             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1056 
    1057             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1058             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1059 
    1060             $value = !empty($value) ? $value : $default;
    1061 
    1062             $title            = isset($option['title']) ? $option['title'] : "";
    1063             $details             = isset($option['details']) ? $option['details'] : "";
    1064 
    1065             if ($is_pro == true) {
    1066                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    1067             }
    1068 
    1069             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1070 
    1071 
    1072             ob_start();
    1073         ?>
    1074             <input type="text" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo esc_attr($value); ?>" />
    1075         <?php
    1076 
    1077             $input_html = ob_get_clean();
    1078 
    1079             echo sprintf($field_template, $title, $input_html, $details);
    1080         }
    1081 
    1082 
    1083 
    1084         public function field_wp_editor($option)
    1085         {
    1086 
    1087             $id             = isset($option['id']) ? $option['id'] : "";
    1088             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1089             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1090             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1091             $value     = isset($option['value']) ? $option['value'] : '';
    1092             $default     = isset($option['default']) ? $option['default'] : '';
    1093             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1094 
    1095 
    1096 
    1097             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1098             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1099 
    1100             $value = !empty($value) ? $value : $default;
    1101 
    1102             $title            = isset($option['title']) ? $option['title'] : "";
    1103             $details             = isset($option['details']) ? $option['details'] : "";
    1104 
    1105             if ($is_pro == true) {
    1106                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    1107             }
    1108 
    1109             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1110 
    1111             $editor_settings = isset($option['editor_settings']) ? $option['editor_settings'] : array('textarea_name' => $field_name, 'teeny' => true,  'textarea_rows' => 15,);
    1112 
    1113             ob_start();
    1114 
    1115         ?>
    1116             <div id="field-wrapper-<?php echo $id; ?>" class="<?php if (!empty($depends)) echo 'dependency-field'; ?> field-wrapper field-wp_editor-wrapper
    1117             field-wp_editor-wrapper-<?php echo $id; ?>">
    1118                 <?php
    1119                 wp_editor($value, $css_id, $editor_settings);
    1120                 ?>
    1121                 <div class="error-mgs"></div>
    1122             </div>
    1123 
    1124         <?php
    1125 
    1126 
    1127 
    1128 
    1129             $input_html = ob_get_clean();
    1130 
    1131             echo sprintf($field_template, $title, $input_html, $details);
    1132         }
    1133 
    1134 
    1135 
    1136 
    1137 
    1138 
    1139         public function field_text_icon($option)
    1140         {
    1141 
    1142             $id             = isset($option['id']) ? $option['id'] : "";
    1143             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1144             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1145             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1146             $value     = isset($option['value']) ? $option['value'] : '';
    1147             $default     = isset($option['default']) ? $option['default'] : '';
    1148             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1149 
    1150             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1151             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1152 
    1153             $title            = isset($option['title']) ? $option['title'] : "";
    1154             $details             = isset($option['details']) ? $option['details'] : "";
    1155 
    1156             $option_value = empty($value) ? $default : $value;
    1157 
    1158             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1159 
    1160 
    1161 
    1162 
    1163             ob_start();
    1164         ?>
    1165             <div class="text-icon">
    1166                 <span class="icon"><?php echo $option_value; ?></span><input type="text" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($option_value); ?>" />
    1167             </div>
    1168             <style>
    1169                 .text-icon {}
    1170 
    1171                 .text-icon .icon {
    1172                     /* width: 30px; */
    1173                     background: #ddd;
    1174                     /* height: 28px; */
    1175                     display: inline-block;
    1176                     vertical-align: top;
    1177                     text-align: center;
    1178                     font-size: 14px;
    1179                     padding: 5px 10px;
    1180                     line-height: normal;
    1181                 }
    1182             </style>
    1183             <script>
    1184                 jQuery(document).ready(function($) {
    1185                     $(document).on("keyup", ".text-icon input", function() {
    1186                         val = $(this).val();
    1187                         if (val) {
    1188                             $(this).parent().children(".icon").html(val);
    1189                         }
    1190                     })
    1191                 })
    1192             </script>
    1193         <?php
    1194 
    1195             $input_html = ob_get_clean();
    1196 
    1197             echo sprintf($field_template, $title, $input_html, $details);
    1198         }
    1199 
    1200 
    1201 
    1202         public function field_range($option)
    1203         {
    1204 
    1205             $id             = isset($option['id']) ? $option['id'] : "";
    1206             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1207             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1208             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1209 
    1210             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1211             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1212 
    1213             $value     = isset($option['value']) ? $option['value'] : '';
    1214             $default     = isset($option['default']) ? $option['default'] : '';
    1215             $value = !empty($value) ? $value : $default;
    1216 
    1217             $args     = isset($option['args']) ? $option['args'] : "";
    1218 
    1219             $min = isset($args['min']) ? $args['min'] : '';
    1220             $max = isset($args['max']) ? $args['max'] : '';
    1221             $step = isset($args['step']) ? $args['step'] : '';
    1222 
    1223             $title            = isset($option['title']) ? $option['title'] : "";
    1224             $details             = isset($option['details']) ? $option['details'] : "";
    1225 
    1226             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1227 
    1228 
    1229             ob_start();
    1230         ?>
    1231             <div class="range-input">
    1232                 <span class="range-value"><?php echo $value; ?></span><input type="range" min="<?php if ($min) echo $min; ?>" max="<?php if ($max) echo $max; ?>" step="<?php if ($step) echo $step; ?>" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
    1233             </div>
    1234 
    1235             <script>
    1236                 jQuery(document).ready(function($) {
    1237                     $(document).on("change", "#<?php echo $css_id; ?>", function() {
    1238                         val = $(this).val();
    1239                         if (val) {
    1240                             $(this).parent().children(".range-value").html(val);
    1241                         }
    1242                     })
    1243                 })
    1244             </script>
    1245 
    1246             <style>
    1247                 .range-input {}
    1248 
    1249                 .range-input .range-value {
    1250                     display: inline-block;
    1251                     vertical-align: top;
    1252                     margin: 0 0;
    1253                     padding: 4px 10px;
    1254                     background: #eee;
    1255                 }
    1256             </style>
    1257         <?php
    1258 
    1259             $input_html = ob_get_clean();
    1260             echo sprintf($field_template, $title, $input_html, $details);
    1261         }
    1262 
    1263 
    1264 
    1265         public function field_textarea($option)
    1266         {
    1267 
    1268             $id             = isset($option['id']) ? $option['id'] : "";
    1269             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1270             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1271             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1272             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1273             $value     = isset($option['value']) ? $option['value'] : '';
    1274             $default     = isset($option['default']) ? $option['default'] : '';
    1275             $value = !empty($value) ? $value : $default;
    1276 
    1277             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1278             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1279 
    1280             $title            = isset($option['title']) ? $option['title'] : "";
    1281             $details             = isset($option['details']) ? $option['details'] : "";
    1282 
    1283             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1284 
    1285             if ($is_pro == true) {
    1286                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    1287             }
    1288 
    1289 
    1290             ob_start();
    1291         ?>
    1292             <textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
    1293         <?php
    1294 
    1295             $input_html = ob_get_clean();
    1296 
    1297             echo sprintf($field_template, $title, $input_html, $details);
    1298         }
    1299 
    1300 
    1301 
    1302         public function field_textarea_editor($option)
    1303         {
    1304 
    1305             $id             = isset($option['id']) ? $option['id'] : "";
    1306             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1307             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1308             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1309             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1310             $value     = isset($option['value']) ? $option['value'] : '';
    1311             $default     = isset($option['default']) ? $option['default'] : '';
    1312             $value = !empty($value) ? $value : $default;
    1313 
    1314             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1315             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1316 
    1317             $title            = isset($option['title']) ? $option['title'] : "";
    1318             $details             = isset($option['details']) ? $option['details'] : "";
    1319 
    1320             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1321 
    1322             if ($is_pro == true) {
    1323                 $details = '<span class="pro-feature">' . $pro_text . '</span> ' . $details;
    1324             }
    1325 
    1326 
    1327             ob_start();
    1328         ?>
    1329             <textarea editor_enabled="no" class="textarea-editor" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
    1330         <?php
    1331 
    1332             $input_html = ob_get_clean();
    1333 
    1334             echo sprintf($field_template, $title, $input_html, $details);
    1335         }
    1336 
    1337 
    1338 
    1339         public function field_scripts_js($option)
    1340         {
    1341 
    1342             $id             = isset($option['id']) ? $option['id'] : "";
    1343             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1344             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1345             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1346             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1347             $value     = isset($option['value']) ? $option['value'] : '';
    1348             $default     = isset($option['default']) ? $option['default'] : '';
    1349             $value = !empty($value) ? $value : $default;
    1350 
    1351             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1352             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1353 
    1354             $title            = isset($option['title']) ? $option['title'] : "";
    1355             $details             = isset($option['details']) ? $option['details'] : "";
    1356 
    1357             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1358 
    1359             $settings = wp_enqueue_code_editor(array('type' => 'text/javascript'));
    1360             $code_editor = wp_json_encode($settings);
    1361 
    1362 
    1363             ob_start();
    1364         ?>
    1365             <textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
    1366 
    1367             <script>
    1368                 jQuery(document).ready(function($) {
    1369                     wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
    1370                 })
    1371             </script>
    1372         <?php
    1373 
    1374             $input_html = ob_get_clean();
    1375 
    1376             echo sprintf($field_template, $title, $input_html, $details);
    1377         }
    1378 
    1379 
    1380         public function field_scripts_css($option)
    1381         {
    1382 
    1383             $id             = isset($option['id']) ? $option['id'] : "";
    1384             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1385             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1386 
    1387             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1388             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1389             $value     = isset($option['value']) ? $option['value'] : '';
    1390             $default     = isset($option['default']) ? $option['default'] : '';
    1391             $value = !empty($value) ? $value : $default;
    1392 
    1393             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1394             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1395 
    1396             $title            = isset($option['title']) ? $option['title'] : "";
    1397             $details         = isset($option['details']) ? $option['details'] : "";
    1398 
    1399             $settings = wp_enqueue_code_editor(array('type' => 'text/css'));
    1400             $code_editor = wp_json_encode($settings);
    1401 
    1402             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1403         ?>
    1404 
    1405             <?php
    1406 
    1407             ob_start();
    1408             ?>
    1409             <textarea name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
    1410             <script>
    1411                 jQuery(document).ready(function($) {
    1412 
    1413                     wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
    1414 
    1415 
    1416                 })
    1417             </script>
    1418         <?php
    1419 
    1420             $input_html = ob_get_clean();
    1421 
    1422             echo sprintf($field_template, $title, $input_html, $details);
    1423         }
    1424 
    1425 
    1426 
    1427 
    1428 
    1429         public function field_checkbox($option)
    1430         {
    1431 
    1432             $id                = isset($option['id']) ? $option['id'] : "";
    1433             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1434             $title            = isset($option['title']) ? $option['title'] : "";
    1435             $details         = isset($option['details']) ? $option['details'] : "";
    1436             $for         = isset($option['for']) ? $option['for'] : "";
    1437             $args            = isset($option['args']) ? $option['args'] : array();
    1438 
    1439             $style            = isset($option['style']) ? $option['style'] : array();
    1440             $style_inline            = isset($style['inline']) ? $style['inline'] : true;
    1441 
    1442 
    1443             $option_value     = isset($option['value']) ? $option['value'] : '';
    1444             $default     = isset($option['default']) ? $option['default'] : '';
    1445             $option_value = !empty($option_value) ? $option_value : $default;
    1446 
    1447             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1448 
    1449 
    1450 
    1451         ?>
    1452             <div class="setting-field">
    1453                 <div class="field-lable"><?php if (!empty($title)) echo $title;  ?></div>
    1454                 <div class="field-input">
    1455                     <?php
    1456 
    1457 
    1458 
    1459                     if (!empty($args))
    1460                         foreach ($args as $key => $value):
    1461 
    1462 
    1463                             //$checked = ( $key == $option_value ) ? "checked" : "";
    1464                             $checked = in_array($key, $option_value) ? "checked" : "";
    1465 
    1466                             $for = !empty($for) ? $for . '-' . $id . "-" . $key : $id . "-" . $key;
    1467 
    1468 
    1469                     ?>
    1470                         <label for='<?php echo $for; ?>'><input name='<?php echo $field_name; ?>[]' type='checkbox' id='<?php echo $for; ?>' value='<?php echo $key; ?>' <?php echo $checked; ?>><span><?php echo $value; ?></span></label>
    1471 
    1472                         <?php
    1473 
    1474                             if (!$style_inline) {
    1475                         ?>
    1476                             <br>
    1477                     <?php
    1478                             }
    1479 
    1480                         endforeach;
    1481 
    1482                     ?>
    1483                     <p class="description"><?php if (!empty($details)) echo $details;  ?></p>
    1484                 </div>
    1485             </div>
    1486             <?php
    1487 
    1488 
    1489         }
    1490 
    1491 
    1492 
    1493         public function field_radio($option)
    1494         {
    1495 
    1496             $id                = isset($option['id']) ? $option['id'] : "";
    1497             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1498             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1499             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1500             $title            = isset($option['title']) ? $option['title'] : "";
    1501             $details         = isset($option['details']) ? $option['details'] : "";
    1502             $for         = isset($option['for']) ? $option['for'] : "";
    1503             $args            = isset($option['args']) ? $option['args'] : array();
    1504 
    1505             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1506             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1507 
    1508             $option_value     = isset($option['value']) ? $option['value'] : '';
    1509             $default     = isset($option['default']) ? $option['default'] : '';
    1510             $option_value = !empty($option_value) ? $option_value : $default;
    1511 
    1512             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1513 
    1514 
    1515             ob_start();
    1516 
    1517             if (!empty($args))
    1518                 foreach ($args as $key => $value):
    1519                     $checked = ($key == $option_value) ? "checked" : "";
    1520                     $for = !empty($for) ? $for . '-' . $css_id . "-" . $key : $css_id . "-" . $key;
    1521             ?>
    1522                 <label for="<?php echo $for; ?>"><input name="<?php echo $field_name; ?>" type="radio" id="<?php echo $for; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?>><span><?php echo $value; ?></span></label>
    1523 
    1524             <?php
    1525                 endforeach;
    1526 
    1527             $input_html = ob_get_clean();
    1528 
    1529             echo sprintf($field_template, $title, $input_html, $details);
    1530         }
    1531 
    1532 
    1533 
    1534         public function field_radio_image($option)
    1535         {
    1536 
    1537             $id                = isset($option['id']) ? $option['id'] : "";
    1538             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1539             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1540             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1541             $args            = isset($option['args']) ? $option['args'] : array();
    1542             //$args         = is_array( $args ) ? $args : $this->generate_args_from_string( $args );
    1543             $option_value     = isset($option['value']) ? $option['value'] : '';
    1544             $default     = isset($option['default']) ? $option['default'] : '';
    1545             $lazy_load_img     = isset($option['lazy_load_img']) ? $option['lazy_load_img'] : '';
    1546 
    1547             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1548             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1549 
    1550             $title            = isset($option['title']) ? $option['title'] : "";
    1551             $details             = isset($option['details']) ? $option['details'] : "";
    1552             $width             = isset($option['width']) ? $option['width'] : "250px";
    1553 
    1554             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1555 
    1556             //var_dump($option_value);
    1557 
    1558             $option_value = empty($option_value) ? $default : $option_value;
    1559 
    1560 
    1561 
    1562             ob_start();
    1563             ?>
    1564             <div class="radio-img">
    1565                 <?php
    1566                 foreach ($args as $key => $value):
    1567 
    1568                     $name = $value['name'];
    1569                     $thumb = $value['thumb'];
    1570                     $disabled = isset($value['disabled']) ? $value['disabled'] : '';
    1571                     $pro_msg = isset($value['pro_msg']) ? $value['pro_msg'] : '';
    1572                     $link = isset($value['link']) ? $value['link'] : '';
    1573                     $link_text = isset($value['link_text']) ? $value['link_text'] : 'Go';
    1574 
    1575                     $checked = ($key == $option_value) ? "checked" : "";
    1576 
    1577                     //var_dump($checked);
    1578 
    1579                 ?>
    1580                     <label style="width: <?php echo $width; ?>;" title="<?php echo $name; ?>" class="<?php if ($checked == 'checked') echo 'active'; ?> <?php if ($disabled == true) echo 'disabled'; ?>">
    1581                         <input <?php if ($disabled) echo 'disabled'; ?> name="<?php echo $field_name; ?>" type="radio" id="<?php echo $css_id; ?>-<?php echo $key; ?>" value="<?php echo $key; ?>" <?php echo $checked; ?>>
    1582 
    1583                         <?php
    1584                         if (!empty($thumb)):
    1585 
    1586                         ?>
    1587                             <img class="lazy" alt="<?php echo $name; ?>" data-src="<?php echo $thumb; ?>" src="<?php echo $lazy_load_img; ?>">
    1588                             <div style="padding: 5px;" class="name"><?php echo $name; ?></div>
    1589 
    1590                         <?php
    1591                         else:
    1592                             echo $name;
    1593                         endif;
    1594                         ?>
    1595 
    1596                         <?php if ($disabled == true): ?>
    1597                             <span class="pro-msg"><?php echo $pro_msg; ?></span>
    1598                         <?php endif; ?>
    1599                         <?php if (!empty($link)): ?>
    1600                             <a target="_blank" class="link" href="<?php echo $link; ?>"><?php echo $link_text; ?></a>
    1601                         <?php endif; ?>
    1602 
    1603                     </label>
    1604                 <?php
    1605 
    1606                 endforeach;
    1607                 ?>
    1608             </div>
    1609 
    1610             <style>
    1611                 .radio-img {}
    1612 
    1613                 .radio-img label {
    1614                     display: inline-block;
    1615                     vertical-align: top;
    1616                     margin: 5px;
    1617                     padding: 2px;
    1618                     background: #eee;
    1619                     position: relative;
    1620                 }
    1621 
    1622                 .radio-img label.active {
    1623                     background: #fd730d;
    1624                 }
    1625 
    1626                 .radio-img label.disabled {
    1627                     background: #e2e2e2;
    1628 
    1629                 }
    1630 
    1631                 .radio-img label.disabled img {
    1632                     background: #e2e2e2;
    1633                     opacity: .3;
    1634                 }
    1635 
    1636                 .radio-img label.disabled .pro-msg {
    1637                     background: #ffd87f;
    1638                     position: absolute;
    1639                     top: 50%;
    1640                     left: 50%;
    1641                     transform: translate(-50%, -50%);
    1642                     padding: 0 10px;
    1643 
    1644                 }
    1645 
    1646                 .radio-img label .link {
    1647                     background: hsl(200, 7%, 42%);
    1648                     position: absolute;
    1649                     top: 2px;
    1650                     /* transform: translate(0%,-50%); */
    1651                     padding: 3px 14px;
    1652                     text-decoration: none;
    1653                     font-size: 14px;
    1654                     color: #fff;
    1655                     right: 2px;
    1656 
    1657                 }
    1658 
    1659 
    1660                 .radio-img input[type=radio] {
    1661                     display: none;
    1662                 }
    1663 
    1664                 .radio-img img {
    1665 
    1666                     vertical-align: top;
    1667                     width: 100%;
    1668                 }
    1669             </style>
    1670         <?php
    1671 
    1672             $input_html = ob_get_clean();
    1673 
    1674             echo sprintf($field_template, $title, $input_html, $details);
    1675         }
    1676 
    1677         public function field_datepicker($option)
    1678         {
    1679 
    1680             $id             = isset($option['id']) ? $option['id'] : "";
    1681             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1682             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1683             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1684             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1685             $format     = isset($option['format']) ? $option['format'] : "";
    1686 
    1687             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1688             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1689 
    1690             $value     = isset($option['value']) ? $option['value'] : '';
    1691             $default     = isset($option['default']) ? $option['default'] : '';
    1692             $value = !empty($value) ? $value : $default;
    1693 
    1694             $title            = isset($option['title']) ? $option['title'] : "";
    1695             $details             = isset($option['details']) ? $option['details'] : "";
    1696 
    1697             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1698 
    1699 
    1700             wp_enqueue_script('jquery-ui-datepicker');
    1701             wp_enqueue_style('jquery-ui');
    1702 
    1703             ob_start();
    1704         ?>
    1705             <input type="text" autocomplete="off" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo $value; ?>" />
    1706             <script>
    1707                 jQuery(document).ready(function($) {
    1708                     $("#<?php echo $css_id; ?>").datepicker({
    1709                         dateFormat: "<?php echo $format; ?>"
    1710                     });
    1711                 });
    1712             </script>
    1713         <?php
    1714 
    1715             $input_html = ob_get_clean();
    1716 
    1717             echo sprintf($field_template, $title, $input_html, $details);
    1718         }
    1719 
    1720 
    1721 
    1722         public function field_colorpicker($option)
    1723         {
    1724 
    1725             $id             = isset($option['id']) ? $option['id'] : "";
    1726             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1727             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1728             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1729             $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
    1730 
    1731             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1732             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1733 
    1734             $value     = isset($option['value']) ? $option['value'] : '';
    1735             $default     = isset($option['default']) ? $option['default'] : '';
    1736             $value = !empty($value) ? $value : $default;
    1737 
    1738             $title            = isset($option['title']) ? $option['title'] : "";
    1739             $details             = isset($option['details']) ? $option['details'] : "";
    1740 
    1741             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1742 
    1743             ob_start();
    1744         ?>
    1745             <input colorPicker="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
    1746             <?php
    1747 
    1748             $input_html = ob_get_clean();
    1749 
    1750             echo sprintf($field_template, $title, $input_html, $details);
    1751         }
    1752 
    1753 
    1754         public function field_colorpicker_multi($option)
    1755         {
    1756 
    1757             $id             = isset($option['id']) ? $option['id'] : "";
    1758             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1759             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1760             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1761             $args     = isset($option['args']) ? $option['args'] : "";
    1762 
    1763 
    1764             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1765             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1766 
    1767             $value     = isset($option['value']) ? $option['value'] : '';
    1768             $default     = isset($option['default']) ? $option['default'] : '';
    1769             $value = !empty($value) ? $value : $default;
    1770 
    1771             $title            = isset($option['title']) ? $option['title'] : "";
    1772             $details             = isset($option['details']) ? $option['details'] : "";
    1773 
    1774             $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
    1775 
    1776 
    1777 
    1778             //echo '<pre>'.var_export($args, true).'</pre>';
    1779 
    1780             ob_start();
    1781 
    1782             if (!empty($args)):
    1783 
    1784                 foreach ($args as $arg_key => $arg):
    1785 
    1786                     $item_value = isset($value[$arg_key]) ? $value[$arg_key] : $arg;
    1787 
    1788 
    1789             ?>
    1790                     <div class="">
    1791                         <span><?php echo $arg_key; ?></span>
    1792                         <input name="<?php echo $field_name; ?>[<?php echo $arg_key; ?>]" id="<?php echo $arg_key . '-' . $css_id; ?>" value="<?php echo $item_value; ?>" />
    1793                         <script>
    1794                             jQuery(document).ready(function($) {
    1795                                 $("#<?php echo $arg_key . '-' . $css_id; ?>").wpColorPicker();
    1796                             });
    1797                         </script>
    1798                     </div>
    1799 
     1160      </div>
     1161    <?php
     1162      $input_html = ob_get_clean();
     1163      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1164    }
     1165    public function field_datepicker($option)
     1166    {
     1167      $id             = isset($option['id']) ? $option['id'] : "";
     1168      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1169      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1170      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1171      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     1172      $format     = isset($option['format']) ? $option['format'] : "";
     1173      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1174      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1175      $value     = isset($option['value']) ? $option['value'] : '';
     1176      $default     = isset($option['default']) ? $option['default'] : '';
     1177      $value = !empty($value) ? $value : $default;
     1178      $title            = isset($option['title']) ? $option['title'] : "";
     1179      $details             = isset($option['details']) ? $option['details'] : "";
     1180      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1181
     1182      ob_start();
     1183    ?>
     1184      <input type="text" autocomplete="off" name="<?php echo esc_attr($field_name); ?>" class="datepicker" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" format="<?php echo esc_attr($format); ?>" />
     1185
     1186    <?php
     1187      $input_html = ob_get_clean();
     1188      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1189    }
     1190    public function field_colorpicker($option)
     1191    {
     1192      $id             = isset($option['id']) ? $option['id'] : "";
     1193      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1194      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1195      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1196      $placeholder     = isset($option['placeholder']) ? $option['placeholder'] : "";
     1197      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1198      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1199      $value     = isset($option['value']) ? $option['value'] : '';
     1200      $default     = isset($option['default']) ? $option['default'] : '';
     1201      $value = !empty($value) ? $value : $default;
     1202      $title            = isset($option['title']) ? $option['title'] : "";
     1203      $details             = isset($option['details']) ? $option['details'] : "";
     1204      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1205      ob_start();
     1206    ?>
     1207      <input colorPicker="" name="<?php echo esc_attr($field_name); ?>" id="<?php echo esc_attr($css_id); ?>" placeholder="<?php echo esc_attr(esc_attr($placeholder)); ?>" value="<?php echo esc_attr($value); ?>" />
     1208      <?php
     1209      $input_html = ob_get_clean();
     1210      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1211    }
     1212    public function field_colorpicker_multi($option)
     1213    {
     1214      $id             = isset($option['id']) ? $option['id'] : "";
     1215      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1216      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1217      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1218      $args     = isset($option['args']) ? $option['args'] : "";
     1219      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1220      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1221      $value     = isset($option['value']) ? $option['value'] : '';
     1222      $default     = isset($option['default']) ? $option['default'] : '';
     1223      $value = !empty($value) ? $value : $default;
     1224      $title            = isset($option['title']) ? $option['title'] : "";
     1225      $details             = isset($option['details']) ? $option['details'] : "";
     1226      $field_name = !empty($parent) ? $parent . '[' . $id . ']' : $id;
     1227      ob_start();
     1228      if (!empty($args)) :
     1229        foreach ($args as $arg_key => $arg) :
     1230          $item_value = isset($value[$arg_key]) ? $value[$arg_key] : $arg;
     1231      ?>
     1232          <div class="">
     1233            <span><?php echo esc_html($arg_key); ?></span>
     1234            <input name="<?php echo esc_attr($field_name); ?>[<?php echo esc_attr($arg_key); ?>]" id="<?php echo esc_attr($arg_key . '-' . $css_id); ?>" class="color-picker" value="<?php echo esc_attr($item_value); ?>" />
     1235
     1236          </div>
    18001237<?php
    1801                 endforeach;
    1802 
    1803             endif;
    1804 
    1805 
    1806             $input_html = ob_get_clean();
    1807 
    1808             echo sprintf($field_template, $title, $input_html, $details);
    1809         }
    1810 
    1811 
    1812 
    1813         public function field_custom_html($option)
    1814         {
    1815 
    1816             $id             = isset($option['id']) ? $option['id'] : "";
    1817             $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
    1818             $parent             = isset($option['parent']) ? $option['parent'] : "";
    1819             $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
    1820             $html     = isset($option['html']) ? $option['html'] : "";
    1821 
    1822             $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
    1823             $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
    1824 
    1825             $title            = isset($option['title']) ? $option['title'] : "";
    1826             $details             = isset($option['details']) ? $option['details'] : "";
    1827 
    1828 
    1829             echo sprintf($field_template, $title, $html, $details);
    1830         }
    1831     }
     1238        endforeach;
     1239      endif;
     1240      $input_html = ob_get_clean();
     1241      echo wp_kses(sprintf($field_template, esc_html($title), $input_html, wp_kses_post($details)), $this->allowed_html());
     1242    }
     1243    public function field_custom_html($option)
     1244    {
     1245      $id             = isset($option['id']) ? $option['id'] : "";
     1246      $css_id             = isset($option['css_id']) ? $option['css_id'] : $id;
     1247      $parent             = isset($option['parent']) ? $option['parent'] : "";
     1248      $field_template     = isset($option['field_template']) ? $option['field_template'] : $this->field_template($option);
     1249      $html     = isset($option['html']) ? $option['html'] : "";
     1250      $is_pro     = isset($option['is_pro']) ? $option['is_pro'] : false;
     1251      $pro_text     = isset($option['pro_text']) ? $option['pro_text'] : '';
     1252      $title            = isset($option['title']) ? $option['title'] : "";
     1253      $details             = isset($option['details']) ? $option['details'] : "";
     1254      echo wp_kses(sprintf($field_template, esc_html($title), $html, wp_kses_post($details)), $this->allowed_html());
     1255    }
     1256  }
    18321257}
  • related-post/trunk/includes/functions-settings.php

    r3402168 r3415975  
    1414        //delete_option('related_post_settings');
    1515
    16         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     16        $settings_tabs_field = new settings_tabs_field();
    1717
    1818        $related_post_settings = get_option('related_post_settings');
     
    177177                            );
    178178
    179                             $pickp_settings_tabs_field->generate_field($args);
     179                            $settings_tabs_field->generate_field($args);
    180180
    181181
     
    193193                            );
    194194
    195                             $pickp_settings_tabs_field->generate_field($args);
     195                            $settings_tabs_field->generate_field($args);
    196196
    197197                            $args = array(
     
    208208                            );
    209209
    210                             $pickp_settings_tabs_field->generate_field($args);
     210                            $settings_tabs_field->generate_field($args);
    211211
    212212
     
    224224                            );
    225225
    226                             $pickp_settings_tabs_field->generate_field($args);
     226                            $settings_tabs_field->generate_field($args);
    227227
    228228
     
    241241                            );
    242242
    243                             $pickp_settings_tabs_field->generate_field($args);
     243                            $settings_tabs_field->generate_field($args);
    244244
    245245
     
    257257                            );
    258258
    259                             $pickp_settings_tabs_field->generate_field($args);
     259                            $settings_tabs_field->generate_field($args);
    260260
    261261
     
    275275                            );
    276276
    277                             $pickp_settings_tabs_field->generate_field($args);
     277                            $settings_tabs_field->generate_field($args);
    278278
    279279
     
    289289                            );
    290290
    291                             $pickp_settings_tabs_field->generate_field($args);
     291                            $settings_tabs_field->generate_field($args);
    292292
    293293
     
    304304                            );
    305305
    306                             $pickp_settings_tabs_field->generate_field($args);
     306                            $settings_tabs_field->generate_field($args);
    307307
    308308
     
    320320                            );
    321321
    322                             $pickp_settings_tabs_field->generate_field($args);
     322                            $settings_tabs_field->generate_field($args);
    323323
    324324
     
    340340                                );
    341341
    342                                 $pickp_settings_tabs_field->generate_field($args);
     342                                $settings_tabs_field->generate_field($args);
    343343                            }
    344344
     
    381381            );
    382382
    383             $pickp_settings_tabs_field->generate_field($args);
     383            $settings_tabs_field->generate_field($args);
    384384
    385385
     
    441441            );
    442442
    443             $pickp_settings_tabs_field->generate_field($args);
     443            $settings_tabs_field->generate_field($args);
    444444
    445445
     
    462462    {
    463463
    464         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     464        $settings_tabs_field = new settings_tabs_field();
    465465
    466466        $related_post_settings = get_option('related_post_settings');
     
    496496            );
    497497
    498             $pickp_settings_tabs_field->generate_field($args);
     498            $settings_tabs_field->generate_field($args);
    499499
    500500
     
    542542            );
    543543
    544             $pickp_settings_tabs_field->generate_field($args);
     544            $settings_tabs_field->generate_field($args);
    545545
    546546
     
    563563            );
    564564
    565             $pickp_settings_tabs_field->generate_field($args);
     565            $settings_tabs_field->generate_field($args);
    566566
    567567            $args = array(
     
    576576            );
    577577
    578             $pickp_settings_tabs_field->generate_field($args);
     578            $settings_tabs_field->generate_field($args);
    579579
    580580            $args = array(
     
    589589            );
    590590
    591             $pickp_settings_tabs_field->generate_field($args);
     591            $settings_tabs_field->generate_field($args);
    592592
    593593            $args = array(
     
    602602            );
    603603
    604             $pickp_settings_tabs_field->generate_field($args);
     604            $settings_tabs_field->generate_field($args);
    605605
    606606
     
    622622    {
    623623
    624         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     624        $settings_tabs_field = new settings_tabs_field();
    625625
    626626        $related_post_settings = get_option('related_post_settings');
     
    663663            );
    664664
    665             $pickp_settings_tabs_field->generate_field($args);
     665            $settings_tabs_field->generate_field($args);
    666666
    667667            $args = array(
     
    676676            );
    677677
    678             $pickp_settings_tabs_field->generate_field($args);
     678            $settings_tabs_field->generate_field($args);
    679679
    680680
     
    690690            );
    691691
    692             $pickp_settings_tabs_field->generate_field($args);
     692            $settings_tabs_field->generate_field($args);
    693693
    694694
     
    716716    {
    717717
    718         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     718        $settings_tabs_field = new settings_tabs_field();
    719719
    720720        $related_post_settings = get_option('related_post_settings');
     
    10951095            );
    10961096
    1097             $pickp_settings_tabs_field->generate_field($args);
     1097            $settings_tabs_field->generate_field($args);
    10981098
    10991099
     
    11201120    {
    11211121
    1122         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     1122        $settings_tabs_field = new settings_tabs_field();
    11231123
    11241124        $related_post_settings = get_option('related_post_settings');
     
    11921192            );
    11931193
    1194             $pickp_settings_tabs_field->generate_field($args);
     1194            $settings_tabs_field->generate_field($args);
    11951195
    11961196
     
    12081208            );
    12091209
    1210             $pickp_settings_tabs_field->generate_field($args);
     1210            $settings_tabs_field->generate_field($args);
    12111211
    12121212            $args = array(
     
    12211221            );
    12221222
    1223             $pickp_settings_tabs_field->generate_field($args);
     1223            $settings_tabs_field->generate_field($args);
    12241224
    12251225
     
    12361236            );
    12371237
    1238             $pickp_settings_tabs_field->generate_field($args);
     1238            $settings_tabs_field->generate_field($args);
    12391239
    12401240            $args = array(
     
    12491249            );
    12501250
    1251             $pickp_settings_tabs_field->generate_field($args);
     1251            $settings_tabs_field->generate_field($args);
    12521252
    12531253            $args = array(
     
    12621262            );
    12631263
    1264             $pickp_settings_tabs_field->generate_field($args);
     1264            $settings_tabs_field->generate_field($args);
    12651265
    12661266
     
    12771277            );
    12781278
    1279             $pickp_settings_tabs_field->generate_field($args);
     1279            $settings_tabs_field->generate_field($args);
    12801280
    12811281            $args = array(
     
    12901290            );
    12911291
    1292             $pickp_settings_tabs_field->generate_field($args);
     1292            $settings_tabs_field->generate_field($args);
    12931293
    12941294
     
    13061306            );
    13071307
    1308             $pickp_settings_tabs_field->generate_field($args);
     1308            $settings_tabs_field->generate_field($args);
    13091309
    13101310            $args = array(
     
    13191319            );
    13201320
    1321             $pickp_settings_tabs_field->generate_field($args);
     1321            $settings_tabs_field->generate_field($args);
    13221322
    13231323
     
    13341334            );
    13351335
    1336             $pickp_settings_tabs_field->generate_field($args);
     1336            $settings_tabs_field->generate_field($args);
    13371337
    13381338
     
    13481348            );
    13491349
    1350             $pickp_settings_tabs_field->generate_field($args);
     1350            $settings_tabs_field->generate_field($args);
    13511351
    13521352            $args = array(
     
    13611361            );
    13621362
    1363             $pickp_settings_tabs_field->generate_field($args);
     1363            $settings_tabs_field->generate_field($args);
    13641364
    13651365
     
    13821382    {
    13831383
    1384         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     1384        $settings_tabs_field = new settings_tabs_field();
    13851385
    13861386        $related_post_settings = get_option('related_post_settings');
     
    14111411            );
    14121412
    1413             $pickp_settings_tabs_field->generate_field($args);
     1413            $settings_tabs_field->generate_field($args);
    14141414
    14151415
     
    14651465            );
    14661466
    1467             $pickp_settings_tabs_field->generate_field($args);
     1467            $settings_tabs_field->generate_field($args);
    14681468
    14691469
     
    15391539    function related_post_settings_content_scripts($tab)
    15401540    {
    1541         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     1541        $settings_tabs_field = new settings_tabs_field();
    15421542
    15431543        $related_post_settings = get_option('related_post_settings');
     
    15681568            );
    15691569
    1570             $pickp_settings_tabs_field->generate_field($args);
     1570            $settings_tabs_field->generate_field($args);
    15711571
    15721572
     
    15821582            );
    15831583
    1584             $pickp_settings_tabs_field->generate_field($args);
     1584            $settings_tabs_field->generate_field($args);
    15851585
    15861586
     
    16021602    {
    16031603
    1604         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     1604        $settings_tabs_field = new settings_tabs_field();
    16051605
    16061606    ?>
     
    16371637            );
    16381638
    1639             $pickp_settings_tabs_field->generate_field($args);
     1639            $settings_tabs_field->generate_field($args);
    16401640
    16411641
     
    16821682            );
    16831683
    1684             $pickp_settings_tabs_field->generate_field($args);
     1684            $settings_tabs_field->generate_field($args);
    16851685
    16861686
     
    17071707            );
    17081708
    1709             $pickp_settings_tabs_field->generate_field($args);
     1709            $settings_tabs_field->generate_field($args);
    17101710
    17111711            ?>
     
    17271727    {
    17281728
    1729         $pickp_settings_tabs_field = new pickp_settings_tabs_field();
     1729        $settings_tabs_field = new settings_tabs_field();
    17301730
    17311731
     
    19551955            );
    19561956
    1957             $pickp_settings_tabs_field->generate_field($args);
     1957            $settings_tabs_field->generate_field($args);
    19581958
    19591959
  • related-post/trunk/includes/menu/settings.php

    r3402168 r3415975  
    8989
    9090
    91 $pickp_settings_tabs_field = new pickp_settings_tabs_field();
    92 $pickp_settings_tabs_field->admin_scripts();
     91$settings_tabs_field = new settings_tabs_field();
     92$settings_tabs_field->admin_scripts();
    9393
    9494
  • related-post/trunk/readme.txt

    r3402168 r3415975  
    44    Tags: related post, related posts, related content, inline related post,  similar posts
    55    Requires at least: 3.8
    6     Tested up to: 6.8
    7     Stable tag: 2.0.64
     6    Tested up to: 6.9
     7    Stable tag: 2.0.65
    88    License: GPLv2 or later
    99    License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    135135
    136136== Changelog ==
     137
     138    = 2.0.65 =
     139    * 2025-12-05 fix - Latest WP compatibility issue check.
    137140
    138141    = 2.0.64 =
  • related-post/trunk/related-post.php

    r3402168 r3415975  
    11<?php
    22/*
    3 Plugin Name: Related Post by PickPlugins
     3Plugin Name: Related Posts By PickPlugins
    44Plugin URI: http://wordpress.org/plugins/related-post/
    55Description: Display related posts under post content on single page and excerpt on archive pages.
    6 Version: 2.0.64
     6Version: 2.0.65
    77Author: PickPlugins
    88Author URI: http://pickplugins.com
Note: See TracChangeset for help on using the changeset viewer.