Plugin Directory

Changeset 3821169


Ignore:
Timestamp:
11/24/2026 06:00:27 PM (less than one hour ago)
Author:
Rustaurius
Message:

v2.7.0 released and tagged

Location:
ultimate-faqs
Files:
2 added
128 deleted
56 edited
1 copied

Legend:

Unmodified
Added
Removed
  • ultimate-faqs/tags/2.7.0/assets/css/ewd-ufaq-admin.css

    r3744649 r3821169  
    1 .ewd-ufaq-clear {
     1
     2.ewd-ufaq-clear{
    23        clear: both;
    3 }
    4 .ewd-ufaq-item {
    5         cursor: move;
    64}
    75
    86.ufaq_page_ewd-ufaq-dashboard,
    97.ufaq_page_ewd-ufaq-settings,
    10 .post-type-ufaq,
    11 .ufaq_page_ewd-ufaq-ordering-table {
     8.post-type-ufaq{
    129        background: #fff;
    1310}
     11
    1412.ufaq_page_ewd-ufaq-settings .wrap,
    15 .post-type-ufaq .wrap,
    16 .ufaq_page_ewd-ufaq-ordering-table .wrap {
     13.post-type-ufaq .wrap{
    1714        margin: 10px 0 0 -20px;
    1815        box-sizing: border-box;
    1916}
     17
    2018.ufaq_page_ewd-ufaq-settings .wrap *,
    21 .post-type-ufaq .wrap *,
    22 .ufaq_page_ewd-ufaq-ordering-table .wrap * {
     19.post-type-ufaq .wrap *{
    2320        box-sizing: border-box;
    2421}
    2522
    26 
    27 /* BANNER */
    28 
    29 .ewd-ufaq-dashboard-new-upgrade-banner {
     23.ewd-ufaq-dashboard-new-upgrade-banner{
    3024        position: relative;
    3125        display: flex;
    … …  
    3630        box-sizing: border-box;
    3731}
    38 .ewd-ufaq-dashboard-new-upgrade-banner * {
     32
     33.ewd-ufaq-dashboard-new-upgrade-banner *{
    3934        box-sizing: border-box;
    4035}
    41 .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     36
     37.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    4238        position: absolute;
    4339        height: 112px;
    … …  
    4844        background-size: 112px 112px;
    4945}
    50 .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     46
     47.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    5148        position: absolute;
    5249        height: 112px;
    … …  
    5552        top: 84px;
    5653}
    57 .ewd-ufaq-dashboard-new-upgrade-button {
     54
     55.ewd-ufaq-dashboard-new-upgrade-button{
    5856        display: flex;
    5957        justify-content: center;
    … …  
    7270        transition: background .25s, color .25s, border-color .25s;
    7371}
    74 .ewd-ufaq-dashboard-new-upgrade-button:hover {
     72
     73.ewd-ufaq-dashboard-new-upgrade-button:hover{
    7574        background: #915add;
    7675        border-color: #915add;
    7776        color: #fff;
    7877}
    79 .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button  {
     78
     79.ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button{
    8080        background-color: transparent;
    8181        border: 1px solid #0acbaa;
    8282        color: #0acbaa;
    8383}
    84 .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button:hover  {
     84
     85.ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button:hover{
    8586        background-color: #0acbaa;
    8687        border-color: #0acbaa;
    8788        color: #fff;
    8889}
    89 .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     90
     91.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    9092        position: absolute;
    9193        display: flex;
    … …  
    9799        color: #fff;
    98100}
    99 .ewd-ufaq-dashboard-banner-title {
     101
     102.ewd-ufaq-dashboard-banner-title{
    100103        font-size: 29px;
    101104        line-height: 32px;
    102105        font-weight: bold;
    103106}
    104 .ewd-ufaq-dashboard-banner-brief {
     107
     108.ewd-ufaq-dashboard-banner-brief{
    105109        margin-top: 14px;
    106110        font-size: 14px;
    107111}
    108112
     113
    109114@media screen and (min-width: 1700px) {
    110         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     115.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    111116                left: 272px;
    112117        }
    113         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     118
     119.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    114120                right: 228px;
    115121        }
    116         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     122
     123.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    117124                width: calc(100% - 880px);
    118125                left: 420px;
    119         }
    120 }
     126        }}
     127
    121128@media screen and (max-width: 1200px) {
    122         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     129.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    123130                left: 54px;
    124131        }
    125         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     132
     133.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    126134                right: 32px;
    127135        }
    128         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     136
     137.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    129138                width: calc(100% - 466px);
    130139                left: 202px;
    131         }
    132 }
     140        }}
     141
    133142@media screen and (max-width: 800px) {
    134         .ewd-ufaq-dashboard-new-upgrade-banner {
     143.ewd-ufaq-dashboard-new-upgrade-banner{
    135144                height: 512px;
    136145                height: 300px;
    137146        }
    138         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     147
     148.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    139149                left: calc(50% - 56px);
    140150                top: 48px;
    141151                display: none;
    142152        }
    143         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     153
     154.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    144155                width: 80%;
    145156                left: 10%;
    … …  
    150161                top: 42px;
    151162        }
    152         .ewd-ufaq-dashboard-banner-brief {
     163
     164.ewd-ufaq-dashboard-banner-brief{
    153165                display: none;
    154         } 
    155         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     166        }
     167
     168.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    156169                right: calc(50% - 96px);
    157170                top: 368px;
    158171                top: 172px;
    159         }
    160 }
    161 
    162 
    163 /* MENU */
    164 
    165 .ewd-ufaq-admin-header-menu {
     172        }}
     173
     174.ewd-ufaq-admin-header-menu{
    166175        margin: 48px 96px 0 76px;
    167176}
    168 .ewd-ufaq-admin-header-menu .nav-tab-wrapper {
     177
     178.ewd-ufaq-admin-header-menu .nav-tab-wrapper{
    169179        border: 0;
    170180        margin: 0;
    … …  
    174184        border-bottom: 1px solid #e9e9e9;
    175185}
    176 .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab {
     186
     187.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab{
    177188        border: 0;
    178189        margin: 0 28px -1px 0;
    … …  
    183194        font-size: 20px;
    184195}
     196
    185197.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab:nth-of-type(1n+2):hover,
    186 .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab.nav-tab-active {
     198.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab.nav-tab-active{
    187199        color: #7B31AF;
    188200        border-bottom-color: #7B31AF;
    189201}
    190 .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
     202
     203.ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open{
    191204        display: none;
    192205        align-items: center;
    193206}
    194 .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open .dashicons {
     207
     208.ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open .dashicons{
    195209        display: flex;
    196210        justify-content: center;
    … …  
    204218        width: 32px;
    205219}
     220
    206221#ewd-ufaq-dash-mobile-menu-up-caret,
    207 #ewd-ufaq-dash-mobile-menu-down-caret {
     222#ewd-ufaq-dash-mobile-menu-down-caret{
    208223        display: none;
    209224}
    210225
    211226
     227
    212228@media screen and (max-width: 1600px) {
    213         .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab {
     229.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab{
    214230                font-size: 18px;
    215         }
    216 }
     231        }}
     232
    217233@media screen and (max-width: 1024px) {
    218         .ewd-ufaq-admin-header-menu {
     234.ewd-ufaq-admin-header-menu{
    219235                margin: 40px 32px 0 22px;
    220236        }
    221         .ewd-ufaq-admin-header-menu .nav-tab-wrapper {
     237
     238.ewd-ufaq-admin-header-menu .nav-tab-wrapper{
    222239                border-bottom: none;
    223240        }
    224         .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
     241
     242.ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open{
    225243                display: flex;
    226244        }
    227         .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab {
     245
     246.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab{
    228247                font-size: 22px;
    229248        }
    230         .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab:nth-of-type(1) {
     249
     250.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab:nth-of-type(1){
    231251                width: 100%;
    232252                font-size: 28px;
    233253                margin-bottom: 16px;
    234         }
    235 }
    236 
    237 
    238 /* PAGE GLOBALS */
    239 
    240 .post-type-ufaq .wrap,
    241 .ufaq_page_ewd-ufaq-ordering-table .wrap {
     254        }}
     255
     256.post-type-ufaq .wrap{
    242257        padding: 0 96px;
    243258}
    244 .ufaq_page_ewd-ufaq-settings .wrap {
     259
     260.ufaq_page_ewd-ufaq-settings .wrap{
    245261        padding: 0;
    246262}
    247 .wrap h1 {
     263
     264.wrap h1{
    248265        display: inline-block;
    249266        width: 100%;
    … …  
    253270        color: #212427;
    254271}
     272
    255273@media screen and (max-width: 1024px) {
    256         .post-type-ufaq .wrap,
    257         .ufaq_page_ewd-ufaq-ordering-table .wrap {
     274.post-type-ufaq .wrap{
    258275                padding: 0 32px 0 42px;
    259276        }
    260         .ufaq_page_ewd-ufaq-settings .wrap {
     277
     278.ufaq_page_ewd-ufaq-settings .wrap{
    261279                padding: 0;
    262         }
    263 }       
    264 
    265 
    266 /* DASHBOARD */
    267 
    268 #ewd-ufaq-dashboard-content-area {
     280        }}
     281
     282#ewd-ufaq-dashboard-content-area{
    269283        display: flex;
    270284        flex-direction: column;
    … …  
    274288        box-sizing: border-box;
    275289}
    276 #ewd-ufaq-dashboard-content-area * {
     290
     291#ewd-ufaq-dashboard-content-area *{
    277292        box-sizing: border-box;
    278293}
    279294
    280 .ewd-ufaq-dashboard-visit-our-site {
     295.ewd-ufaq-dashboard-visit-our-site{
    281296        display: block;
    282297        text-align: center;
    … …  
    289304        font-size: 16px;
    290305}
     306
    291307.ewd-ufaq-dashboard-visit-our-site a,
    292 .ewd-ufaq-dashboard-visit-our-site a:hover {
     308.ewd-ufaq-dashboard-visit-our-site a:hover{
    293309        color: #fff;
    294310}
    295311
    296 .ewd-ufaq-dashboard-support-widgets {
     312.ewd-ufaq-dashboard-support-widgets{
    297313        display: grid;
    298314        grid-template-columns: repeat(2, 1fr);
    … …  
    301317        margin: 48px 0 0;
    302318}
    303 .ewd-ufaq-dashboard-support-widgets li {
     319
     320.ewd-ufaq-dashboard-support-widgets li{
    304321        display: flex;
    305322        flex-direction: column;
    … …  
    311328        justify-content: space-between;
    312329}
    313 .ewd-ufaq-dashboard-support-widgets-title {
     330
     331.ewd-ufaq-dashboard-support-widgets-title{
    314332        font-size: 16px;
    315333        font-weight: bold;
    316334        color: #212427;
    317335}
    318 .ewd-ufaq-dashboard-support-widgets-text-and-link {
     336
     337.ewd-ufaq-dashboard-support-widgets-text-and-link{
    319338        display: flex;
    320339        justify-content: space-between;
    321340        align-items: center;
    322341}
    323 .ewd-ufaq-dashboard-support-widgets-text {
     342
     343.ewd-ufaq-dashboard-support-widgets-text{
    324344        font-size: 16px;
    325345        color: #5f5f5f;
    326346}
    327 .ewd-ufaq-dashboard-support-widgets-text span {
     347
     348.ewd-ufaq-dashboard-support-widgets-text span{
    328349        margin-right: 12px;
    329350}
    330 .ewd-ufaq-dashboard-support-widgets-link {
     351
     352.ewd-ufaq-dashboard-support-widgets-link{
    331353        display: flex;
    332354        justify-content: center;
    … …  
    344366        transition: background .25s, color .25s, border-color .25s;
    345367}
    346 .ewd-ufaq-dashboard-support-widgets-link:hover {
     368
     369.ewd-ufaq-dashboard-support-widgets-link:hover{
    347370        background: #915add;
    348371        border-color: #915add;
    … …  
    350373}
    351374
    352 .ewd-ufaq-dashboard-catalogs {
     375.ewd-ufaq-dashboard-catalogs{
    353376        display: flex;
    354377        flex-direction: column;
    … …  
    358381        margin: 40px 0 0;
    359382}
    360 .ewd-ufaq-dashboard-catalogs-title {
     383
     384.ewd-ufaq-dashboard-catalogs-title{
    361385        font-size: 16px;
    362386        font-weight: bold;
    … …  
    365389}
    366390
    367 .ewd-ufaq-license-status summary {
     391.ewd-ufaq-license-status summary{
    368392        cursor: pointer;
    369393}
    370 .ewd-ufaq-license-status form {
     394
     395.ewd-ufaq-license-status form{
    371396        margin-top: 16px;
    372397        display: flex;
    … …  
    375400        gap: 12px;
    376401}
    377 .ewd-ufaq-license-status form:first-of-type {
     402
     403.ewd-ufaq-license-status form:first-of-type{
    378404        margin-bottom: 32px;
    379405}
    380 .ewd-ufaq-license-status input[type="text"] {
     406
     407.ewd-ufaq-license-status input[type="text"]{
    381408        min-height: 30px;
    382409        height: 30px;
    … …  
    384411        margin: 0;
    385412}
    386 .ewd-ufaq-license-status input[name="key"], .ewd-ufaq-license-status button[name="ewd_upgrade_to_full"] {
     413
     414.ewd-ufaq-license-status input[name="key"], .ewd-ufaq-license-status button[name="ewd_upgrade_to_full"]{
    387415        height: 40px;
    388416}
    389417
    390 .ewd-ufaq-dashboard-get-premium-and-trial {
    391         display: flex;
    392         flex-direction: column;
    393 }
    394 .ewd-ufaq-dashboard-get-premium-and-trial.trial-happening {
     418.ewd-ufaq-dashboard-get-premium-and-trial{
     419        display: flex;
     420        flex-direction: column;
     421}
     422
     423.ewd-ufaq-dashboard-get-premium-and-trial.trial-happening{
    395424        flex-direction: row;
    396425        justify-content: space-between;
    397426}
    398427
    399 #ewd-ufaq-dashboard-new-footer-one {
     428#ewd-ufaq-dashboard-new-footer-one{
    400429        display: flex;
    401430        flex-direction: column;
    … …  
    406435        background: #7B31AF;
    407436}
    408 .ewd-ufaq-dashboard-new-footer-one-inside {
     437
     438.ewd-ufaq-dashboard-new-footer-one-inside{
    409439        display: flex;
    410440        justify-content: space-between;
    … …  
    412442        width: 100%;
    413443}
    414 .ewd-ufaq-dashboard-new-footer-one-left {
     444
     445.ewd-ufaq-dashboard-new-footer-one-left{
    415446        display: flex;
    416447        flex-direction: column;
    … …  
    418449        margin-bottom: 32px;
    419450}
    420 .ewd-ufaq-dashboard-new-footer-one-title {
     451
     452.ewd-ufaq-dashboard-new-footer-one-title{
    421453        font-size: 16px;
    422454        font-weight: bold;
    … …  
    424456        line-height: 1.2;
    425457}
    426 .ewd-ufaq-dashboard-new-footer-one-benefits {
     458
     459.ewd-ufaq-dashboard-new-footer-one-benefits{
    427460        width: 100%;
    428461        margin-top: 32px;
    … …  
    433466        margin: 40px 0 0;
    434467}
    435 .ewd-ufaq-dashboard-new-footer-one-benefits li {
     468
     469.ewd-ufaq-dashboard-new-footer-one-benefits li{
    436470        margin: 0;
    437471        padding-left: 36px;
    … …  
    444478        color: #fbfbfb
    445479}
    446 .ewd-ufaq-dashboard-new-footer-one-buttons {
     480
     481.ewd-ufaq-dashboard-new-footer-one-buttons{
    447482        display: flex;
    448483        flex-direction: column;
    449484        width: 192px;
    450485}
    451 .ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button {
     486
     487.ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button{
    452488        background: #fff;
    453489        border: 1px solid #fff;
    … …  
    456492        transition: background .25s, color .25s, border-color .25s;
    457493}
    458 .ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button:hover {
     494
     495.ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button:hover{
    459496        background: #ece2f3;
    460497        border-color: #ece2f3;
    461498        color: #212427;
    462499}
    463 .ewd-premium-helper-dashboard-get-premium-widget-button  {
     500
     501.ewd-premium-helper-dashboard-get-premium-widget-button{
    464502        background: transparent !important;
    465503        border: 1px solid #fff !important;
    466504        color: #fff !important;
    467505}
    468 .ewd-premium-helper-dashboard-get-premium-widget-button:hover  {
     506
     507.ewd-premium-helper-dashboard-get-premium-widget-button:hover{
    469508        background: #fff !important;
    470509        border-color: #fff !important;
    471510        color: #212427 !important;
    472511}
    473 .trial-happening #ewd-ufaq-dashboard-new-footer-one {
     512
     513.trial-happening #ewd-ufaq-dashboard-new-footer-one{
    474514        width: calc(70% - 12px);
    475515}
    476 .trial-happening .ewd-ufaq-dashboard-new-footer-one-inside {
    477         flex-direction: column;
    478 }
    479 .trial-happening .ewd-ufaq-dashboard-new-footer-one-left {
     516
     517.trial-happening .ewd-ufaq-dashboard-new-footer-one-inside{
     518        flex-direction: column;
     519}
     520
     521.trial-happening .ewd-ufaq-dashboard-new-footer-one-left{
    480522        width: 100%;
    481523}
    482 .trial-happening .ewd-ufaq-dashboard-new-footer-one-title {
     524
     525.trial-happening .ewd-ufaq-dashboard-new-footer-one-title{
    483526        text-align: center;
    484527}
    485 .trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits {
     528
     529.trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits{
    486530        grid-template-columns: repeat(2, 1fr);
    487531}
    488 .trial-happening .ewd-ufaq-dashboard-new-footer-one-buttons {
     532
     533.trial-happening .ewd-ufaq-dashboard-new-footer-one-buttons{
    489534        width: 100%;
    490535        justify-content: center;
    … …  
    492537}
    493538
    494 .ewd-ufaq-dashboard-trial-container {
     539.ewd-ufaq-dashboard-trial-container{
    495540        display: flex;
    496541        flex-direction: column;
    … …  
    500545        margin: 40px 0 0;
    501546}
    502 .trial-happening .ewd-ufaq-dashboard-trial-container {
     547
     548.trial-happening .ewd-ufaq-dashboard-trial-container{
    503549        width: calc(30% - 12px);
    504550}
    505551
    506 .ewd-ufaq-dashboard-guarantee {
     552.ewd-ufaq-dashboard-guarantee{
    507553        display: flex;
    508554        align-items: center;
    … …  
    512558        color: #5f5f5f;
    513559}
    514 .ewd-ufaq-dashboard-guarantee img {
     560
     561.ewd-ufaq-dashboard-guarantee img{
    515562        width: 128px;
    516563        height: auto;
    517564        margin-right: 32px;
    518565}
    519 .ewd-ufaq-dashboard-guarantee-title-and-text {
    520         display: flex;
    521         flex-direction: column;
    522 }
    523 .ewd-ufaq-dashboard-guarantee-title {
     566
     567.ewd-ufaq-dashboard-guarantee-title-and-text{
     568        display: flex;
     569        flex-direction: column;
     570}
     571
     572.ewd-ufaq-dashboard-guarantee-title{
    524573        font-size: 24px;
    525574        font-weight: bold;
    … …  
    528577        color: #212427
    529578}
    530 .ewd-ufaq-dashboard-guarantee-text {
     579
     580.ewd-ufaq-dashboard-guarantee-text{
    531581        font-size: 14px;
    532582        font-weight: normal;
    533583}
    534  
    535 .ewd-ufaq-dashboard-testimonials-and-other-plugins {
     584
     585.ewd-ufaq-dashboard-testimonials-and-other-plugins{
    536586        display: flex;
    537587        justify-content: space-between;
    538588}
    539589
    540 .ewd-ufaq-dashboard-other-plugins-container {
     590.ewd-ufaq-dashboard-other-plugins-container{
    541591        display: flex;
    542592        flex-direction: column;
    … …  
    548598        background: linear-gradient(91.21deg, rgba(120, 48, 170, 0.5) -9.34%, rgba(255, 255, 255, 0) 34.79%, rgba(251, 250, 252, 0.0105472) 81.09%, rgba(89, 36, 126, 0.5) 133.01%);
    549599}
    550 .ewd-ufaq-dashboard-other-plugins-container-title {
     600
     601.ewd-ufaq-dashboard-other-plugins-container-title{
    551602        font-size: 16px;
    552603        font-weight: bold;
    … …  
    554605        margin-bottom: 8px;
    555606}
    556 .ewd-ufaq-dashboard-other-plugins {
     607
     608.ewd-ufaq-dashboard-other-plugins{
    557609        display: flex;
    558610        flex-direction: column;
    559611        margin: 0;
    560612}
    561 .ewd-ufaq-dashboard-other-plugins li {
     613
     614.ewd-ufaq-dashboard-other-plugins li{
    562615        display: flex;
    563616        margin: 28px 0 0;
    564617}
    565 .ewd-ufaq-dashboard-other-plugins li img {
     618
     619.ewd-ufaq-dashboard-other-plugins li img{
    566620        width: 120px;
    567621        height: 120px;
    568622        margin-right: 20px;
    569623}
    570 .ewd-ufaq-dashboard-other-plugins-text {
    571         display: flex;
    572         flex-direction: column;
    573 }
    574 .ewd-ufaq-dashboard-other-plugins-title {
     624
     625.ewd-ufaq-dashboard-other-plugins-text{
     626        display: flex;
     627        flex-direction: column;
     628}
     629
     630.ewd-ufaq-dashboard-other-plugins-title{
    575631        font-size: 16px;
    576632        font-weight: bold;
    … …  
    578634        color: #212427;
    579635}
    580 .ewd-ufaq-dashboard-other-plugins-blurb {
     636
     637.ewd-ufaq-dashboard-other-plugins-blurb{
    581638        font-size: 14px;
    582639        color: #5f5f5f;
    583640}
    584641
    585 .ewd-ufaq-dashboard-testimonials-container {
     642.ewd-ufaq-dashboard-testimonials-container{
    586643        display: flex;
    587644        flex-direction: column;
    … …  
    593650        background: linear-gradient(91.21deg, rgba(120, 48, 170, 0.5) -9.34%, rgba(255, 255, 255, 0) 34.79%, rgba(251, 250, 252, 0.0105472) 81.09%, rgba(89, 36, 126, 0.5) 133.01%);
    594651}
    595 .ewd-ufaq-dashboard-testimonials-container-title {
     652
     653.ewd-ufaq-dashboard-testimonials-container-title{
    596654        font-size: 16px;
    597655        font-weight: bold;
    … …  
    599657        margin-bottom: 8px;
    600658}
    601 .ewd-ufaq-dashboard-testimonials {
    602         display: flex;
    603         flex-direction: column;
    604 }
    605 .ewd-ufaq-dashboard-testimonials li {
     659
     660.ewd-ufaq-dashboard-testimonials{
     661        display: flex;
     662        flex-direction: column;
     663}
     664
     665.ewd-ufaq-dashboard-testimonials li{
    606666        text-align: center;
    607667}
    608 .ewd-ufaq-dashboard-testimonials li img {
     668
     669.ewd-ufaq-dashboard-testimonials li img{
    609670        width: 140px;
    610671        height: auto;
    611672        margin-top: 8px;
    612673}
    613 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-title {
     674
     675.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-title{
    614676        margin: 28px 0 20px;
    615677        font-size: 30px;
    … …  
    618680        color: #212427;
    619681}
    620 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-author {
     682
     683.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-author{
    621684        font-size: 16px;
    622685        color: #5f5f5f;
    623686}
    624 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text {
     687
     688.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text{
    625689        padding: 24px 10% 0;
    626690        font-size: 14px;
    627691        color: #5f5f5f;
    628692}
    629 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a {
     693
     694.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a{
    630695        color: #0acbaa;
    631696        text-decoration: none;
    632697        font-weight: bold;
    633698}
    634 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a:hover {
     699
     700.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a:hover{
    635701        color: #1CE6C3;
    636702}
     703
    637704 
    638705@media screen and (max-width: 1024px) {
    639         #ewd-ufaq-dashboard-content-area {
     706#ewd-ufaq-dashboard-content-area{
    640707                padding: 0 32px 0 22px;
    641708        }
    642         .ewd-ufaq-dashboard-support-widgets {
     709
     710.ewd-ufaq-dashboard-support-widgets{
    643711                grid-template-columns: repeat(1, 1fr);
    644712        }
    645         .ewd-ufaq-dashboard-get-premium-and-trial.trial-happening {
     713
     714.ewd-ufaq-dashboard-get-premium-and-trial.trial-happening{
    646715                flex-direction: column;
    647716                justify-content: initial;
    648717        }
    649         .trial-happening #ewd-ufaq-dashboard-new-footer-one,
    650         .trial-happening .ewd-ufaq-dashboard-trial-container {
     718
     719.trial-happening #ewd-ufaq-dashboard-new-footer-one,
     720        .trial-happening .ewd-ufaq-dashboard-trial-container{
    651721                width: 100%;
    652722        }
    653         .ewd-ufaq-dashboard-new-footer-one-inside {
     723
     724.ewd-ufaq-dashboard-new-footer-one-inside{
    654725                flex-direction: column;
    655726        }
    656         .ewd-ufaq-dashboard-new-footer-one-left {
     727
     728.ewd-ufaq-dashboard-new-footer-one-left{
    657729                width: 100%;
    658730        }
    659         .ewd-ufaq-dashboard-new-footer-one-title {
     731
     732.ewd-ufaq-dashboard-new-footer-one-title{
    660733                text-align: center;
    661734        }
    662         .ewd-ufaq-dashboard-new-footer-one-benefits {
     735
     736.ewd-ufaq-dashboard-new-footer-one-benefits{
    663737                grid-template-columns: repeat(2, 1fr);
    664738        }
    665         .ewd-ufaq-dashboard-new-footer-one-buttons {
     739
     740.ewd-ufaq-dashboard-new-footer-one-buttons{
    666741                width: 100%;
    667742                justify-content: center;
    668743                margin-top: 32px;
    669744        }
    670         .ewd-ufaq-dashboard-testimonials-and-other-plugins {
     745
     746.ewd-ufaq-dashboard-testimonials-and-other-plugins{
    671747                flex-direction: column;
    672748                justify-content: initial;
    673749        }
    674         .ewd-ufaq-dashboard-other-plugins-container,
    675         .ewd-ufaq-dashboard-testimonials-container {
     750
     751.ewd-ufaq-dashboard-other-plugins-container,
     752        .ewd-ufaq-dashboard-testimonials-container{
    676753                width: 100%;
    677         }
    678 }       
     754        }}
     755       
    679756@media screen and (max-width: 568px) {
    680         .ewd-ufaq-dashboard-new-footer-one-benefits,
    681         .trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits {
     757.ewd-ufaq-dashboard-new-footer-one-benefits,
     758        .trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits{
    682759                grid-template-columns: repeat(1, 1fr);
    683         }
    684 }
    685 
    686 
    687 /* FOOTER */
    688 
    689 #ewd-ufaq-dashboard-new-footer-two {
     760        }}
     761
     762#ewd-ufaq-dashboard-new-footer-two{
    690763        display: flex;
    691764        margin: 40px 0 0 -20px;
    … …  
    695768        box-sizing: border-box;
    696769}
    697 #ewd-ufaq-dashboard-new-footer-two * {
     770
     771#ewd-ufaq-dashboard-new-footer-two *{
    698772        box-sizing: border-box;
    699773}
    700 .ewd-ufaq-dashboard-new-footer-two-inside {
     774
     775.ewd-ufaq-dashboard-new-footer-two-inside{
    701776        display: flex;
    702777        flex-wrap: wrap;
    … …  
    704779        padding: 48px 96px;
    705780}
    706 .ewd-ufaq-dashboard-new-footer-two-icon {
     781
     782.ewd-ufaq-dashboard-new-footer-two-icon{
    707783        width: 110px;
    708784        height: 105px;
    709785        margin-right: 40px;
    710786}
    711 .ewd-ufaq-dashboard-new-footer-two-blurb {
     787
     788.ewd-ufaq-dashboard-new-footer-two-blurb{
    712789        width: 300px;
    713790        line-height: 1.7;
    714791        font-size: 12px;
    715792}
    716 .ewd-ufaq-dashboard-new-footer-two-menu {
     793
     794.ewd-ufaq-dashboard-new-footer-two-menu{
    717795        width: 150px;
    718796        margin: 0;
    … …  
    722800        flex-direction: column;
    723801}
    724 .ewd-ufaq-dashboard-new-footer-two-menu:first-of-type {
     802
     803.ewd-ufaq-dashboard-new-footer-two-menu:first-of-type{
    725804        margin-left: auto;
    726805}
    727 .ewd-ufaq-dashboard-new-footer-two-menu li {
     806
     807.ewd-ufaq-dashboard-new-footer-two-menu li{
    728808        font-weight: bold;
    729809        margin-bottom: 4px;
    … …  
    731811        font-size: 14px;
    732812}
    733 .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
     813
     814.ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type{
    734815        margin-bottom: 9px;
    735816}
    736 .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
     817
     818.ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type{
    737819        margin-bottom: 0;
    738820}
    739 .ewd-ufaq-dashboard-new-footer-two-menu li a {
     821
     822.ewd-ufaq-dashboard-new-footer-two-menu li a{
    740823        font-weight: normal;
    741824        color: #D3DFF5;
    … …  
    743826        font-size: 14px;
    744827}
    745 .ewd-ufaq-dashboard-new-footer-two-menu li a:hover {
     828
     829.ewd-ufaq-dashboard-new-footer-two-menu li a:hover{
    746830        color: #fff;
    747831}
    748832
     833
    749834@media screen and (max-width: 1024px) {
    750         .ewd-ufaq-dashboard-new-footer-two-inside {
     835.ewd-ufaq-dashboard-new-footer-two-inside{
    751836                flex-direction: column;
    752837                flex-wrap: nowrap;
    753838                align-items: center;
    754         }       
    755         .ewd-ufaq-dashboard-new-footer-two-icon {
     839        }
     840
     841.ewd-ufaq-dashboard-new-footer-two-icon{
    756842                margin-right: 0;
    757843        }
    758         .ewd-ufaq-dashboard-new-footer-two-blurb {
     844
     845.ewd-ufaq-dashboard-new-footer-two-blurb{
    759846                display: none;
    760847        }
    761         .ewd-ufaq-dashboard-new-footer-two-menu,
    762         .ewd-ufaq-dashboard-new-footer-two-menu:first-of-type {
     848
     849.ewd-ufaq-dashboard-new-footer-two-menu,
     850        .ewd-ufaq-dashboard-new-footer-two-menu:first-of-type{
    763851                margin: 32px 0 0;
    764852        }
    765         .ewd-ufaq-dashboard-new-footer-two-menu li {
     853
     854.ewd-ufaq-dashboard-new-footer-two-menu li{
    766855                text-align: center;
    767856                margin-bottom: 4px;
    768857                font-size: 14px;
    769858        }
    770         .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
     859
     860.ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type{
    771861                margin-bottom: 9px;
    772862        }
    773         .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
     863
     864.ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type{
    774865                margin-bottom: 0;
    775866        }
    776         .ewd-ufaq-dashboard-new-footer-two-menu li a {
     867
     868.ewd-ufaq-dashboard-new-footer-two-menu li a{
    777869                font-size: 14px;
    778         }
    779 }
    780 
    781 
    782 /* SETTINGS PREVIEW */
    783 
    784 .ewd-ufaq-settings-preview {
     870        }}
     871
     872.ewd-ufaq-settings-preview{
    785873        display: flex;
    786874        flex-direction: column;
    … …  
    788876        padding: 24px 96px 0 96px;
    789877}
    790 .ewd-ufaq-settings-preview h2 {
     878
     879.ewd-ufaq-settings-preview h2{
    791880        display: block !important;
    792881        font-size: 28px !important;
    793882        padding: 0 !important;
    794883}
    795 .ewd-ufaq-settings-preview h2 span {
     884
     885.ewd-ufaq-settings-preview h2 span{
    796886        position: absolute;
    797887        margin-left: 16px;
    … …  
    802892        padding: 2px 8px;
    803893        text-transform: uppercase;
    804 } 
    805 .ewd-ufaq-settings-preview p {
     894}
     895
     896.ewd-ufaq-settings-preview p{
    806897        margin: 40px 0 16px;
    807898        font-size: 16px;
    808899        color: #5f5f5f;
    809 } 
    810 .ewd-ufaq-settings-preview-images {
     900}
     901
     902.ewd-ufaq-settings-preview-images{
    811903        display: flex;
    812904        justify-content: space-between;
    813905        width: 100%;
    814906}
    815 .ewd-ufaq-settings-preview-images img {
     907
     908.ewd-ufaq-settings-preview-images img{
    816909        width: calc(50% - 12px);
    817910        border: 1px solid #ddd;
    … …  
    820913}
    821914
    822 .ewd-ufaq-settings-preview-other-features {
     915.ewd-ufaq-settings-preview-other-features{
    823916        display: flex;
    824917        flex-direction: column;
    … …  
    826919}
    827920
     921
    828922@media screen and (max-width: 1024px) {
    829         .ewd-ufaq-settings-preview {
     923.ewd-ufaq-settings-preview{
    830924                padding: 24px 32px 0 42px;
    831         }
    832 }
     925        }}
     926
    833927@media screen and (max-width: 768px) {
    834         .ewd-ufaq-settings-preview-images {
     928.ewd-ufaq-settings-preview-images{
    835929                flex-direction: column;
    836930                justify-content: initial;
    837931        }
    838         .ewd-ufaq-settings-preview-images img {
     932
     933.ewd-ufaq-settings-preview-images img{
    839934                width: 100%;
    840         }
    841 }
    842 
    843 
    844 /********************************
    845 SEARCH TERMS TABLE IN SETTINGS
    846 ********************************/
    847 
    848 .ewd-ufaq-search-terms-box,
    849 .ewd-ufaq-search-terms-box * {
    850         box-sizing: border-box;
    851 }
    852 .ewd-ufaq-search-terms-box {
    853         position: relative;
    854         display: flex;
    855         flex-direction: column;
    856         width: 100%;
    857         max-width: 400px;
    858         border: 1px solid #ccc;
    859         border-radius: 14px;
    860         margin: 21px 0 0;
    861 }
    862 .ewd-ufaq-search-term-each {
    863         display: flex;
    864         flex-basis: 100%;
    865         border-bottom: 1px solid #ccc;
    866 }
    867 .ewd-ufaq-search-term-each:last-of-type {
    868         border-bottom: none;
    869 }
    870 .ewd-ufaq-search-term-each-label,
    871 .ewd-ufaq-search-term-each-value {
    872         padding: 10px 16px;
    873 }
    874 .ewd-ufaq-search-term-each-label {
    875         border-right: 1px solid #ccc;
    876         font-weight: bold;
    877         flex-basis: 80%;
    878 }
    879 .ewd-ufaq-search-term-each-value {
    880         flex-basis: 20%;
    881         text-align: center;
    882 }
    883 .ewd-ufaq-settings-reset-search-terms {
     935        }}
     936
     937.ewd-ufaq-settings-reset-search-terms{
    884938        position: relative;
    885939        float: left;
    … …  
    896950        transition: background .35s;
    897951}
    898 .ewd-ufaq-settings-reset-search-terms:hover {
     952
     953.ewd-ufaq-settings-reset-search-terms:hover{
    899954        background: #894ae1;
    900955}
    901956
    902 
    903 /************
    904 EXTRA
    905 ************/
    906 
    907 #ewd-ufaq-custom-fields-table select {
    908         width: 100% !important;
    909 }
    910 #ewd-ufaq-custom-fields-table th {
    911         padding: 20px 10px 20px 10px !important;
    912 }
    913 
    914 .ewd-ufaq-import-export-container {
    915         position: relative;
    916         float: left;
    917         margin-left: 32px;
    918         width: calc(100% - 32px);
    919 }
    920 
    921 input[name="ewd_ufaq_export_pdf"] {
     957input[name="ewd_ufaq_export_pdf"]{
    922958        margin-top: 8px !important;
    923959}
    924960
    925 .ewd-ufaq-meta-field label {
     961.ewd-ufaq-meta-field label{
    926962        display: inline-block;
    927963        width: 150px;
    928964        margin: 12px 0;
    929965}
     966
    930967       
    931968
    … …  
    947984}
    948985
    949 .ewd-ufaq-toggle-symbol {
     986.ewd-ufaq-toggle-symbol{
    950987        font-family: 'ewd-toggle-icon';
    951988        letter-spacing: 6px;
    … …  
    953990}
    954991
    955 input[name=toggle_symbol] {
     992input[name=toggle_symbol]{
    956993        margin-right: 10px;
    957994}
    958995
    959 
    960 /****************
    961 ORDER TABLE
    962 ****************/
    963 #ewd-ufaq-ordering-table-container {
    964         width: 100%;
    965 }
    966 #ewd-ufaq-ordering-table-explanation {
    967         font-size: 16px;
    968         color: #212427;
    969         margin-bottom: 28px;
    970 }
    971 .ewd-ufaq-ordering-table thead tr,
    972 .ewd-ufaq-ordering-table tfoot tr {
    973         background: #F8F4FF;
    974 }
    975 .ewd-ufaq-ordering-table th {
    976         padding: 12px 10px;
    977 }
    978 .ewd-ufaq-ordering-table td {
    979         padding: 8px 10px;
    980 }
    981 .ewd-ufaq-ordering-table tbody tr:nth-of-type(2n+2) {
    982         background: #F8F4FF;
    983 }
    984 
    985 
    986 /*
    987 ==============================================
    988 About Us page
    989 ==============================================
    990 */
    991 
    992 .ufaq_page_ewd-ufaq-about-us #wpcontent {
     996.ufaq_page_ewd-ufaq-about-us #wpcontent{
    993997background: #fff;
    994998}
    995999
    996 .ewd-ufaq-about-us-logo {
     1000.ewd-ufaq-about-us-logo{
    9971001display: flex;
    9981002width: 100%;
    9991003padding: 24px 0 0 32px;
    10001004}
    1001 .ewd-ufaq-about-us-logo img {
     1005
     1006.ewd-ufaq-about-us-logo img{
    10021007width: 300px;
    10031008height: auto;
    … …  
    10071012#ewd-ufaq-about-us-tabs-menu *,
    10081013.ewd-ufaq-about-us-tab,
    1009 .ewd-ufaq-about-us-tab * {
     1014.ewd-ufaq-about-us-tab *{
    10101015box-sizing: border-box;
    10111016}
    10121017
    1013 .ewd-ufaq-about-us-tabs {
     1018.ewd-ufaq-about-us-tabs{
    10141019display: flex;
    10151020flex-direction: column;
    … …  
    10211026}
    10221027
    1023 #ewd-ufaq-about-us-tabs-menu {
     1028#ewd-ufaq-about-us-tabs-menu{
    10241029display: flex;
    10251030justify-content: space-between;
    … …  
    10291034margin: 0;
    10301035}
    1031 .ewd-ufaq-about-us-tab-menu-item {
     1036
     1037.ewd-ufaq-about-us-tab-menu-item{
    10321038width: 25%;
    10331039background: #f3f3f3;
    … …  
    10421048transition: background .35s;
    10431049}
    1044 .ewd-ufaq-about-us-tab-menu-item:hover {
     1050
     1051.ewd-ufaq-about-us-tab-menu-item:hover{
    10451052background: #fff;
    10461053color: #000;
    10471054}
    1048 .ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected {
     1055
     1056.ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected{
    10491057background: #fff;
    10501058color: #000;
    10511059border-bottom: none;
    10521060}
    1053 .ewd-ufaq-about-us-tab-menu-item:first-of-type {
     1061
     1062.ewd-ufaq-about-us-tab-menu-item:first-of-type{
    10541063border-left: none;
    10551064}
    10561065
    1057 .ewd-ufaq-about-us-tab {
     1066.ewd-ufaq-about-us-tab{
    10581067display: flex;
    10591068flex-direction: column;
    … …  
    10621071width: 100%;
    10631072}
    1064 .ewd-ufaq-about-us-tab p {
     1073
     1074.ewd-ufaq-about-us-tab p{
    10651075color: #555;
    10661076}
     1077
    10671078.ewd-ufaq-about-us-feature-suggestion input,
    1068 .ewd-ufaq-about-us-feature-suggestion textarea {
     1079.ewd-ufaq-about-us-feature-suggestion textarea{
    10691080width: 100%;
    10701081max-width: 400px;
    … …  
    10771088        font-weight: normal;
    10781089}
    1079 .ewd-ufaq-about-us-feature-suggestion textarea {
     1090
     1091.ewd-ufaq-about-us-feature-suggestion textarea{
    10801092min-height: 160px;
    10811093}
    10821094
    1083 .ewd-ufaq-about-us-tab-button {
     1095.ewd-ufaq-about-us-tab-button{
    10841096display: flex;
    10851097margin-top: 12px;
    … …  
    10921104        transition: background .35s;
    10931105}
    1094 .ewd-ufaq-about-us-tab-button-purchase {
     1106
     1107.ewd-ufaq-about-us-tab-button-purchase{
    10951108        background: #6026B4;
    10961109        color:  #fff;
    10971110margin-top: 24px;
    10981111}
    1099 .ewd-ufaq-about-us-tab-button-purchase:hover {
     1112
     1113.ewd-ufaq-about-us-tab-button-purchase:hover{
    11001114        background: #7a40cb;
    11011115        color:  #fff;
    11021116}
    1103 .ewd-ufaq-about-us-tab-button-walkthrough {
     1117
     1118.ewd-ufaq-about-us-tab-button-walkthrough{
    11041119        background: #6026B4;
    11051120        color:  #fff;
    11061121margin-bottom: 24px;
    11071122}
    1108 .ewd-ufaq-about-us-tab-button-walkthrough:hover {
     1123
     1124.ewd-ufaq-about-us-tab-button-walkthrough:hover{
    11091125        background: #7a40cb;
    11101126        color:  #fff;
    11111127}
    1112 .ewd-ufaq-about-us-tab-button-youtube {
     1128
     1129.ewd-ufaq-about-us-tab-button-youtube{
    11131130        background: #f00;
    11141131        color:  #fff;
    11151132}
    1116 .ewd-ufaq-about-us-tab-button-youtube:hover {
     1133
     1134.ewd-ufaq-about-us-tab-button-youtube:hover{
    11171135        background: #fe4c4c;
    11181136        color:  #fff;
    11191137}
    1120 .ewd-ufaq-about-us-send-feature-suggestion {
     1138
     1139.ewd-ufaq-about-us-send-feature-suggestion{
    11211140        background: #6026B4;
    11221141        color:  #fff;
    11231142}
    1124 .ewd-ufaq-about-us-send-feature-suggestion:hover {
     1143
     1144.ewd-ufaq-about-us-send-feature-suggestion:hover{
    11251145        background: #7a40cb;
    11261146        color:  #fff;
    11271147}
    11281148
    1129 .ewd-ufaq-about-us-premium-table {
     1149.ewd-ufaq-about-us-premium-table{
    11301150display: flex;
    11311151flex-direction: column;
    … …  
    11371157overflow: hidden;
    11381158}
     1159
    11391160.ewd-ufaq-about-us-premium-table-head,
    1140 .ewd-ufaq-about-us-premium-table-body {
     1161.ewd-ufaq-about-us-premium-table-body{
    11411162display: flex;
    11421163justify-content: space-between;
    11431164}
    1144 .ewd-ufaq-about-us-premium-table-cell {
     1165
     1166.ewd-ufaq-about-us-premium-table-cell{
    11451167display: flex;
    11461168align-items: center;
    … …  
    11501172padding: 8px 16px;
    11511173}
    1152 .ewd-ufaq-about-us-premium-table-cell:first-of-type {
     1174
     1175.ewd-ufaq-about-us-premium-table-cell:first-of-type{
    11531176border-left: none;
    11541177}
    1155 .ewd-ufaq-about-us-premium-table-cell:last-of-type {
     1178
     1179.ewd-ufaq-about-us-premium-table-cell:last-of-type{
    11561180background: #f8f1ff;
    11571181}
    11581182
    1159 .ewd-ufaq-about-us-premium-table-head .ewd-ufaq-about-us-premium-table-cell {
     1183.ewd-ufaq-about-us-premium-table-head .ewd-ufaq-about-us-premium-table-cell{
    11601184font-weight: bold;
    11611185border-top: none;
    11621186}
    1163 .ewd-ufaq-about-us-premium-table-cell img {
     1187
     1188.ewd-ufaq-about-us-premium-table-cell img{
    11641189width: 16px;
    11651190height: auto;
    11661191}
    11671192
     1193
    11681194@media screen and (max-width: 668px) {
    1169 #ewd-ufaq-about-us-tabs-menu {
     1195#ewd-ufaq-about-us-tabs-menu{
    11701196        flex-wrap: wrap;
    11711197}
    1172         .ewd-ufaq-about-us-tab-menu-item {
     1198
     1199.ewd-ufaq-about-us-tab-menu-item{
    11731200        width: 100%;
    11741201        border-left: none;
    11751202}
    1176 .ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected {
     1203
     1204.ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected{
    11771205        background: #fff;
    11781206        color: #000;
    11791207        border-bottom: 1px solid #ddd;
    1180 }
    1181 }
    1182 
    1183 
    1184 /* OVERWRITING EWDPH STYLING */
    1185 
    1186 .ewd-premium-helper-dashboard-new-widget-box {
     1208}}
     1209
     1210.ewd-premium-helper-dashboard-new-widget-box{
    11871211        float: none !important;
    11881212        background: transparent !important;
    … …  
    11901214        margin: 48px 0 -8px !important;
    11911215}
    1192 .ewd-premium-helper-dashboard-new-widget-box-top {
     1216
     1217.ewd-premium-helper-dashboard-new-widget-box-top{
    11931218        font-weight: normal !important;
    11941219        color: #5f5f5f !important;
    … …  
    12011226        padding: 32px !important;
    12021227}
    1203 .ewd-premium-helper-dashboard-key-widget {
     1228
     1229.ewd-premium-helper-dashboard-key-widget{
    12041230        display: flex;
    12051231        flex-wrap: wrap;
    … …  
    12141240        background-repeat: no-repeat;
    12151241}
    1216 .ewd-premium-helper-dashboard-key-widget-input {
     1242
     1243.ewd-premium-helper-dashboard-key-widget-input{
    12171244        float: none !important;
    12181245        display: flex;
    … …  
    12281255        color: #737373 !important
    12291256}
    1230 .ewd-premium-helper-dashboard-key-widget-input::placeholder {
     1257
     1258.ewd-premium-helper-dashboard-key-widget-input::placeholder{
    12311259        color: #bbb;
    12321260}
    1233 .ewd-premium-helper-dashboard-key-widget-submit {
     1261
     1262.ewd-premium-helper-dashboard-key-widget-submit{
    12341263        float: none !important;
    12351264        display: flex;
    … …  
    12501279        text-transform: uppercase;
    12511280}
    1252 .ewd-premium-helper-dashboard-key-widget-submit:hover {
     1281
     1282.ewd-premium-helper-dashboard-key-widget-submit:hover{
    12531283        background: #F2BD49;
    12541284}
    1255 .ewd-premium-helper-dashboard-key-widget-text {
     1285
     1286.ewd-premium-helper-dashboard-key-widget-text{
    12561287        float: none !important;
    12571288        width: 100%;
    … …  
    12621293        font-weight: normal;
    12631294}
    1264 .ewd-premium-helper-dashboard-key-widget-text a {
     1295
     1296.ewd-premium-helper-dashboard-key-widget-text a{
    12651297        color: #0acbaa;
    12661298        text-decoration: none;
    12671299        font-weight: bold;
    12681300}
    1269 .ewd-premium-helper-dashboard-key-widget-text a:hover {
     1301
     1302.ewd-premium-helper-dashboard-key-widget-text a:hover{
    12701303        color: #1CE6C3;
    12711304        text-decoration: none;
    12721305}
    12731306
    1274 .ewd-ufaq-dashboard-trial-container .ewd-premium-helper-dashboard-new-widget-box-bottom {
     1307.ewd-ufaq-dashboard-trial-container .ewd-premium-helper-dashboard-new-widget-box-bottom{
    12751308        float: none !important;
    12761309        width: 100% !important;
    … …  
    12801313}
    12811314
     1315
    12821316@media screen and (max-width: 768px) {
    1283         .ewd-premium-helper-dashboard-key-widget {
     1317.ewd-premium-helper-dashboard-key-widget{
    12841318                padding: 0 !important;
    12851319                background-image: none !important;
    12861320        }
    1287                 .ewd-premium-helper-dashboard-key-widget-input {
     1321
     1322.ewd-premium-helper-dashboard-key-widget-input{
    12881323                width: 100% !important;
    12891324                border-radius: 8px !important;
    … …  
    12911326                border-bottom-right-radius: 0 !important;
    12921327        }
    1293         .ewd-premium-helper-dashboard-key-widget-submit {
     1328
     1329.ewd-premium-helper-dashboard-key-widget-submit{
    12941330                width: 100% !important;
    12951331                border-radius: 8px !important;
    12961332                border-top-left-radius: 0 !important;
    12971333                border-top-right-radius: 0 !important;
    1298         }
    1299 }
    1300 
    1301 
    1302 .ewd-ufaq-hidden {
     1334        }}
     1335
     1336.ewd-ufaq-hidden{
    13031337        display: none !important;
    13041338}
     1339
     1340
     1341/****************************************/
     1342/** FAQ ORDERING SCREEN FILTERING AREA **/
     1343/****************************************/
     1344
     1345.ewd-ufaq-order-toolbar legend {
     1346        margin: 16px 0;
     1347        padding-left: 0;
     1348        font-size: 20px;
     1349}
     1350.ewd-ufaq-order-rows td span {
     1351        display: block;
     1352}
  • ultimate-faqs/tags/2.7.0/assets/css/ewd-ufaq.css

    r3399160 r3821169  
    1 .ewd-ufaq-hidden {
     1
     2.ewd-ufaq-hidden{
    23  display:none;
    34}
    45
    5 .ewd-ufaq-faq-category-title-toggle {
    6   cursor: pointer;
    7 }
    8 
    9 .ewd-ufaq-faq-category-body-hidden {
     6.ewd-ufaq-faq-category-title-toggle{
     7  cursor: pointer;
     8}
     9
     10.ewd-ufaq-faq-category-body-hidden{
    1011  display: none;
    1112}
    1213
    13 .ewd-ufaq-clear {
     14.ewd-ufaq-clear{
    1415  clear:both;
    1516}
    1617
    17 .ewd-ufaq-permalink {
     18.ewd-ufaq-permalink{
    1819  margin: 24px 0;
    1920}
    20 .ewd-ufaq-permalink-image {
     21
     22.ewd-ufaq-permalink-image{
    2123        background: url("../img/insert_link.png");
    2224        height: 21px;
    … …  
    2628}
    2729
    28 
    29 .ewd-ufaq-author {
     30.ewd-ufaq-author{
    3031  font-weight: 600;
    3132}
    32 .ewd-ufaq-date {
     33
     34.ewd-ufaq-date{
    3335  font-weight: 600;
    3436}
    3537
    36 .ewd-ufaq-faq-category-title {
     38.ewd-ufaq-faq-category-title{
    3739  width: 100%;
    3840  clear: both;
    … …  
    4648}
    4749
    48 .ewd-ufaq-faq-category-inner {
     50.ewd-ufaq-faq-category-inner{
    4951  margin-bottom: 48px;
    5052}
    5153
    52 .ewd-ufaq-faq-body {
     54.ewd-ufaq-faq-body{
    5355  padding:10px 25px;
    5456  padding-left: 55px;
    5557}
     58
    5659.ewd-ufaq-faq-search{
    5760  margin:5px 0 !important;
    5861}
    59 .ewd-ufaq-highlight-search-term {
    60   background: #f7ff00;
    61 }
    62 .ewd-ufaq-no-results-found {
     62
     63.ewd-ufaq-no-results-found{
    6364  margin-top: 16px;
    6465}
    … …  
    6768width: auto !important;
    6869}
    69 .ewd-ufaq-text-input {
     70
     71.ewd-ufaq-text-input{
    7072  border-radius: 0 !important;
    7173  margin:15px !important;
    7274}
    73 .ewd-ufaq-submit{
    74 border-radius: 0 !important;
    75 }
    76 .ewd-ufaq-faq-header{
    77   margin:10px;
    78 }
    79 .ewd-ufaq-faq-header a:hover{
    80   text-decoration: none;
    81 }
     75
    8276div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin{
    8377  text-decoration: none;
    8478}
     79
    8580div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin-symbol{
    8681  text-decoration: none;
    … …  
    9792  border-width: 0;
    9893}
     94
    9995.ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
    10096display: inline-block;
    … …  
    10298margin: 0 auto;
    10399}
    104 .ewd-ufaq-faq-title-text {
     100
     101.ewd-ufaq-faq-title-text{
    105102  float: left;
    106103  width: 85%;
    107104}
     105
    108106.ewd-ufaq-faq-title h1,
    109107.ewd-ufaq-faq-title h2,
    … …  
    111109.ewd-ufaq-faq-title h4,
    112110.ewd-ufaq-faq-title h5,
    113 .ewd-ufaq-faq-title h6 {
     111.ewd-ufaq-faq-title h6{
    114112  display:inline-block;
    115113  margin:5px !important;
    116114}
    117115
    118 
    119 
    120 
    121 .ewd-ufaq-custom-field-label, .ewd-ufaq-custom-field-value {
    122   position: relative;
    123   float: left;
    124   margin-top: 14px;
    125 }
    126 .ewd-ufaq-custom-field-label {
    127   font-weight: normal;
    128 }
    129 
    130 .ewd-ufaq-faq-body .comment-respond {
     116.ewd-ufaq-faq-body .comment-respond{
    131117  margin-top: 24px;
    132118}
    133 .ewd-ufaq-faq-body li.comment {
     119
     120.ewd-ufaq-faq-body li.comment{
    134121  list-style-type: none;
    135122}
    136 .ewd-ufaq-faq-body textarea {
     123
     124.ewd-ufaq-faq-body textarea{
    137125  clear: both;
    138126  display: block;
    … …  
    141129  height: 100px;
    142130}
    143 .ewd-ufaq-faq-body .comment-form-comment label {
     131
     132.ewd-ufaq-faq-body .comment-form-comment label{
    144133  clear: both;
    145134  display: block;
    … …  
    147136  width: 100%;
    148137}
    149 .ewd-ufaq-faq-body .submit {
     138
     139.ewd-ufaq-faq-body .submit{
    150140  width: auto;
    151141  background: transparent;
    … …  
    154144  margin-bottom: 20px;
    155145}
    156 .ewd-ufaq-faq-body .submit:hover {
     146
     147.ewd-ufaq-faq-body .submit:hover{
    157148  background: #111;
    158149  color: #fff;
    159150}
    160 .ewd-ufaq-faq-body .comment-author img {
     151
     152.ewd-ufaq-faq-body .comment-author img{
    161153  margin-right: 8px;
    162154}
    163 .ewd-ufaq-faq-body .comment-body p {
     155
     156.ewd-ufaq-faq-body .comment-body p{
    164157  margin: 10px 0;
    165158  margin-top: 10px !important;
    166159}
    167 .ewd-ufaq-faq-body .reply {
     160
     161.ewd-ufaq-faq-body .reply{
    168162  text-transform: uppercase;
    169163}
    170164
    171 .ewd-ufaq-faq-body .ewd-ufaq-back-to-top-link {
    172   cursor: pointer;
    173 }
    174 
    175 .ewd-ufaq-ratings {
    176   padding: 14px 0 0;
    177   display: inline-block;
    178   width: 100%;
    179   margin-bottom: 20px;
    180 }
    181 .ewd-ufaq-down-vote {
    182   background-position: 0px 8px !important;
    183   height: 50px !important;
    184 }
    185 
    186 
    187 /***********************
    188 * Pagination
    189 ***********************/
    190 .ewd-ufaq-bottom {
    191   clear: both;
    192 }
    193 .ewd-ufaq-previous-faqs h4 {
    194   float: left;
    195   padding-left: 12px;
    196   cursor: pointer;
    197   font-weight: 600;
    198 }
    199 .ewd-ufaq-next-faqs h4 {
    200   float: right;
    201   padding-right: 12px;
    202   cursor: pointer;
    203   font-weight: 600;
    204 }
    205 .ewd-ufaq-load-more h4 {
    206   text-align: center;
    207   cursor: pointer;
    208   font-weight: 600;
    209 }
    210 
    211 
    212 /***********************
    213 * Columns
    214 ***********************/
    215 .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two {
    216   width: 48%;
    217   margin-right: 2%;
    218   float: left;
    219   clear: none;
    220 }
    221 .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three {
    222   width: 31%;
    223   margin-right: 2%;
    224   float: left;
    225   clear: none;
    226 }
    227 .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four {
    228   width: 23%;
    229   margin-right: 2%;
    230   float: left;
    231   clear: none;
    232 }
    233 
    234 @media only screen and (max-width: 960px) {
    235   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
    236   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
    237     width: 48%;
    238     margin-right: 2%;
    239   }
    240 }
    241 @media only screen and (max-width: 520px) {
    242   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two.ewd-ufaq-faq-responsive-columns-1,
    243   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
    244   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
    245     width: 100%;
    246     margin-right: none;
    247   }
    248 }
    249 
    250 /***********************
    251 Color Block Style
    252 ***********************/
    253 .ewd-ufaq-faq-display-style-color_block .ewd-ufaq-post-margin-symbol {
    254   background-color: #1188cc;
    255   color: #ffffff;
    256 }
    257 
    258 .ewd-ufaq-Circle {
    259   border-radius: 18px;
    260 }
    261 
    262 .ewd-ufaq-Square {
    263   border-radius: 0px;
    264 }
    265 
    266 
    267 /***********************
    268 Block Style
    269 ***********************/
    270 .ewd-ufaq-faq-div {
     165.ewd-ufaq-faq-body .ewd-ufaq-back-to-top-link{
     166  cursor: pointer;
     167}
     168
     169.ewd-ufaq-faq-div{
    271170  margin: 2px 0;
    272171  padding:2px 0;
    273172  clear: both;
    274173}
     174
    275175.ewd-ufaq-faq-toggle:hover, .ewd-ufaq-faq-toggle a:hover{
    276176  cursor: pointer;
    … …  
    278178  text-decoration: none;
    279179}
    280 .ewd-ufaq-faq-display-style-block a, .ewd-ufaq-faq-display-style-block a:visited, .ewd-ufaq-faq-display-style-block a:active{
    281   text-decoration: none;
    282 }
    283 .ewd-ufaq-faq-display-style-block:hover,
    284 .ewd-ufaq-faq-display-style-block:hover a,
    285 .ewd-ufaq-faq-display-style-block:hover h1,
    286 .ewd-ufaq-faq-display-style-block:hover h2,
    287 .ewd-ufaq-faq-display-style-block:hover h3,
    288 .ewd-ufaq-faq-display-style-block:hover h4,
    289 .ewd-ufaq-faq-display-style-block:hover h5,
    290 .ewd-ufaq-faq-display-style-block:hover h6 {
    291   text-decoration: none !important;
    292   color:#fff;
    293   background: #1188cc;
    294 }
    295 .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active a{
    296   color:#fff;
    297   background: #1188cc;
    298 }
    299 
    300 
    301 /***********************
    302 List Style
    303 ***********************/
    304 .ewd-ufaq-faq-header-title a {
    305   display: inline-block;
    306 }
    307 
    308 
    309 /***********************
    310 Border Block Style
    311 ***********************/
    312 .ewd-ufaq-faq-div {
     180
     181.ewd-ufaq-faq-div{
    313182  margin: 2px 0;
    314183  padding:2px 0;
    315184  clear: both;
    316185}
     186
    317187.ewd-ufaq-faq-toggle:hover, .ewd-ufaq-faq-toggle a:hover{
    318188  cursor: pointer;
    … …  
    320190  text-decoration: none;
    321191}
    322 .ewd-ufaq-faq-display-style-border_block a, .ewd-ufaq-faq-display-style-border_block a:visited, .ewd-ufaq-faq-display-style-border_block a:active{
    323   text-decoration: none;
    324 }
    325 .ewd-ufaq-faq-display-style-border_block:hover,
    326 .ewd-ufaq-faq-display-style-border_block:hover a,
    327 .ewd-ufaq-faq-display-style-border_block:hover h1,
    328 .ewd-ufaq-faq-display-style-border_block:hover h2,
    329 .ewd-ufaq-faq-display-style-border_block:hover h3,
    330 .ewd-ufaq-faq-display-style-border_block:hover h4,
    331 .ewd-ufaq-faq-display-style-border_block:hover h5,
    332 .ewd-ufaq-faq-display-style-border_block:hover h6 {
    333   text-decoration: none !important;
    334   color:#fff;
    335   background: #1188cc;
    336 }
    337 .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active a{
    338   color:#fff !important;
    339   background: #1188cc;
    340 }
    341 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body {
    342   color:#555 !important;
    343   background: #fff;
    344   border: 3px solid #1188cc;
    345   border-bottom: 2px solid #1188cc;
    346 }
    347 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body a {
    348   color:#000 !important;
    349   background: transparent;
    350 }
    351 
    352 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links {
    353 margin-top: 4px;
    354 }
    355 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links ul {
    356 float: left;
    357 margin-bottom: 14px;
    358 position: relative;
    359 width: auto;
    360 }
    361 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink {
    362 margin: 24px 0;
    363 }
    364 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink-image {
    365 margin-top: -32px;
    366 margin-left: 112px;
    367 }
    368 
    369 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-author-date {
    370   margin-bottom: 14px;
    371 }
    372 
    373 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-categories {
    374   margin: 14px 0;
    375 }
    376 
    377 .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active .ewd-ufaq-faq-title-text {
    378   color: #fff !important;
    379 }
    380 
    381 .ewd-ufaq-faq-display-style-border_block .comment-reply-title {
    382   background: transparent !important;
    383   color: #000 !important;
    384 }
    385 .ewd-ufaq-faq-display-style-border_block:hover .comment-reply-title {
    386   color: #000 !important;
    387 }
    388 
    389 
    390 
    391 /***********************
    392 Contemporary Style
    393 ***********************/
    394 .ewd-ufaq-faq-display-style-contemporary {
    395 border-bottom: 1px solid #ccc;
    396 padding: 0;
    397 margin: 0;
    398 }
    399 .ewd-ufaq-faq-display-style-contemporary:first-of-type {
    400 border-top: 1px solid #ccc;
    401 }
    402 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-title {
    403 background: #f7f7f7;
    404 padding: 8px 0 8px 4px;
    405 }
    406 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-post-margin-symbol {
    407 float: right;
    408 height: auto;
    409 }
    410 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-body {
    411 padding: 20px 25px 10px;
    412 padding-left: 40px;
    413 }
    414 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links {
    415 margin-top: 4px;
    416 }
    417 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links ul {
    418 float: left;
    419 margin-bottom: 14px;
    420 position: relative;
    421 width: auto;
    422 }
    423 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-permalink {
    424 margin-left: 0;
    425 margin-bottom: 10px;
    426 }
    427 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-back-to-top {
    428   margin-bottom: 14px;
    429 }
    430 
    431 .ewd-ufaq-social-links-label {
    432   float: left;
    433   margin-right: 8px;
    434   position: relative;
    435   top: 3px;
    436 }
    437 
    438 
    439 
    440 
    441 /***********************
    442 Ratings
    443 ***********************/
    444 .ewd-ufaq-rating-button {
    445   position: relative;
    446   float: left;
    447   width: 60px;
    448   height: 48px;
    449   margin-right: 12px;
    450   line-height: 48px;
    451   font-weight: 600;
    452   cursor: pointer;
    453 
    454 }
    455 .ewd-ufaq-rating-button img {
    456   position: absolute;
    457   top: 0;
    458   left: 0;
    459   width: 75%;
    460   height: auto;
    461 }
    462 .ewd-ufaq-rating-button span {
    463   text-align: right;
    464   width: 100%;
    465   display: block;
    466 }
    467 .ewd-ufaq-up-vote {
    468   background: transparent;
    469   background-repeat: no-repeat;
    470 }
    471 .ewd-ufaq-down-vote {
    472   background: transparent;
    473   background-repeat: no-repeat;
    474 }
    475 .ewd-ufaq-ratings-custom-image {
    476   background: transparent;
    477 }
    478 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image,
    479 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image {
    480   background: none;
    481   padding-left: 0;
    482 }
    483 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image img,
    484 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image img {
    485   position: relative;
    486   float: left;
    487   width: 48px;
    488   height: auto;
    489   margin-right: 4px;
    490 }
    491 
    492 
    493 /************************
    494 * Expand/Collapse
    495 ************************/
     192
    496193.ewd-ufaq-expand-all,
    497 .ewd-ufaq-collapse-all {
     194.ewd-ufaq-collapse-all{
    498195  text-decoration: none;
    499196  cursor: pointer;
    500197  font-size: 0.9em;
    501198}
     199
     200
    502201
    503202/*
    … …  
    520219.ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol,
    521220.ewd-ufaq-faq-category-title .ewd-ufaq-category-post-margin-symbol,
    522 .ewd-ufaq-toggle-all-symbol {
     221.ewd-ufaq-toggle-all-symbol{
    523222  font-family: 'ewd-toggle-icon';
    524 }
    525 
    526 
    527 /*
    528 ==============================================
    529 PChanges
    530 ==============================================
    531 */
    532 
    533 .ewd-ufaq-question-update{
    534 font-size: 1.2em;
    535 margin-bottom: 20px;
    536 }
    537 .ewd-ufaq-question-form .form-field {
    538   margin-bottom: 20px;
    539 }
    540 
    541 .rrssb-buttons li a .rrssb-text {
    542 color: #fff;
    543 margin-left: 5px;
    544 }
    545 
    546 .ewd-ufaq-social-links .rrssb-buttons li {
    547 margin-bottom: 5px;
    548223}
    549224
    … …  
    551226clear: both;
    552227}
     228
     229
    553230@media only screen and (max-width: 810px) {
    554 
    555 .ewd-ufaq-faq-title-text {
     231.ewd-ufaq-faq-title-text{
    556232width: 80%;
    557 }
    558 
    559 }
    560 
    561 
    562 
    563 /*
    564 ==============================================
    565 Pagination
    566 ==============================================
    567 */
    568 .ewd-ufaq-previous-faqs, .ewd-ufaq-next-faqs {
    569     margin-top: 16px;
    570 }
    571 .ewd-ufaq-previous-faqs {
    572     float: left;
    573 }
    574 .ewd-ufaq-next-faqs {
    575     float: right;
    576 }
    577 
    578 /* clears the 'X' from Internet Explorer */
    579 #ewd-ufaq-jquery-ajax-search input[type=search]::-ms-clear {
    580   display: none; width : 0; height: 0;
    581 }
    582 #ewd-ufaq-jquery-ajax-search input[type=search]::-ms-reveal {
    583   display: none; width : 0; height: 0;
    584 }
    585 
    586 /* clears the 'X' from Chrome */
    587 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-decoration,
    588 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-cancel-button,
    589 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-results-button,
    590 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-results-decoration {
    591   -webkit-appearance: none;
    592 }
    593 
    594 #ewd-ufaq-jquery-ajax-search * {
    595   vertical-align: middle;
    596 }
    597 #ewd-ufaq-jquery-ajax-search .search-field {
    598   display:  inline-block;
    599   margin:  15px;
    600   position: relative;
    601 }
    602 #ewd-ufaq-jquery-ajax-search .search-field .ewd-ufaq-text-input {
    603   margin: 0 !important;
    604   padding: 8px 30px 8px 12px !important;
    605 }
    606 #ewd-ufaq-jquery-ajax-search .clear-field {
    607   display: inline;
    608   padding: 0;
    609   margin: 0;
    610   height: 100%;
    611   background: transparent;
    612   position: absolute;
    613   top: 0;
    614   right: 0;
    615   color: black;
    616   transition: width 0.35s, opacity 0.25s;
    617   transform: translateX(15px);
    618   opacity: 0;
    619   width: 0;
    620 }
    621 #ewd-ufaq-jquery-ajax-search .clear-field.slide-in {
    622   opacity: 1;
    623   width: 30px;
    624   animation: slide-in-right 0.5s forwards;
    625   -webkit-animation: slide-in-right 0.5s forwards;
    626 }
    627 #ewd-ufaq-jquery-ajax-search .clear-field.slide-out {
    628   opacity: 0;
    629   width: 0;
    630   animation: slide-out-right 0.5s forwards;
    631   -webkit-animation: slide-out-right 0.5s forwards;
    632 }
    633 #ewd-ufaq-jquery-ajax-search .clear-field:hover,
    634 #ewd-ufaq-jquery-ajax-search .clear-field:focus {
    635   border-radius: 0;
    636 }
    637 @keyframes slide-in-right {
    638   100% {
    639     transform: translateX(0px);
    640   }
    641 }
    642 @keyframes slide-out-right {
    643   0% {
    644     transform: translateX(0px);
    645   }
    646   100% {
    647     transform: translateX(15px);
    648   }
    649 }
    650 
    651 
    652 /***************
    653 BLOCK PATTERNS
    654 ***************/
     233}}
     234
    655235.ewd-ufaq-pattern-faqs,
    656236.ewd-ufaq-pattern-featured-faqs,
    657237.ewd-ufaq-pattern-search,
    658 .ewd-ufaq-pattern-submit {
     238.ewd-ufaq-pattern-submit{
    659239        width: 100%;
    660240}
    661241
    662 /***************
    663 CATEGORY TABS
    664 ***************/
    665 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faqs {
    666   display: flex;
    667   width: 100%;
    668   position: relative;
    669 }
    670 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faq-category {
    671   display: flex;
    672   flex-direction: column;
    673   margin-right: 40px;
    674 }
    675 .ewd-ufaq-category-tabs-1 .ewd-ufaq-category-tab-selected h3 {
    676   font-weight: bold;
    677   text-decoration: underline;
    678 }
    679 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faq-category-inner {
    680   position: absolute;
    681   left: 0;
    682   top: 72px;
    683   width: 100%;
    684 }
    685 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faq-category .ewd-ufaq-faq-category {
    686   position: relative;
    687   margin-right: 0;
    688   margin-top: 24px;
    689   width: 100%;
    690   clear: both;
    691   display: flex;
    692   flex-direction: column;
    693 }
    694 
    695 .ewd-ufaq-faq-category-body-hidden {
     242.ewd-ufaq-faq-category-body-hidden{
    696243  display: none;
    697244}
    698245
    699 
    700 /**********************/
    701 /** NEW META BUBBLES **/
    702 /**********************/
    703 
    704246.ewd-ufaq-faq-categories,
    705 .ewd-ufaq-faq-tags {
     247.ewd-ufaq-faq-tags{
    706248        margin: 14px 0;
    707249        display: flex;
    … …  
    711253        color: #212427;
    712254}
     255
    713256.ewd-ufaq-faq-categories a,
    714 .ewd-ufaq-faq-tags a {
     257.ewd-ufaq-faq-tags a{
    715258        text-decoration: none;
    716259        padding: 4px 12px;
    … …  
    719262        border-radius: 100px;
    720263}
    721 .ewd-ufaq-faq-custom-fields {
    722   margin-bottom: 14px;
    723 }
    724 .ewd-ufaq-custom-field-label {
    725   color: #212427;
    726 }
    727 
    728 /**********************/
    729 /**** COMPACT META ****/
    730 /**********************/
    731 
    732 .ewd-ufaq-compact-faq-meta {
    733         display: flex;
    734         width: 100%;
    735         flex-wrap: wrap;
    736         justify-content: right;
    737         align-items: center;
    738         gap: 0;
    739 }
    740 .ewd-ufaq-compact-faq-meta > div {
    741         width: 100%;
    742 }
    743 .ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink {
    744         width: auto;
    745         order: 25;
    746 }
    747 .ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink a {
    748         font-size: 16px;
    749         color: #7a7a7a;
    750         font-weight: normal;
    751         text-decoration: none;
    752 }
    753 .ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink-image {
    754         display: none;
    755 }
    756 .ewd-ufaq-compact-faq-meta .ewd-ufaq-social-links {
    757         width: auto;
    758         order: 26;
    759 }
    760 .ewd-ufaq-compact-faq-meta .ewd-ufaq-social-links-label {
    761         display: none;
    762 }
    763 .ewd-ufaq-compact-faq-meta .rrssb-buttons {
    764         height: auto;
    765         display: flex;
    766         align-items: center;
    767         margin: 0;
    768         float: none;
    769         gap: 4px;
    770 }
    771 .ewd-ufaq-compact-faq-meta .rrssb-buttons li {
    772         float: none;
    773         height: auto;
    774         line-height: initial;
    775         padding: 0;
    776         margin: 0;
    777 }
    778 .ewd-ufaq-compact-faq-meta .rrssb-buttons li a {
    779         height: auto;
    780         padding: 0;
    781         font-weight: normal;
    782         font-size: 16px;
    783         text-align: left;
    784         width: auto;
    785         border-radius: 0;
    786 }
    787 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-facebook a,
    788 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-twitter a,
    789 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-linkedin a,
    790 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-pinterest a,
    791 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-email a {
    792         background-color: transparent;
    793 }
    794 .ewd-ufaq-compact-faq-meta .rrssb-buttons li a .rrssb-icon,
    795 .ewd-ufaq-compact-faq-meta .rrssb-buttons li a .rrssb-text {
    796         display: none;
    797 }
    798 .ewd-ufaq-compact-faq-meta .ewd-ufaq-ratings {
    799         width: auto;
    800         order: 27;
    801         padding: 0;
    802         margin: 0;
    803         display: flex;
    804         align-items: center;
    805 }
    806 .ewd-ufaq-compact-faq-meta .ewd-ufaq-rating-button {
    807         float: none;
    808         width: auto;
    809         height: auto;
    810         margin: 0;
    811         line-height: initial;
    812         font-weight: normal;
    813   display: flex;
    814 }
    815 .ewd-ufaq-compact-faq-meta .ewd-ufaq-rating-button img {
    816         display: none !important;
    817 }
    818 .ewd-ufaq-compact-faq-meta .ewd-ufaq-rating-button span {
    819         width: auto;
    820   margin-left: 2px;
    821 }
    822 .ewd-ufaq-compact-faq-meta .ewd-ufaq-down-vote {
    823         height: auto !important;
    824         margin-left: 4px;
    825 }
    826 .ewd-ufaq-compact-faq-meta .ewd-ufaq-ratings-label {
    827         display: none;
    828 }
    829 
    830 .ewd-ufaq-hidden {
     264
     265.ewd-ufaq-hidden{
    831266  display: none;
    832267}
  • ultimate-faqs/tags/2.7.0/assets/js/ewd-ufaq-admin.js

    r3507393 r3821169  
    6464} );
    6565
    66 jQuery(document).ready(function($) {
    67 
    68         $( '.ewd-ufaq-list' ).sortable({
    69                 items: '.ewd-ufaq-item',
    70                 opacity: 0.6,
    71                 cursor: 'move',
    72                 axis: 'y',
    73                 update: function() {
    74                                 var order = jQuery( this ).sortable( 'serialize' )
    75                                   + '&action=ewd_ufaq_update_faq_order'
    76                                   + '&nonce='+ewd_ufaq_php_data.nonce;
    77                                 jQuery.post( ajaxurl, order, function( response ) {} );
    78                 }
    79         });
    80 
    81         if ( jQuery( 'input[name="taxonomy"]' ).length && jQuery( 'input[name="taxonomy"]' ).val() == 'ufaq-category' ) {
    82 
    83         jQuery( 'table.wp-list-table tbody' ).sortable({
    84                 items: 'tr.level-0',
    85                 opacity: 0.6,
    86                 cursor: 'move',
    87                 update: function() {
    88 
    89                                 var params = {
    90                                         nonce: ewd_ufaq_php_data.nonce,
    91                                         action: 'ewd_ufaq_update_category_order'
    92                                 };
    93 
    94                                 var query_string = jQuery( this ).sortable('serialize');
    95                                 var data = jQuery.param( params ) + '&' + query_string;
    96 
    97                                 jQuery.post( ajaxurl, data, function( response ) {});
    98                 }
    99         })
    100     }
    101 });
     66// Helper owns explicit one-record order edits; partial sortable lists are never submitted.
    10267
    10368jQuery(document).ready(function($) {
    … …  
    10873});
    10974
    110 jQuery(document).ready(function($){
    111 
    112         $( '.sap-new-admin-add-button' ).on( 'click', function() {
    113 
    114                 setTimeout( ewd_ufaq_field_added_handler, 500);
    115         });
    116 });
    117 
    118 function ewd_ufaq_field_added_handler() {
    119 
    120         var highest = 0;
    121         jQuery( '.sap-infinite-table input[data-name="id"]' ).each( function() {
    122                 highest = Math.max( highest, this.value );
    123         });
    124 
    125         jQuery( '.sap-infinite-table  tbody tr:last-of-type span.sap-infinite-table-hidden-value' ).html( highest + 1 );
    126         jQuery( '.sap-infinite-table  tbody tr:last-of-type input[data-name="id"]' ).val( highest + 1 );
    127 }
     75// Helper owns custom-field input behavior.
    12876
    12977// Reset button for search term statistics
  • ultimate-faqs/tags/2.7.0/assets/js/ewd-ufaq-managed-editor.js

    r3744649 r3821169  
    363363                }
    364364
    365                 function moveFaq( id, offset ) {
    366                         if ( busy || isSaving || trashRequests.current[ id ] ) { return; }
    367                         var from = selectedIds.indexOf( id );
    368                         var to = from + offset;
    369                         if ( from < 0 || to < 0 || to >= selectedIds.length ) { return; }
    370                         var next = selectedIds.slice();
    371                         next.splice( from, 1 ); next.splice( to, 0, id ); setIds( next );
    372                 }
    373365
    374366                var selected = selectedIds.map( function( id, index ) {
    … …  
    387379                                        el( Button, { isSecondary: true, disabled: busy || isSaving, onClick: function() { retryCategories( id ); } }, __( 'Retry category assignment', 'ultimate-faqs' ) ) ) : null,
    388380                                el( 'div', { className: 'ewd-ufaq-managed-actions' },
    389                                         config.canOrderFaqs ? el( Button, { isSmall: true, disabled: busy || isSaving || trashing[ id ] || index === 0, onClick: function() { moveFaq( id, -1 ); } }, __( 'Up', 'ultimate-faqs' ) ) : null,
    390                                         config.canOrderFaqs ? el( Button, { isSmall: true, disabled: busy || isSaving || trashing[ id ] || index === selectedIds.length - 1, onClick: function() { moveFaq( id, 1 ); } }, __( 'Down', 'ultimate-faqs' ) ) : null,
     381                                        typeof window.ewdUfaqManagedOrderControls === 'function' ? window.ewdUfaqManagedOrderControls( { id: id, index: index, ids: selectedIds, setIds: setIds, disabled: busy || isSaving || trashing[id] } ) : null,
    391382                                        el( Button, { isSmall: true, disabled: busy || isSaving || trashing[ id ], onClick: function() { removeFaq( id ); } }, __( 'Remove', 'ultimate-faqs' ) ),
    392383                                        record && record.can_delete ? el( Button, { isSmall: true, isDestructive: true, disabled: busy || isSaving || trashing[ id ], onClick: function() { setTrashId( id ); } }, trashing[ id ] ? __( 'Moving FAQ to Trash…', 'ultimate-faqs' ) : __( 'Move FAQ to Trash', 'ultimate-faqs' ) ) : null
  • ultimate-faqs/tags/2.7.0/assets/js/ewd-ufaq.js

    r3704732 r3821169  
    1 var filtering_running = false;
    2 var wpforms_search_running = 'No';
    3 
    4 var ajax_ctrlr = {
    5 
    6         last_run: new Date(),
    7         srch_str: '',
    8         schdl_to_run_state: false,
    9         schdl_to_run_delay: 250,
    10         search_save_schdl_to_run_delay: 3000,
    11         schdl_to_run_cntr: 0,
    12         schdl_to_run_hndl: null,
    13         search_save_schdl_to_run_hndl: null,
    14 
    15         schedule_to_run: function() {
    16                 ajax_ctrlr.schdl_to_run_cntr++;
    17 
    18                 if(ajax_ctrlr.schdl_to_run_cntr % 5 == 0) {
    19                         ajax_ctrlr.schdl_to_run_delay += 250;
    20                         ajax_ctrlr.schdl_to_run_reset();
    21                 }
    22 
    23                 if( ! ajax_ctrlr.schdl_to_run_state) {
    24                         return;
    25                 }
    26 
    27                 let crnt_run = new Date();
    28 
    29                 if(crnt_run - ajax_ctrlr.last_run > ajax_ctrlr.schdl_to_run_delay) {
    30                         ajax_ctrlr.schdl_to_run_state = false;
    31                         ajax_ctrlr.schdl_to_run_cntr = 0;
    32                         ajax_ctrlr.last_run = new Date();
    33 
    34                         ewd_ufaq_ajax_reload();
    35 
    36                         ajax_ctrlr.save_search_schdl_to_run_reset();
    37                 }
    38         },
    39         schdl_to_run_reset: function () {
    40                 clearInterval(ajax_ctrlr.schdl_to_run_hndl);
    41                 ajax_ctrlr.schdl_to_run_hndl = setInterval(ajax_ctrlr.schedule_to_run, ajax_ctrlr.schdl_to_run_delay);
    42         },
    43         run_search_ajax: function( elm ) {
    44                 ajax_ctrlr.clear_field( elm );
    45 
    46                 let srch_str = jQuery(elm).val();
    47 
    48                 if( ajax_ctrlr.schdl_to_run_delay > 250 ) {
    49                         ajax_ctrlr.schdl_to_run_delay = 250;
    50                         ajax_ctrlr.schdl_to_run_reset();
    51                 }
    52 
    53                 if(srch_str != ajax_ctrlr.srch_str) {
    54                         ajax_ctrlr.srch_str = srch_str;
    55                         ajax_ctrlr.schdl_to_run_state = true;
    56                         ajax_ctrlr.last_run = new Date();
    57                 }
    58         },
    59         save_search_term: function() {
    60                 var params = {};
    61 
    62                 params.nonce       = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.nonce : '';
    63                 params.search_term = ajax_ctrlr.srch_str;
    64                 params.action      = 'ewd_ufaq_record_search_term';
    65 
    66                 var data = jQuery.param( params );
    67                 jQuery.post(ajaxurl, data, function(response) {});
    68         },
    69         save_search_schdl_to_run_reset: function() {
    70 
    71                 if ( typeof ewd_ufaq_php_data == 'undefined' || ! ewd_ufaq_php_data.save_search_terms ) { return false; }
    72 
    73                 clearTimeout(ajax_ctrlr.search_save_schdl_to_run_hndl);
    74                 ajax_ctrlr.search_save_schdl_to_run_hndl = setTimeout(ajax_ctrlr.save_search_term, ajax_ctrlr.search_save_schdl_to_run_delay);
    75         },
    76         clear_field: function ( srch_elm ) {
    77                 let cf = jQuery(srch_elm).parent('.search-field').find('.clear-field').eq(0);
    78                 if( 0 < jQuery(srch_elm).val().length ) {
    79                         if( 'hidden' == cf.data('state') ) {
    80                                 cf.data('state', 'visible');
    81                                 cf.removeClass('slide-out').addClass('slide-in');
    82                         }
    83                 }
    84                 else {
    85                         cf.data('state', 'hidden');
    86                         cf.removeClass('slide-in').addClass('slide-out');
    87                 }
    88         }
    89 };
    90 
    91 jQuery(function(){ //DOM Ready
    92         ufaqSetClickHandlers();
    93         UFAQSetAutoCompleteClickHandlers();
    94         UFAQSetRatingHandlers();
    95         UFAQSetExpandCollapseHandlers();
    96         UFAQSetPaginationHandlers();
    97 
    98         UFAQWPFormsHandler();
    99 });
    100 
    101 function ewd_ufaq_run_effect( display, faq_element ) {
    102 
    103         var selected_effect = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.reveal_effect : 'none';
    104 
    105         // most effect types need no options passed by default
    106         var options = {};
    107 
    108         // some effects have required parameters
    109         if ( selected_effect === 'size' ) {
    110 
    111         options = { to: { width: 200, height: 60 } };
    112         }
    113 
    114         // run the effect
    115         if ( display == 'show' ) { faq_element.find( '.ewd-ufaq-faq-body' ).show( selected_effect, options, 500, ewd_ufaq_toggle_hidden_class( faq_element ) ); }
    116         if ( display == 'hide' ) { faq_element.find( '.ewd-ufaq-faq-body' ).hide( selected_effect, options, 500, ewd_ufaq_toggle_hidden_class( faq_element ) ); }
    117 };
     1jQuery(function() { ufaqSetClickHandlers(); UFAQSetExpandCollapseHandlers(); });
     2
     3
    1184
    1195// callback function to bring a hidden box back
    120 function ewd_ufaq_toggle_hidden_class( faq_element ) {
    121 
    122         setTimeout( function() { faq_element.find( '.ewd-ufaq-faq-body' ).toggleClass( 'ewd-ufaq-hidden' ); }, 500 );
    123 };
     6
    1247
    1258function ufaqSetClickHandlers( context ) {
    1269
    12710        var interaction_scope = context ? jQuery( context ) : jQuery( document );
     11        UFAQSetExpandCollapseHandlers( context );
    12812
    12913        interaction_scope.find( '.ewd-ufaq-faq-toggle' ).off( 'click' ).on( 'click', function( event ) {
    … …  
    13519                event.preventDefault();
    13620               
    137                 faq = jQuery( this ).parent();
     21                var faq = jQuery( this ).parent();
    13822               
    13923                if ( faq.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) {
    … …  
    14125                        EWD_UFAQ_Reveal_FAQ( faq );
    14226
    143                         if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.faq_scroll ) { jQuery('html, body').animate({scrollTop: jQuery(this).offset().top -80}, 100); }
     27                        if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.faq_scroll ) { jQuery( this.ownerDocument ).find('html, body').animate({scrollTop: jQuery(this).offset().top -80}, 100); }
    14428                }
    14529                else {
    … …  
    15236               
    15337                var category_title = jQuery( this );
     38                var context_document = jQuery( this.ownerDocument );
    15439                var category = category_title.parent();
    15540                var category_inner = category.find( '.ewd-ufaq-faq-category-inner' ).first();
    156                 var category_inner_height = category_inner.outerHeight( true );
    157                 var faqs_list = category_inner.parent();
    158                 var faqs_list_height = faqs_list.outerHeight( true );
    159                 var total_faqs_height = category_inner_height + faqs_list_height;
    160 
    161                 jQuery( '.ewd-ufaq-category-tabs-1' ).css( 'height', total_faqs_height + 'px' );
    16241
    16342                jQuery( this ).toggleClass( 'ewd-ufaq-category-tab-selected' );
    … …  
    16746                if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.category_accordion ) {
    16847
    169                         jQuery( '.ewd-ufaq-faq-category-inner' ).each( function( index, object ) {
     48                        context_document.find( '.ewd-ufaq-faq-category-inner' ).each( function( index, object ) {
    17049                       
    17150                                if ( object != category_inner.get( 0 ) ) { jQuery( this ).addClass( 'ewd-ufaq-faq-category-body-hidden' ); }
    17251                        });
    17352
    174                         jQuery( '.ewd-ufaq-faq-category-title-toggle' ).each (function() {
    175 
    176                                 if ( jQuery( this ) != category_title ) { jQuery( this ).removeClass( 'ewd-ufaq-category-tab-selected' ); }
     53                        context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).each (function() {
     54
     55                                if ( this !== category_title[0] ) { jQuery( this ).removeClass( 'ewd-ufaq-category-tab-selected' ); }
    17756                        });
    17857                }
    17958
    180                 jQuery( '.ewd-ufaq-faq-category-title-toggle' ).each( function() {
     59                context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).each( function() {
    18160                        var span = jQuery( this ).find( '.ewd-ufaq-category-post-margin-symbol span' );
    18261
    18362                        if ( jQuery( this).hasClass( 'ewd-ufaq-category-tab-selected' ) )  {
    184                                 span.html( span.html().toUpperCase() );
     63                                span.text( span.text().toUpperCase() );
    18564                        }
    18665                        else {
    187                                 span.html( span.html().toLowerCase() );
     66                                span.text( span.text().toLowerCase() );
    18867                        }
    18968                } );
     69                if ( typeof window.ewdUfaqCategoryLayout === 'function' ) { window.ewdUfaqCategoryLayout( category_title ); }
    19070        });
    19171
    … …  
    19373                event.preventDefault();
    19474
    195                 jQuery( 'html, body' ).animate( { scrollTop: jQuery( '#ewd-ufaq-faq-list' ).offset().top -80 }, 100 );
     75                var context_document = jQuery( this.ownerDocument );
     76                var list = jQuery( this ).closest( '#ewd-ufaq-faq-list' );
     77                if ( list.length ) { context_document.find( 'html, body' ).animate( { scrollTop: list.offset().top -80 }, 100 ); }
    19678        });
    19779
    … …  
    20082
    20183                var faq_id = jQuery( this ).data( 'postid' );
    202                 var faq = jQuery( '#ewd-ufaq-post-' + faq_id ).first();
     84                var context_document = jQuery( this.ownerDocument );
     85                var faq = context_document.find( '#ewd-ufaq-post-' + faq_id ).first();
     86                if ( ! faq.length ) { return; }
    20387
    20488                if ( faq.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) {
    … …  
    20791                }
    20892
    209                 jQuery( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
    210         });
    211 }
    212 
    213 function UFAQSetAutoCompleteClickHandlers() {
    214 
    215         jQuery( '.ewd-ufaq-text-auto-complete' ).on( 'keyup', function() {
    216 
    217                 jQuery( '.ewd-ufaq-text-auto-complete' ).autocomplete({
    218 
    219                         source: typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.question_titles : '',
    220                         minLength: 3,
    221                         appendTo: '#ewd-ufaq-jquery-ajax-search',
    222                         select: function( event, ui ) {
    223                                 jQuery( this ).val( ui.item.value );
    224                                 ewd_ufaq_ajax_reload();
    225                         }
    226                 });
    227 
    228                 jQuery( '.ewd-ufaq-text-auto-complete' ).autocomplete( 'enable' );
    229         });
    230 }
     93                context_document.find( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
     94        });
     95}
     96
     97
    23198
    23299function EWD_UFAQ_Reveal_FAQ( faq_element ) {
     100        if ( ! faq_element || ! faq_element.length ) { return; }
    233101
    234102        var post_id = faq_element.data( 'post_id' );
    … …  
    243111        jQuery.post(ajaxurl, data, function(response) {});
    244112
    245         faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html( faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html().toUpperCase() );
     113        faq_element.find( '.ewd-ufaq-post-margin-symbol' ).each( function() { jQuery( this ).text( jQuery( this ).text().toUpperCase() ); } );
    246114
    247115        faq_element.find( '.ewd-ufaq-faq-excerpt' ).addClass( 'ewd-ufaq-hidden' );
    248116       
    249         if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect != 'none' ) { ewd_ufaq_run_effect( 'show', faq_element ); }
     117        if ( typeof ewd_ufaq_run_effect === 'function' && typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect && ewd_ufaq_php_data.reveal_effect != 'none' ) { ewd_ufaq_run_effect( 'show', faq_element ); }
    250118        else { faq_element.find( '.ewd-ufaq-faq-body' ).removeClass( 'ewd-ufaq-hidden' ); }
    251119                       
    252120        if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.faq_accordion ) {
    253121
    254                 jQuery( '.ewd-ufaq-faq-div' ).each( function() {
     122                jQuery( faq_element[0].ownerDocument ).find( '.ewd-ufaq-faq-div' ).each( function() {
    255123
    256124                        if ( jQuery( this ).prop( 'id' ) != faq_element.prop( 'id' ) ) {
    … …  
    271139
    272140function EWD_UFAQ_Hide_FAQ( faq_element ) {
     141        if ( ! faq_element || ! faq_element.length ) { return; }
    273142
    274143        var post_id = faq_element.data( 'post_id' );
    … …  
    276145        faq_element.find( '.ewd-ufaq-faq-excerpt' ).removeClass( 'ewd-ufaq-hidden' );
    277146
    278         if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect != 'none' && ! faq_element.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) { ewd_ufaq_run_effect( 'hide', faq_element ); }
     147        if ( typeof ewd_ufaq_run_effect === 'function' && typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect && ewd_ufaq_php_data.reveal_effect != 'none' && ! faq_element.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) { ewd_ufaq_run_effect( 'hide', faq_element ); }
    279148        else { faq_element.find( '.ewd-ufaq-faq-body' ).addClass( 'ewd-ufaq-hidden' ); }
    280149
    281150        faq_element.removeClass( 'ewd-ufaq-post-active' );
    282         faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html( faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html().toLowerCase() );
     151        faq_element.find( '.ewd-ufaq-post-margin-symbol' ).each( function() { jQuery( this ).text( jQuery( this ).text().toLowerCase() ); } );
    283152}
    284153
    285154jQuery(document).ready(function() {
    286 
    287         if( 0 < jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).eq(0).length ) {
    288                 ajax_ctrlr.schdl_to_run_hndl = setInterval(ajax_ctrlr.schedule_to_run, ajax_ctrlr.schdl_to_run_delay);
    289         }
    290 
    291         jQuery( '#ewd-ufaq-ajax-search-submit' ).click( function() {
    292                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', 1 );
    293                 let elm = jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).eq(0);
    294                 ajax_ctrlr.run_search_ajax( elm[0] );
    295         });
    296 
    297         jQuery( '#ewd-ufaq-jquery-ajax-search' ).on( 'keyup', '.ewd-ufaq-text-input', function() {
    298                 ajax_ctrlr.run_search_ajax( this );
    299         });
    300 
    301         // clear search field
    302         jQuery( '#ewd-ufaq-jquery-ajax-search' ).on( 'click', '.clear-field', function() {
    303                 let elm = jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).eq(0);
    304                 jQuery(elm).val('');
    305                 ajax_ctrlr.run_search_ajax( elm[0] );
    306         });
    307 
    308         jQuery( '.ewd-ufaq-text-input ' ).on( 'search', function() {
    309                 ajax_ctrlr.run_search_ajax( this );
    310         });
    311 
    312155        if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.display_faq > 0 ) {
    313156               
    … …  
    322165});
    323166
    324 var request_count = 0;
    325 function ewd_ufaq_ajax_reload( pagination, append_results, search_string ) {
    326 
    327         filtering_running = true;
    328 
    329         var search_string = search_string ? search_string : jQuery( '.ewd-ufaq-text-input' ).val();
    330         var include_cat = jQuery( '#ewd-ufaq-include-category' ).val();
    331         var exclude_cat = jQuery( '#ewd-ufaq-exclude-category' ).val();
    332         var orderby = jQuery( '#ewd-ufaq-orderby' ).val();
    333         var order = jQuery( '#ewd-ufaq-order' ).val();
    334         var post_count = jQuery( '#ewd-ufaq-post-count' ).val();
    335         var current_url = jQuery( '#ewd-ufaq-current-url' ).val();
    336         var show_on_load = jQuery( '#ewd-ufaq-show-on-load' ).val();
    337 
    338         if ( search_string == undefined ) { search_string = ''; }
    339 
    340         if ( pagination == 'Yes' ) {
    341 
    342                 var faqs_only = 'Yes';
    343                 var faq_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    344         }
    345         else {
    346 
    347                 var retrieving_results = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.retrieving_results : 'Retrieving Results';
    348 
    349                 jQuery( '.ewd-ufaq-search .ewd-ufaq-faqs' ).html( '<h3>' + retrieving_results + '</h3>' );
    350 
    351                 var faqs_only = 'No';
    352                 var faq_page = 0;
    353                 jQuery( '.ewd-ufaq-bottom' ).remove();
    354         }
    355 
    356         request_count = request_count + 1;
    357 
    358     if ( jQuery( '.ewd-ufaq-text-input' ).length && 'yes' != show_on_load.toLocaleLowerCase() && search_string.length == 0 ) {
    359         jQuery( '.ewd-ufaq-search .ewd-ufaq-faqs' ).html('');
    360         return;
    361     }
    362 
    363         var params = {};
    364 
    365         params.search_string    = search_string;
    366         params.include_category = include_cat;
    367         params.exclude_category = exclude_cat;
    368         params.orderby = orderby;
    369         params.order   = order;
    370         params.post_count    = post_count;
    371         params.request_count = request_count;
    372         params.current_url   = current_url;
    373         params.faqs_only = faqs_only;
    374         params.faq_page  = faq_page;
    375         params.show_on_load = show_on_load;
    376         params.action = 'ewd_ufaq_search';
    377         params.nonce  = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.nonce : '';
    378 
    379         var data = jQuery.param( params );
    380 
    381         jQuery.post( ajaxurl, data, function( response ) {
    382 
    383                 if ( ! response || ! response.success || ! response.data ) { return; }
    384                 if ( response.data.analytics && response.data.analytics.endpoint && response.data.analytics.token ) {
    385                         try {
    386                                 var analyticsKey = 'ewdUfaqAnalytics:' + response.data.analytics.storage_key;
    387                                 if ( ! window.sessionStorage.getItem( analyticsKey ) ) {
    388                                         window.sessionStorage.setItem( analyticsKey, '1' );
    389                                         window.fetch( response.data.analytics.endpoint, { method: 'POST', credentials: 'omit', keepalive: true, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify( { event: response.data.analytics.event, token: response.data.analytics.token } ) } ).catch( function() {} );
    390                                 }
    391                         } catch ( analyticsError ) {}
    392                 }
    393                
    394                 if ( response.data.request_count == request_count ) {
    395 
    396                         var data_output_selector = search_string || jQuery( '.ewd-ufaq-faq-list' ).prev().is( '#ewd-ufaq-jquery-ajax-search' ) ? '#ewd-ufaq-jquery-ajax-search + .ewd-ufaq-faq-list .ewd-ufaq-faqs' : '.ewd-ufaq-faqs:not(#ewd-ufaq-jquery-ajax-search + .ewd-ufaq-faq-list .ewd-ufaq-faqs)';
    397 
    398                         if ( ! jQuery( data_output_selector ).length ) { data_output_selector = '.ewd-ufaq-faqs'; }
    399 
    400                         if ( append_results == 'Yes' ) {
    401                                 jQuery( data_output_selector ).append( response.data.output );
    402                         }
    403                         else {
    404                                 jQuery( data_output_selector ).html( response.data.output );
    405                                 if( '' != response.data.pagination ) {
    406                                         jQuery('.ewd-ufaq-faq-list .ewd-ufaq-bottom').remove();
    407                                         jQuery('.ewd-ufaq-faq-list').append(response.data.pagination);
    408                                 }
    409                         }
    410 
    411                         jQuery( '.ewd-ufaq-bottom' ).data( 'max_page', response.data.max_page );
    412 
    413                         jQuery( '.ewd-ufaq-expand-all' ).removeClass( 'ewd-ufaq-hidden' );
    414                         jQuery( '.ewd-ufaq-collapse-all' ).addClass( 'ewd-ufaq-hidden' );
    415 
    416                         ufaqSetClickHandlers();
    417                         UFAQSetRatingHandlers();
    418                         UFAQSetPaginationHandlers();
    419                         UFAQUpdatePaginationButtons();
    420                         UFAQSetExpandCollapseHandlers();
    421 
    422                         filtering_running = false;
    423                 }
    424         });
    425 }
    426 
    427 function UFAQSetRatingHandlers() {
    428 
    429         jQuery( '.ewd-ufaq-rating-button' ).off( 'click' ).on( 'click', function() {
    430                
    431                 var faq_id = jQuery( this ).data( 'faq_id' );
    432                 jQuery( '*[data-faq_id="' + faq_id + '"]' ).off( 'click' );
    433 
    434                 var current_count = jQuery( this ).find( 'span' ).html();
    435                 current_count++;
    436                 jQuery( this ).find( 'span' ).html( current_count );
    437 
    438                 if ( jQuery( this ).hasClass( 'ewd-ufaq-up-vote' ) ) { vote_type = 'up'; }
    439                 else { vote_type = 'down'; }
    440 
    441                 var params = {};
    442 
    443                 params.action = 'ewd_ufaq_update_rating';
    444                 params.nonce  = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.nonce : '';
    445                 params.faq_id = faq_id;
    446                 params.vote_type = vote_type;
    447 
    448                 var data = jQuery.param( params );
    449                 jQuery.post( ajaxurl, data );
    450         });
    451 }
    452 
    453 function UFAQSetExpandCollapseHandlers() {
    454 
    455         jQuery('.ewd-ufaq-expand-all').off('click').on('click', function() {
     167
     168
     169
     170
     171function UFAQSetExpandCollapseHandlers( context ) {
     172        var interaction_scope = context ? jQuery( context ) : jQuery( document );
     173
     174        interaction_scope.find('.ewd-ufaq-expand-all').off('click').on('click', function() {
     175                var context_document = jQuery( this.ownerDocument );
    456176               
    457177                var accordion_setting = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.faq_accordion : false;
    458                 ewd_ufaq_php_data.faq_accordion = false; // turn FAQ accordion off while expanding all
    459 
    460                 jQuery( '.ewd-ufaq-faq-toggle' ).each( function() {
     178                if ( typeof ewd_ufaq_php_data != 'undefined' ) { ewd_ufaq_php_data.faq_accordion = false; } // turn FAQ accordion off while expanding all
     179
     180                context_document.find( '.ewd-ufaq-faq-toggle' ).each( function() {
    461181
    462182                        var faq = jQuery(this).parent();
    … …  
    469189                if ( typeof ewd_ufaq_php_data != 'undefined' ) { ewd_ufaq_php_data.faq_accordion = accordion_setting; } //reset FAQ accordion setting
    470190
    471                 jQuery('.ewd-ufaq-faq-category-inner').removeClass('ewd-ufaq-faq-category-body-hidden');
    472                 jQuery('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
    473                 jQuery('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
    474 
    475                 jQuery( '.ewd-ufaq-faq-category-title-toggle' ).addClass( 'ewd-ufaq-category-tab-selected' );
    476                 jQuery( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
    477                         jQuery( this ).html().toUpperCase();
    478                 });
    479         });
    480 
    481         jQuery('.ewd-ufaq-collapse-all').off('click').on('click', function() {
    482 
    483                 jQuery('.ewd-ufaq-faq-toggle').each(function() {
     191                context_document.find('.ewd-ufaq-faq-category-inner').removeClass('ewd-ufaq-faq-category-body-hidden');
     192                context_document.find('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
     193                context_document.find('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
     194
     195                context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).addClass( 'ewd-ufaq-category-tab-selected' );
     196                context_document.find( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
     197                        jQuery( this ).text( jQuery( this ).text().toUpperCase() );
     198                });
     199        });
     200
     201        interaction_scope.find('.ewd-ufaq-collapse-all').off('click').on('click', function() {
     202                var context_document = jQuery( this.ownerDocument );
     203
     204                context_document.find('.ewd-ufaq-faq-toggle').each(function() {
    484205
    485206                        var faq = jQuery(this).parent();
    … …  
    490211                });
    491212
    492                 jQuery( '.ewd-ufaq-faq-category-inner' ).addClass( 'ewd-ufaq-faq-category-body-hidden' );
    493                 jQuery( '.ewd-ufaq-faq-category-title-toggle' ).removeClass( 'ewd-ufaq-category-tab-selected' );
    494 
    495                 jQuery( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
    496                         jQuery( this ).html().toLowerCase();
    497                 });
    498 
    499                 jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
    500                 jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
    501         });
    502 }
    503 
    504 function UFAQSetPaginationHandlers() {
    505 
    506         jQuery('.ewd-ufaq-previous-faqs').off( 'click' ).on('click', function() {
    507 
    508                 var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    509 
    510                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', Math.max( current_page - 1, 0 ) );
    511                 jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
    512 
    513                 ewd_ufaq_ajax_reload( 'Yes', 'No' );
    514         });
    515 
    516         jQuery('.ewd-ufaq-next-faqs').off( 'click' ).on('click', function() {
    517 
    518                 var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    519 
    520                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', current_page + 1 );
    521                 jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
    522 
    523                 ewd_ufaq_ajax_reload( 'Yes', 'No' );
    524         });
    525 
    526         jQuery( '.ewd-ufaq-load-more' ).off( 'click' ).on( 'click', function() {
    527 
    528                 var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    529 
    530                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', current_page + 1 );
    531                 jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
    532 
    533                 ewd_ufaq_ajax_reload( 'Yes', 'Yes' );
    534         });
    535 
    536         if ( jQuery( '.ewd-ufaq-pagination-infinite_scroll' ).length ) {
    537 
    538                 jQuery( window ).scroll( function() {
    539 
    540                         var infinite_pos = jQuery( '.ewd-ufaq-pagination-infinite_scroll').position();
    541 
    542                         if ( infinite_pos != undefined && jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) != jQuery( '.ewd-ufaq-bottom' ).data( 'max_page' ) ) {
    543 
    544                                 if  ( ( jQuery( window ).height() + jQuery( window ).scrollTop() > infinite_pos.top ) && filtering_running == false ) {
    545 
    546                                         jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) + 1 );
    547 
    548                                         ewd_ufaq_ajax_reload( 'Yes', 'Yes' );
    549                                 }
    550                         }
    551                 });
    552         }
    553 }
    554 
    555 function UFAQUpdatePaginationButtons() {
    556 
    557         jQuery('.ewd-ufaq-bottom').first().appendTo('.ewd-ufaq-faq-list');
    558 
    559         if ( jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) < jQuery( '.ewd-ufaq-bottom' ).data( 'max_page' ) ) {
    560 
    561                 jQuery( '.ewd-ufaq-load-more, .ewd-ufaq-next-faqs' ).removeClass( 'ewd-ufaq-hidden' );
    562         }
    563         else { jQuery( '.ewd-ufaq-load-more, .ewd-ufaq-next-faqs' ).addClass( 'ewd-ufaq-hidden' ); }
    564 
    565         if ( jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) <= 1 ) {
    566 
    567                 jQuery( '.ewd-ufaq-previous-faqs' ).addClass( 'ewd-ufaq-hidden' );
    568         }
    569         else { jQuery( '.ewd-ufaq-previous-faqs' ).removeClass( 'ewd-ufaq-hidden' ); }
    570 }
    571 
    572 function UFAQWPFormsHandler() {
    573        
    574         if ( typeof wpforms_integration === 'undefined' || wpforms_integration === null ) { return; }
    575 
    576         if ( wpforms_integration.ufaq_enabled == 'disabled' ) { return; }
    577 
    578         var target_field = wpforms_integration.ufaq_selected_field;
    579 
    580         jQuery( '#wpforms-' + wpforms_integration.form_id + '-field_' + wpforms_integration.ufaq_selected_field ).on( 'keyup', function() {
    581 
    582                 var search_string = jQuery( this ).val();
    583 
    584                 if ( search_string.length >= wpforms_integration.ufaq_minimum_characters ) {
    585 
    586                         jQuery( '.ewd-ufaq-wpforms-faq-results' ).removeClass( 'ewd-ufaq-hidden' );
    587                         jQuery( '.ewd-ufaq-wpforms-label' ).removeClass( 'ewd-ufaq-hidden' );
    588 
    589                         ewd_ufaq_ajax_reload( 'No', 'No', search_string );
    590                 }
    591                 else if ( ! filtering_running ) {
    592 
    593                         jQuery( '.ewd-ufaq-faqs' ).html( ' ' );
    594                         jQuery( '.ewd-ufaq-wpforms-faq-results' ).addClass( 'ewd-ufaq-hidden' );
    595                         jQuery( '.ewd-ufaq-wpforms-label' ).addClass( 'ewd-ufaq-hidden' );
    596                 }
    597 
    598         });
    599 }
     213                context_document.find( '.ewd-ufaq-faq-category-inner' ).addClass( 'ewd-ufaq-faq-category-body-hidden' );
     214                context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).removeClass( 'ewd-ufaq-category-tab-selected' );
     215
     216                context_document.find( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
     217                        jQuery( this ).text( jQuery( this ).text().toLowerCase() );
     218                });
     219
     220                context_document.find('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
     221                context_document.find('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
     222        });
     223}
     224
     225
     226
     227
     228
     229
    600230
    601231/*jQuery(document).ready(function() {
    … …  
    626256});*/
    627257
    628 jQuery( document ).ready( function() {
    629        
    630         jQuery( '.ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink a' ).html( '<span class="dashicons dashicons-admin-links"></span>' );
    631         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-facebook a' ).html( '<span class="dashicons dashicons-facebook-alt"></span>' );
    632         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-twitter a' ).html( '<span class="dashicons dashicons-twitter-alt"></span>' );
    633         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-linkedin a' ).html( '<span class="dashicons dashicons-linkedin"></span>' );
    634         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-pinterest a' ).html( '<span class="dashicons dashicons-pinterest"></span>' );
    635         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-email a' ).html( '<span class="dashicons dashicons-email-alt"></span>' );
    636         jQuery( '.ewd-ufaq-compact-faq-meta .ewd-ufaq-up-vote' ).prepend( '<span class="dashicons dashicons-thumbs-up"></span>' );
    637         jQuery( '.ewd-ufaq-compact-faq-meta .ewd-ufaq-down-vote' ).prepend( '<span class="dashicons dashicons-thumbs-down"></span>' );
    638 } );
  • ultimate-faqs/tags/2.7.0/ewd-ufaq-templates/faq.php

    r3352283 r3821169  
    77        <?php $this->maybe_print_faq_preview(); ?>
    88
    9         <div class='ewd-ufaq-faq-body<?php echo ( ! $this->display_all_answers ? ' ewd-ufaq-hidden' : '' ); ?><?php echo ( $ewd_ufaq_controller->settings->get_setting( 'compact-faq-meta' ) ? ' ewd-ufaq-compact-faq-meta' : '' ); ?>' >
     9        <div <?php echo ewd_format_classes( $this->get_body_classes() ); ?>>
    1010
    1111                <?php foreach ( $this->get_order_elements() as $element => $label ) { ?>
  • ultimate-faqs/tags/2.7.0/ewd-ufaq-templates/faqs-search-submit.php

    r2643489 r3821169  
    1 <label for='ewd-ufaq-search-submit'></label>
    2 
    3 <input type='button' id='ewd-ufaq-ajax-search-submit' name='Search' value='<?php echo esc_html( $this->get_label( 'label-search' ) ); ?>'>
     1<?php
     2// Compatibility template identity; Helper supplies advanced-search controls.
     3echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'advanced_search_submit', $this );
  • ultimate-faqs/tags/2.7.0/ewd-ufaq-templates/faqs-search.php

    r2830708 r3821169  
    1 <div id='ewd-ufaq-jquery-ajax-search'>
    2 
    3         <label class='ewd-ufaq-field-label' for='ewd-ufaq-text-search'>
    4                 <?php echo esc_html( $this->get_label( 'label-enter-question' ) ); ?>:
    5         </label>
    6 
    7         <?php $this->maybe_print_shortcode_args(); ?>
    8 
    9         <div class="search-field">
    10                 <input
    11                         id='ewd-ufaq-text-search'
    12                         type='search'
    13                         class='ewd-ufaq-text-input <?php echo ( $this->get_option( 'auto-complete-titles' ) ? 'ewd-ufaq-text-auto-complete' : '' ); ?>'
    14                         placeholder='<?php echo esc_attr( $this->get_label( 'label-search-placeholder' ) ); ?>'
    15                         value='<?php echo ( isset( $_GET['faq_search_term'] ) ? esc_attr( $_GET['faq_search_term'] ) : '' ); ?>' />
    16                 <button type="button" class="clear-field" data-state="hidden">x</button>
    17         </div>
    18 
    19         <?php $this->maybe_print_search_submit(); ?>
    20 
    21 </div>
     1<?php
     2// Compatibility template identity. Free's ordinary GET form is owned by BasicSearch.
     3echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'advanced_search_form', $this );
  • ultimate-faqs/tags/2.7.0/includes/AIAssist.class.php

    r3704732 r3821169  
    99if ( !class_exists( 'ewdufaqAIAssist' ) ) {
    1010class ewdufaqAIAssist {
     11        public static function limits( $operation ) {
     12                $defaults = array( 'sources' => 1, 'faqs' => 1 );
     13                $limits = apply_filters( 'ewd_ufaq_legacy_ai_limits', $defaults, $operation );
     14                foreach ( $defaults as $key => $value ) { if ( ! is_array( $limits ) || ! isset( $limits[ $key ] ) || ! is_int( $limits[ $key ] ) || $limits[ $key ] < 1 ) { return $defaults; } }
     15                return array_intersect_key( $limits, $defaults );
     16        }
    1117
    1218        public function __construct() {
    … …  
    4147
    4248                if ( ! isset( $post_type ) or $post_type != EWD_UFAQ_FAQ_POST_TYPE ) { return; }
     49                $limits = self::limits( 'render' );
    4350
    4451                $args = array(
    … …  
    96103                                                <select id='ewd-ufaq-ai-faqs-count'>
    97104
    98                                                         <?php for ( $i = 1; $i <= ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ? 1 : 20 ) ; $i++ ) { ?>
     105                                                        <?php for ( $i = 1; $i <= $limits['faqs']; $i++ ) { ?>
    99106
    100107                                                                <option value='<?php echo $i; ?>'>
    … …  
    106113                                                </select>
    107114
    108                                                 <?php if ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ) { ?>
     115                                                <?php if ( 1 === $limits['faqs'] ) { ?>
    109116
    110117                                                        <div class='ewd-ufaq-ai-no-premium-explanation'>
    … …  
    122129                                                </label>
    123130
    124                                                 <select id='ewd-ufaq-ai-faqs-content' <?php echo ( $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ? 'multiple=\'multiple\'' : '' ); ?>>
     131                                                <select id='ewd-ufaq-ai-faqs-content' <?php echo $limits['sources'] > 1 ? 'multiple="multiple"' : ''; ?>>
    125132
    126133                                                        <?php foreach ( $content_options as $post_type => $posts ){ ?>
    … …  
    232239                }
    233240
    234                 $is_premium = $ewd_ufaq_controller->permissions->check_permission( 'premium' );
     241                $limits = self::limits( 'retrieve' );
    235242                $selected_posts = array_values( array_unique( array_filter( array_map( 'absint', $selected_raw ) ) ) );
    236                 $selected_posts = array_slice( $selected_posts, 0, $is_premium ? 20 : 1 );
    237                 $faq_count = min( max( 1, isset( $_POST['faq_count'] ) ? absint( $_POST['faq_count'] ) : 1 ), $is_premium ? 20 : 1 );
     243                $selected_posts = array_slice( $selected_posts, 0, $limits['sources'] );
     244                $faq_count = min( max( 1, isset( $_POST['faq_count'] ) ? absint( $_POST['faq_count'] ) : 1 ), $limits['faqs'] );
    238245                $set_categories = isset( $_POST['set_categories'] ) && 'yes' === sanitize_text_field( wp_unslash( $_POST['set_categories'] ) );
    239246
    … …  
    399406                }
    400407
    401                 $limit = $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ? 20 : 1;
     408                $limits = self::limits( 'publish' );
     409                $limit = $limits['faqs'];
    402410                $faqs = array_slice( $this->sanitize_faqs( $faqs_raw ), 0, $limit );
    403411                foreach ( $faqs as $faq ) {
  • ultimate-faqs/tags/2.7.0/includes/Ajax.class.php

    r3744649 r3821169  
    1010        class ewdufaqAJAX {
    1111
    12                 public function __construct() {
     12                public function __construct( $register = true ) {
     13                        if ( ! $register ) { return; }
    1314
    14                         add_action( 'wp_ajax_ewd_ufaq_search', array( $this, 'return_search_results' ) );
    15                         add_action( 'wp_ajax_nopriv_ewd_ufaq_search', array( $this, 'return_search_results' ) );
    16 
    17                         add_action( 'wp_ajax_ewd_ufaq_record_search_term', array( $this, 'save_search_term' ) );
    18                         add_action( 'wp_ajax_nopriv_ewd_ufaq_record_search_term', array( $this, 'save_search_term' ) );
    1915
    2016                        add_action( 'wp_ajax_ewd_ufaq_reset_saved_search_terms', array( $this, 'reset_saved_search_term' ) );
    … …  
    2319                        add_action( 'wp_ajax_nopriv_ewd_ufaq_record_view', array( $this, 'record_view' ) );
    2420
    25                         add_action( 'wp_ajax_ewd_ufaq_update_rating', array( $this, 'update_rating' ) );
    26                         add_action( 'wp_ajax_nopriv_ewd_ufaq_update_rating', array( $this, 'update_rating' ) );
    2721
    28                         add_action( 'wp_ajax_ewd_ufaq_update_faq_order', array( $this, 'update_faq_order' ) );
    29 
    30                         add_action( 'wp_ajax_ewd_ufaq_update_category_order', array( $this, 'update_category_order' ) );
    3122                }
    3223
    … …  
    3627                 */
    3728                public function return_search_results() {
    38                         global $ewd_ufaq_controller;
    39                         if ( !check_ajax_referer( 'ewd-ufaq-js', 'nonce' ) ) {
    40                                 ewdufaqHelper::bad_nonce_ajax();
    41                         }
    42 
    43                         if ( $ewd_ufaq_controller->helper_compatibility->get_state() !== 'compatible'
    44                                 || ! $ewd_ufaq_controller->permissions->check_permission( 'search' ) ) {
    45 
    46                                 wp_send_json_error( array( 'code' => 'advanced_search_unavailable' ), 403 );
    47                         }
    48                         $faq_atts = array(
    49                                 'is_search'                                     => 1,
    50                                 'search_string'                         => '',
    51                                 'post__in'                                      => '',
    52                                 'post__in_string'                       => '',
    53                                 'include_tag'                           => '',
    54                                 'include_category'                      => isset( $_POST['include_category'] ) ? sanitize_text_field( $_POST['include_category'] ) : '', //so that only the matching category is displayed
    55                                 'exclude_category'                      => '',
    56                                 'include_category_ids'          => '',
    57                                 'exclude_category_ids'          => '',
    58                                 'include_category_children'     => '',
    59                                 'no_comments'                           => '',
    60                                 'orderby'                                       => '',
    61                                 'order'                                         => '',
    62                                 'display_all_answers'           => '',
    63                                 'faq_page'                                      => 1,
    64                                 'post_count'                            => -1
    65                         );
    66 
    67                         $query = new ewdufaqQuery( $faq_atts );
    68 
    69                         $query->parse_request_args();
    70                         $query->prepare_args();
    71 
    72                         $faq_atts['search_string'] = isset( $_REQUEST['search_string'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search_string'] ) ) : '';
    73                         $faqs = new ewdufaqViewFAQs( $faq_atts );
    74 
    75                         $faqs->set_request_parameters();
    76 
    77                         $faqs->set_faqs( $query->get_faqs() );
    78 
    79                         $faqs->set_faqs_options();
    80 
    81                         $faqs->create_faq_data();
    82 
    83                         $faqs->set_faq_properties();
    84 
    85                         ob_start();
    86 
    87                         $ewd_ufaq_controller->shortcode_printing = true;
    88 
    89                         $faqs->print_faqs();
    90 
    91                         $ewd_ufaq_controller->shortcode_printing = false;
    92 
    93                         $output = ob_get_clean();
    94 
    95                         $pagination = '';
    96                         if('yes' != $faqs->show_on_load && 2 > $faqs->faq_page) {
    97                                 ob_start();
    98                                 $faqs->maybe_print_pagination();
    99                                 $pagination = ob_get_clean();
    100                         }
    101 
    102                         $output = $output ? $output : '<div class="ewd-ufaq-no-results-found">' . sprintf( $ewd_ufaq_controller->settings->get_setting( 'label-no-results-found' ), $query->args['search_string'] ) . '</div>';
    103 
    104                         do_action( 'ewd_ufaq_advanced_search_completed', $query->args['search_string'], count( $faqs->displayed_faqs ), $faq_atts );
    105                         $analytics = apply_filters( 'ewd_ufaq_advanced_search_analytics', array(), $query->args['search_string'], count( $faqs->displayed_faqs ), $faq_atts );
    106                         wp_send_json_success(
    107                                 array(
    108                                         'output'                => $output,
    109                                         'pagination'    => $pagination,
    110                                         'faq_count'     => $faqs->faq_count,
    111                                         'max_page'              => $faqs->max_page,
    112                                         'request_count' => intval( $_POST['request_count'] ),
    113                                         'analytics'             => $analytics,
    114                                 )
    115                         );
    116 
    117                     die();
     29                        if ( class_exists( 'ewdufaqEWDPHSearch', false ) ) { return ( new ewdufaqEWDPHSearch( false ) )->return_search_results(); }
     30                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    11831                }
    11932
    … …  
    14457                 */
    14558                public function update_rating() {
    146                         global $ewd_ufaq_controller;
    147                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ) {
    148                                 wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    149                         }
    150 
    151                         if ( !check_ajax_referer( 'ewd-ufaq-js', 'nonce' ) ) {
    152                                 ewdufaqHelper::bad_nonce_ajax();
    153                         }
    154 
    155                         $faq_id = isset( $_POST['faq_id'] ) ? absint( $_POST['faq_id'] ) : 0;
    156                         $vote_type = isset( $_POST['vote_type'] ) ? sanitize_key( wp_unslash( $_POST['vote_type'] ) ) : '';
    157 
    158                         if ( ! $this->is_public_faq( $faq_id ) || ! in_array( $vote_type, array( 'up', 'down' ), true ) ) {
    159 
    160                                 wp_send_json_error( array( 'code' => 'invalid_rating' ), 400 );
    161                         }
    162 
    163                         if ( ! $this->allow_public_event( 'rating', $faq_id, DAY_IN_SECONDS ) ) { wp_send_json_success( array( 'duplicate' => true ) ); }
    164 
    165                         if ( 'up' === $vote_type ) {
    166 
    167                                 $this->increment_post_meta( $faq_id, 'FAQ_Up_Votes', 1 );
    168                                 $this->increment_post_meta( $faq_id, 'FAQ_Total_Score', 1 );
    169                         }
    170                         else {
    171 
    172                                 $this->increment_post_meta( $faq_id, 'FAQ_Down_Votes', 1 );
    173                                 $this->increment_post_meta( $faq_id, 'FAQ_Total_Score', -1 );
    174                         }
    175 
    176                         do_action( 'ewd_ufaq_public_faq_helpfulness', $faq_id, $vote_type );
    177 
    178                         wp_send_json_success();
     59                        if ( class_exists( 'ewdufaqEWDPHPaidAjax', false ) ) { return ewdufaqEWDPHPaidAjax::update_rating( $this ); }
     60                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    17961                }
    18062
    … …  
    18466                 */
    18567                public function update_faq_order() {
    186                         global $ewd_ufaq_controller;
    187 
    188                         if (
    189                                 ! check_ajax_referer( 'ewd-ufaq-admin-js', 'nonce' )
    190                                 ||
    191                                 ! current_user_can( $ewd_ufaq_controller->settings->get_setting( 'access-role' ) )
    192                         ) {
    193                                 ewdufaqHelper::admin_nopriv_ajax();
    194                         }
    195 
    196                         if ( ! is_array( $_POST['ewd-ufaq-item'] ) or ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) { return; }
    197 
    198                 foreach ( $_POST['ewd-ufaq-item'] as $key => $id ) {
    199 
    200                     update_post_meta( intval( $id ), 'ufaq_order', intval( $key ) + 1 );
    201                 }
    202 
    203                         die();
     68                        if ( class_exists( 'ewdufaqEWDPHOrdering', false ) ) { return ewdufaqEWDPHOrdering::save_faq(); }
     69                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    20470                }
    20571
    … …  
    20975                 */
    21076                public function update_category_order() {
    211                         global $ewd_ufaq_controller;
    212                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) {
    213                                 wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    214                         }
    215 
    216                         // Authenticate request
    217                         if (
    218                                 ! check_ajax_referer( 'ewd-ufaq-admin-js', 'nonce' )
    219                                 ||
    220                                 ! current_user_can( $ewd_ufaq_controller->settings->get_setting( 'access-role' ) )
    221                         ) {
    222                                 ewdufaqHelper::admin_nopriv_ajax();
    223                         }
    224 
    225                         $ids = is_array( $_POST['tag'] ) ? array_map( 'intval', $_POST['tag'] ) : array();
    226                
    227                         foreach ( $ids as $order => $term_id ) {
    228 
    229                                 update_term_meta( $term_id, 'ufaq_category_order', $order );
    230                         }
     77                        if ( class_exists( 'ewdufaqEWDPHOrdering', false ) ) { return ewdufaqEWDPHOrdering::save_category(); }
     78                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    23179                }
    23280
    … …  
    23684                 */
    23785                public function save_search_term() {
    238                         global $ewd_ufaq_controller;
    239                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'search' ) ) {
    240                                 wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    241                         }
    242 
    243                         if ( !check_ajax_referer( 'ewd-ufaq-js', 'nonce' ) ) {
    244                                 ewdufaqHelper::bad_nonce_ajax();
    245                         }
    246 
    247                         if ( empty( $ewd_ufaq_controller->settings->get_setting( 'save-search-terms' ) ) ) { return; }
    248 
    249                         $search_term = isset( $_POST['search_term'] ) ? sanitize_text_field( wp_unslash( $_POST['search_term'] ) ) : '';
    250                         $search_term = function_exists( 'mb_substr' ) ? mb_substr( $search_term, 0, 200 ) : substr( $search_term, 0, 200 );
    251                         if ( empty( $search_term ) or strlen( $search_term ) < 2 ) { die(); }
    252 
    253                         $search_terms = get_option( 'ewd-ufaq-search-data', array() );
    254 
    255                         if ( isset( $search_terms[ $search_term ] ) ) {
    256 
    257                                 $search_terms[ $search_term ]++;
    258                         }
    259                         elseif ( count( $search_terms ) < 1000 ) {
    260 
    261                                 $search_terms[ $search_term ] = 1;
    262                         }
    263                         update_option( 'ewd-ufaq-search-data', $search_terms );
    264 
    265                         die();
     86                        if ( class_exists( 'ewdufaqEWDPHSearch', false ) ) { return ( new ewdufaqEWDPHSearch( false ) )->save_search_term(); }
     87                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    26688                }
    26789
  • ultimate-faqs/tags/2.7.0/includes/AnalyticsBridge.class.php

    r3704732 r3821169  
    11<?php
    2 /**
    3  * Common analytics event bridge. Free registers no analytics storage or public route.
    4  */
    5 
    6 if ( ! defined( 'ABSPATH' ) ) {
    7         exit;
    8 }
    9 
    10 if ( ! class_exists( 'ewdufaqAnalyticsBridge' ) ) {
    11         class ewdufaqAnalyticsBridge {
    12 
    13                 private $contexts        = array();
    14                 private $assets_enqueued = false;
    15 
    16                 public function __construct() {
    17 
    18                         add_action( 'ewd_ufaq_basic_search_rendered', array( $this, 'register_search' ), 10, 5 );
    19                         add_action( 'ewd_ufaq_faq_rendered', array( $this, 'register_faq' ), 10, 2 );
    20                         add_filter( 'ewd_ufaq_advanced_search_analytics', array( $this, 'advanced_search_context' ), 10, 4 );
    21                         add_action( 'wp_footer', array( $this, 'print_contexts' ), 5 );
    22                 }
    23 
    24                 public function advanced_search_context( $context, $term, $result_count, $args ) {
    25 
    26                         $term = trim( sanitize_text_field( $term ) );
    27                         if ( '' === $term ) {
    28                                 return $context; }
    29                         $payload  = array(
    30                                 'event'        => 'search',
    31                                 'display_hash' => hash( 'sha256', 'advanced|' . wp_json_encode( $args ) ),
    32                                 'locale'       => determine_locale(),
    33                                 'search_text'  => $term,
    34                                 'query_hash'   => hash( 'sha256', determine_locale() . '|' . $term ),
    35                                 'result_count' => absint( $result_count ),
    36                         );
    37                         $token    = apply_filters( 'ewd_ufaq_analytics_sign_event_context', '', $payload );
    38                         $endpoint = apply_filters( 'ewd_ufaq_analytics_endpoint', '' );
    39                         if ( ! is_string( $token ) || '' === $token || ! is_string( $endpoint ) || '' === $endpoint ) {
    40                                 return $context; }
    41                         return array(
    42                                 'event'       => 'search',
    43                                 'endpoint'    => $endpoint,
    44                                 'token'       => $token,
    45                                 'storage_key' => substr( hash( 'sha256', $payload['query_hash'] . '|' . $payload['display_hash'] . '|' . absint( $result_count ) ), 0, 32 ),
    46                         );
    47                 }
    48 
    49                 public function register_search( $identity, $term, $result_count, $args, $faq_ids = array() ) {
    50 
    51                         $display_hash = hash( 'sha256', $identity . '|' . wp_json_encode( $args ) );
    52                         $this->register_context(
    53                                 array(
    54                                         'event'        => 'search',
    55                                         'display_hash' => $display_hash,
    56                                         'locale'       => determine_locale(),
    57                                         'search_text'  => $term,
    58                                         'query_hash'   => hash( 'sha256', determine_locale() . '|' . $term ),
    59                                         'result_count' => absint( $result_count ),
    60                                         'faq_ids'      => array_slice( array_values( array_unique( array_map( 'absint', $faq_ids ) ) ), 0, 20 ),
    61                                 )
    62                         );
    63                 }
    64 
    65                 public function register_faq( $faq_id, $view ) {
    66 
    67                         $faq_id = absint( $faq_id );
    68 
    69                         if ( ! $faq_id ) {
    70                                 return; }
    71 
    72                         $display_hash = hash( 'sha256', get_queried_object_id() . '|faq|' . $faq_id );
    73 
    74                         foreach ( array( 'open', 'helpful_yes', 'helpful_no' ) as $event ) {
    75 
    76                                 $this->register_context(
    77                                         array(
    78                                                 'event'        => $event,
    79                                                 'display_hash' => $display_hash,
    80                                                 'locale'       => determine_locale(),
    81                                                 'faq_id'       => $faq_id,
    82                                                 'search_text'  => ! empty( $view->search_string ) ? $view->search_string : '',
    83                                                 'query_hash'   => ! empty( $view->search_string ) ? hash( 'sha256', determine_locale() . '|' . $view->search_string ) : '',
    84                                         )
    85                                 );
    86                         }
    87                 }
    88 
    89                 private function register_context( $payload ) {
    90 
    91                         if ( count( $this->contexts ) >= 100 ) {
    92                                 return; }
    93 
    94                         $token    = apply_filters( 'ewd_ufaq_analytics_sign_event_context', '', $payload );
    95                         $endpoint = apply_filters( 'ewd_ufaq_analytics_endpoint', '' );
    96 
    97                         if ( ! is_string( $token ) || '' === $token || ! is_string( $endpoint ) || '' === $endpoint ) {
    98                                 return; }
    99 
    100                         $storage_key = substr( hash( 'sha256', $payload['event'] . '|' . ( isset( $payload['faq_id'] ) ? absint( $payload['faq_id'] ) : 0 ) . '|' . ( isset( $payload['query_hash'] ) ? $payload['query_hash'] : '' ) . '|' . $payload['display_hash'] ), 0, 32 );
    101                         foreach ( $this->contexts as $existing ) {
    102                                 if ( $existing['storage_key'] === $storage_key ) {
    103                                         return; }
    104                         }
    105 
    106                         $this->contexts[] = array(
    107                                 'event'       => $payload['event'],
    108                                 'faq_id'      => isset( $payload['faq_id'] ) ? absint( $payload['faq_id'] ) : 0,
    109                                 'token'       => $token,
    110                                 'storage_key' => $storage_key,
    111                         );
    112 
    113                         if ( ! $this->assets_enqueued ) {
    114 
    115                                 wp_enqueue_script( 'ewd-ufaq-analytics', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-analytics.js', array(), EWD_UFAQ_VERSION, true );
    116                                 $this->assets_enqueued = true;
    117                         }
    118                 }
    119 
    120                 public function print_contexts() {
    121 
    122                         if ( empty( $this->contexts ) ) {
    123                                 return; }
    124 
    125                         wp_add_inline_script(
    126                                 'ewd-ufaq-analytics',
    127                                 'window.ewdUfaqAnalytics=' . wp_json_encode(
    128                                         array(
    129                                                 'endpoint' => apply_filters( 'ewd_ufaq_analytics_endpoint', '' ),
    130                                                 'contexts' => $this->contexts,
    131                                         )
    132                                 ) . ';',
    133                                 'before'
    134                         );
    135                 }
     2/** Compatibility facade. Core render/search events do not collect analytics in Free. */
     3if ( ! defined( 'ABSPATH' ) ) { exit; }
     4class ewdufaqAnalyticsBridge {
     5        public function __construct() {}
     6        public function advanced_search_context( $context, $term, $count, $args ) {
     7                return class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ? ewdufaqEWDPHAnalyticsBridge::instance()->advanced_search_context( $context, $term, $count, $args ) : $context;
     8        }
     9        public function register_search( $identity, $term, $count, $args, $ids = array() ) {
     10                if ( class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ) { ewdufaqEWDPHAnalyticsBridge::instance()->register_search( $identity, $term, $count, $args, $ids ); }
     11        }
     12        public function register_faq( $id, $view ) {
     13                if ( class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ) { ewdufaqEWDPHAnalyticsBridge::instance()->register_faq( $id, $view ); }
     14        }
     15        public function print_contexts() {
     16                if ( class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ) { ewdufaqEWDPHAnalyticsBridge::instance()->print_contexts(); }
    13617        }
    13718}
  • ultimate-faqs/tags/2.7.0/includes/Blocks.class.php

    r3744649 r3821169  
    131131                        wp_enqueue_style( 'ewd-ufaq-css' );
    132132                        wp_enqueue_style( 'ewd-ufaq-blocks-css' );
    133                         wp_enqueue_style( 'ewd-ufaq-rrssb' );
    134                         wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
    135                         if ( 'minimalist' === $ewd_ufaq_controller->settings->get_setting( 'display-style' ) ) {
    136                                 wp_enqueue_style( 'ewd-ufaq-minimalist' );
     133                        $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
     134                        if ( $screen && ( $screen->is_block_editor() || 'widgets' === $screen->id ) ) {
     135                                wp_enqueue_script( 'ewd-ufaq-js' );
     136                                $args = array( 'nonce' => wp_create_nonce( 'ewd-ufaq-js' ), 'faq_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ), 'category_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ), 'faq_scroll' => false );
     137                                wp_add_inline_script( 'ewd-ufaq-js', 'window.ajaxurl=' . wp_json_encode( admin_url( 'admin-ajax.php' ) ) . ';window.ewd_ufaq_php_data=' . wp_json_encode( apply_filters( 'ewd_ufaq_js_localize_data', $args, null ) ) . ';', 'before' );
    137138                        }
    138139                }
  • ultimate-faqs/tags/2.7.0/includes/CustomPostTypes.class.php

    r3704732 r3821169  
    3737
    3838                // Possibly notify FAQ submitted if user-submitted
    39                 add_action( 'pre_post_update',  array( $this, 'maybe_notify_author_on_update' ), 10, 2 );
    4039
    4140                // Sort taxonomy tables by custom ordering, if no other ordering set
    … …  
    215214                $faq_author = $faq_author ? $faq_author : $user->display_name;
    216215
    217 
    218                 $up_votes = get_post_meta( $post->ID, 'FAQ_Up_Votes', true );
    219                 $down_votes = get_post_meta( $post->ID, 'FAQ_Down_Votes', true );
    220 
    221216                ?>
    222217       
    … …  
    230225                </div>
    231226
    232                 <?php if ( $ewd_ufaq_controller->settings->get_setting( 'faq-ratings' ) ) { ?>
    233 
    234                         <div class='ewd-ufaq-meta-field'>
    235                                 <label class='ewd-ufaq-meta-label' for='review_karma'>
    236                                         <?php _e( 'Up Votes:', 'ultimate-faqs' ); ?>
    237                                 </label>
    238                                 <input type='text' id='ewd-ufaq-review-karma' name='up_votes' value='<?php echo esc_attr( $up_votes ); ?>' size='25' />
    239                                 <label class='ewd-ufaq-meta-label' for='review_karma'>
    240                                         <?php _e( 'Down Votes:', 'ultimate-faqs' ); ?>
    241                                 </label>
    242                                 <input type='text' id='ewd-ufaq-review-karma' name='down_votes' value='<?php echo esc_attr( $down_votes ); ?>' size='25' />
    243                         </div>
    244 
    245                 <?php } ?>
    246 
    247                 <?php $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) ); ?>
    248 
    249                 <?php foreach ( $custom_fields as $faq_field ) { ?>
    250 
    251                         <?php $field_value = get_post_meta( $post->ID, "Custom_Field_" . $faq_field->id, true ); ?>
    252 
    253                         <div class='ewd-ufaq-meta-field'>
    254                                 <label class='ewd-ufaq-score-label' for='<?php echo esc_attr( $faq_field->name ); ?>'>
    255                                         <?php echo esc_html( $faq_field->name ) ?>
    256                                 </label>
    257 
    258                                         <?php $options = explode( ',', $faq_field->options ); ?>
    259 
    260                                         <?php if ( $faq_field->type == 'textarea' ) { ?>
    261        
    262                                                         <textarea id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>'>
    263                                                                 <?php echo esc_html( $field_value ); ?>
    264                                                         </textarea>
    265        
    266                                         <?php } elseif ( $faq_field->type == 'select' ) { ?>
    267                                                 <?php if ( ! empty( $options ) ) { ?>
    268        
    269                                                         <select name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>'>
    270                                                                 <?php foreach ( $options as $option ) { ?>
    271        
    272                                                                         <option value='<?php echo esc_attr( $option ); ?>' <?php echo ( $option == $field_value ? 'selected' : '' ); ?> >
    273                                                                                 <?php echo esc_html( $option ); ?>
    274                                                                         </option>
    275                                                                 <?php } ?>
    276                                                         </select>
    277        
    278                                                 <?php } ?>
    279                                         <?php } elseif ( $faq_field->type == 'checkbox' ) { ?>
    280                                                 <?php $field_value = is_array( $field_value ) ? $field_value : array(); ?>
    281                                                 <?php if ( ! empty( $options ) ) { ?>
    282        
    283                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-container'>
    284                                                                 <?php foreach ( $options as $option ) { ?>
    285        
    286                                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-each'>
    287                                                                                 <input type='checkbox' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>[]' value='<?php echo esc_attr( $option ); ?>' <?php echo ( in_array( $option, $field_value ) ? 'checked' : '' ); ?> />
    288                                                                                 <?php echo esc_html( $option ); ?>
    289                                                                         </div>
    290                                                                 <?php } ?>
    291                                                         </div>
    292        
    293                                                 <?php } ?>
    294                                         <?php } elseif ( $faq_field->type == 'radio' ) { ?>
    295                                                 <?php if ( ! empty( $options ) ) { ?>
    296        
    297                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-container'>
    298                                                                 <?php foreach ( $options as $option ) { ?>
    299        
    300                                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-each'>
    301                                                                                 <input type='radio' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $option ); ?>' <?php echo ( $option == $field_value ? 'checked' : '' ); ?> />
    302                                                                                 <?php echo esc_html( $option ); ?>
    303                                                                         </div>
    304                                                                 <?php } ?>
    305                                                         </div>
    306        
    307                                                 <?php } ?>
    308                                         <?php } elseif ( $faq_field->type == 'date' ) { ?>
    309        
    310                                                 <input type='date' class='ewd-ufaq-jquery-datepicker' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' />
    311        
    312                                         <?php } elseif ( $faq_field->type == 'datetime' ) { ?>
    313        
    314                                                 <input type='datetime-local' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' />
    315                                        
    316                                         <?php } elseif ( $faq_field->type == 'file' ) { ?>
    317 
    318                                                 <div class='ewd-ufaq-fields-page-file-preview'>
    319 
    320                                                         <span>
    321                                                                 <?php _e( 'Current File:',  'ultimate-faqs' ); ?> <?php echo ! empty( $field_value ) ? esc_html( basename( $field_value ) ) : ''; ?>
    322                                                         </span>
    323 
    324                                                 </div>
    325 
    326                                                 <input type='file' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' />
    327 
    328                                         <?php } else { ?>
    329        
    330                                                 <input type='text' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' size='25' />
    331        
    332                                         <?php } ?>
    333 
    334                                 </div>
    335 
    336                         <?php
    337                         }
    338                 }
     227                <?php do_action( 'ewd_ufaq_admin_meta_fields', $post );
     228        }
    339229
    340230        /**
    … …  
    357247        public function save_meta( $post_id ) {
    358248                global $ewd_ufaq_controller;
     249                if ( EWD_UFAQ_FAQ_POST_TYPE !== get_post_type( $post_id ) ) { return $post_id; }
    359250
    360251                // Verify nonce
    … …  
    376267                        return $post_id;
    377268                }
    378 
    379                 if ( ! get_post_meta( $post_id, 'ufaq_order', true ) ) { update_post_meta( $post_id, 'ufaq_order', 9999 ); }
    380 
    381                 if ( isset( $_POST['faq_author'] ) )    { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
    382                 if ( isset( $_POST['up_votes'] ) )              { update_post_meta( $post_id, 'FAQ_Up_Votes', sanitize_text_field( $_POST['up_votes'] ) ); }
    383                 if ( isset( $_POST['down_votes'] ) )    { update_post_meta( $post_id, 'FAQ_Down_Votes', sanitize_text_field( $_POST['down_votes'] ) ); }
    384 
    385                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    386 
    387                 foreach ( $custom_fields as $faq_field ) {
    388                        
    389                         $input_name = 'EWD_UFAQ_Custom_Field_' . $faq_field->id;
    390 
    391                         if ( $faq_field->type == 'file' ) {
    392 
    393                                 if ( empty( $_FILES[ $input_name ]['name'] ) ) { continue; }
    394 
    395                                 $uploaded_file = wp_handle_upload( $_FILES[ $input_name ], array( 'test_form' => false ) );
    396                                 $field_value = $uploaded_file['url'];
    397                         }
    398                         elseif ( $faq_field->type == 'checkbox' ) {
    399 
    400                                 $field_value = ( isset( $_POST[ $input_name ] ) and is_array( $_POST[ $input_name ] ) ) ? array_map( 'sanitize_text_field', $_POST[ $input_name ] ) : array();
    401                         }
    402                         else {
    403                                
    404                                 $field_value = sanitize_text_field( $_POST[ $input_name ] );
    405                         }
    406 
    407                         update_post_meta( $post_id, 'Custom_Field_' . $faq_field->id, $field_value );
    408                 }
     269if ( isset( $_POST['faq_author'] ) )    { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
     270                do_action( 'ewd_ufaq_save_admin_fields', $post_id );
    409271        }
    410272
    … …  
    613475         */
    614476        public function sort_categories_by_order( $clauses, $taxonomies ) {
    615                 global $wpdb;
    616 
    617                 if ( ! in_array( EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, $taxonomies ) ) { return $clauses; }
    618                 if ( ! empty( $clauses['orderby'] ) and $clauses['orderby'] != 'ORDER BY t.name' ) { return $clauses; }
    619 
    620                 $clauses['join'] .= ' INNER JOIN ' . $wpdb->prefix . 'termmeta AS tm ON t.term_id = tm.term_id';
    621 
    622                 $clauses['where'] .= ' AND tm.meta_key = "ufaq_category_order"';
    623 
    624                 $clauses['orderby'] = 'ORDER BY tm.meta_value+0';
    625 
    626                 return $clauses;
     477                return class_exists( 'ewdufaqEWDPHOrdering', false ) ? ewdufaqEWDPHOrdering::sort_categories_by_order( $clauses, $taxonomies ) : $clauses;
    627478        }
    628479
    … …  
    632483         */
    633484        public function maybe_notify_author_on_update( $post_id, $data ) {
    634                 global $ewd_ufaq_controller;
    635 
    636                 if ( get_post_type( $post_id ) != EWD_UFAQ_FAQ_POST_TYPE ) { return; }
    637 
    638                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'submit-faq-updates' ) ) ) { return; }
    639 
    640                 remove_action( 'pre_post_update',       array( $this, 'maybe_notify_author_on_update' ) );
    641 
    642                 $post = get_post( $post_id );
    643 
    644                 if ( $ewd_ufaq_controller->settings->get_setting( 'submit-faq-updates' ) == 'first_answer' and ! empty( $post->post_content ) ) { return; }
    645                
    646                 $faq = new ewdufaqFAQ();
    647 
    648                 $faq->load_post( $post );
    649 
    650                 $ewd_ufaq_controller->notifications->user_question_updated( $faq );
     485                if ( class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ) { return ewdufaqEWDPHSubmissionNotifications::maybe_notify_author_on_update( $post_id, $data ); }
    651486        }
    652487}
  • ultimate-faqs/tags/2.7.0/includes/EditorFAQWorkflow.class.php

    r3744649 r3821169  
    212212
    213213                                $this->send_error( 'create_failed', __( 'WordPress did not publish the new FAQ.', 'ultimate-faqs' ), 500 );
    214                         }
    215 
    216                         if ( false === update_post_meta( $post_id, 'ufaq_order', 9999 ) ) {
    217 
    218                                 wp_delete_post( $post_id, true );
    219                                 $this->send_error( 'create_failed', __( 'The new FAQ could not be initialized for display.', 'ultimate-faqs' ), 500 );
    220214                        }
    221215
  • ultimate-faqs/tags/2.7.0/includes/FAQ.class.php

    r3744649 r3821169  
    6767                }
    6868
    69                 if ( get_class( $post ) == 'WP_Post' && $post->post_type == EWD_UFAQ_FAQ_POST_TYPE ) {
     69                if ( $post instanceof WP_Post && $post->post_type == EWD_UFAQ_FAQ_POST_TYPE ) {
    7070                        $this->load_wp_post( $post );
    7171                        return true;
    … …  
    148148         * @since 2.0.0
    149149         */
    150         public function insert_faq() {
    151                         global $ewd_ufaq_controller;
    152                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'submit-faq' ) ) {
    153                                 return false;
    154                         }
    155 
    156                 // Check if this request has already been processed. If multiple forms
    157                 // exist on the same page, this prevents a single submission from
    158                 // being added twice.
    159                 if ( $this->faq_processed === true ) {
    160                         return true;
    161                 }
    162 
    163                 $this->faq_processed = true;
    164 
    165                 if ( empty( $this->ID ) ) {
    166                         $action = 'insert';
    167                 } else {
    168                         $action = 'update';
    169                 }
    170 
    171                 $this->validate_submission();
    172                 if ( $this->is_valid_submission() === false ) {
    173                         return false;
    174                 }
    175 
    176                 if ( $this->insert_post_data() === false ) {
    177                         return false;
    178                 } else {
    179                         $this->faq_inserted = true;
    180                 }
    181 
    182                 do_action( 'ewd_ufaq_' . $action . '_faq', $this );
    183 
    184                 return true;
     150        public function insert_faq()  {
     151                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_faq( $this ) : false;
    185152        }
    186153
    … …  
    189156         * @since 2.0.0
    190157         */
    191         public function validate_submission() {
    192                 global $ewd_ufaq_controller;
    193 
    194                 $this->validation_errors = array();
    195 
    196                 // NONCE Validation
    197                 if ( ! isset( $_POST['ewd_ufaq_nonce'] ) || ! wp_verify_nonce( $_POST['ewd_ufaq_nonce'], 'ewd_ufaq_nonce_value' ) ) {
    198 
    199                         $this->validation_errors[] = array(
    200                                 'field'         => 'nonce',
    201                                 'error_msg'     => 'Invalid Nonce',
    202                                 'message'       => __( 'Please refresh the page and try submitting again.', 'ultimate-faqs' ),
    203                         );
    204 
    205                         return false; // End early if nonce validation fails
    206                 }
    207 
    208                 // USER-SUBMITTED FLAG
    209                 if ( isset( $_POST['user_submitted'] ) and ! empty( $_POST['user_submitted'] ) ) {
    210 
    211                         $this->user_submitted = true;
    212                 }
    213 
    214                 // CAPTCHA
    215                 if ( $ewd_ufaq_controller->settings->get_setting( 'submit-question-captcha' ) ) {
    216                        
    217                         $modified_code = intval( $_POST['ewd_ufaq_modified_captcha'] );
    218                         $user_code = intval( $_POST['ewd_ufaq_captcha'] );
    219 
    220                         if ( empty( $user_code ) ) {
    221 
    222                                 $this->validation_errors[] = array(
    223                                         'field'         => 'captcha',
    224                                         'error_msg'     => 'Captcha incorrect',
    225                                         'message'       => $ewd_ufaq_controller->settings->get_setting( 'label-captcha-empty' ),
    226                                 );
    227                         }
    228                         elseif ( $user_code != $this->decrypt_modified_code( $modified_code ) ) {
    229 
    230                                 $this->validation_errors[] = array(
    231                                         'field'         => 'captcha',
    232                                         'error_msg'     => 'Captcha incorrect',
    233                                         'message'       => $ewd_ufaq_controller->settings->get_setting( 'label-captcha-incorrect' ),
    234                                 );
    235                         }
    236                 }
    237 
    238                 // QUESTION
    239                 $this->question = empty( $_POST['faq_question'] ) ? false : sanitize_text_field( $_POST['faq_question'] );
    240                
    241                 if ( ! $this->question ) {
    242 
    243                         $this->validation_errors[] = array(
    244                                 'field'         => 'faq_question',
    245                                 'error_msg'     => 'Question is blank',
    246                                 'message'       => $ewd_ufaq_controller->settings->get_setting( 'label-no-question-title-entered' ),
    247                         );
    248                 }
    249 
    250                 // AUTHOR
    251                 $this->faq_author = empty( $_POST['post_author'] ) ? false : sanitize_text_field( $_POST['post_author'] );
    252 
    253                 // AUTHOR EMAIL
    254                 $this->faq_author_email = empty( $_POST['post_author_email'] ) ? false : sanitize_email( $_POST['post_author_email'] );
    255 
    256                 // ANSWER
    257                 if ( $ewd_ufaq_controller->settings->get_setting( 'allow-proposed-answer' ) ) {
    258 
    259                         $this->answer = empty( $_POST['faq_answer'] ) ? false : sanitize_textarea_field( $_POST['faq_answer'] );
    260                 }
    261 
    262                 // CATEGORY
    263                 if ( $ewd_ufaq_controller->settings->get_setting( 'submitted-default-category' ) ) {
    264 
    265                         $args = array(
    266                                 'taxonomy'              => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
    267                                 'hide_empty'    => false,
    268                                 'slug'                  => $ewd_ufaq_controller->settings->get_setting( 'submitted-default-category' )
    269                         );
    270 
    271                         $this->categories = get_terms( $args );
    272                 }
    273 
    274                 // CUSTOM FIELDS
    275                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    276 
    277                 foreach ( $custom_fields as $custom_field ) {
    278 
    279                         if ( ! $custom_field->id ) { continue; }
    280 
    281                         $input_name = 'ewd_ufaq_custom_field_' . $custom_field->id;
    282 
    283                         if ( $custom_field->type == 'checkbox' ) {
    284 
    285                                 $checkbox_values = ( empty( $_POST[ $input_name ] ) or ! is_array( $_POST[ $input_name ] ) ) ? array() : $_POST[ $input_name ];
    286 
    287                                 $this->custom_fields[ $custom_field->id ] =  array_map( 'sanitize_text_field', $checkbox_values );
    288                         }
    289                         else { $this->custom_fields[ $custom_field->id ] = empty( $_POST[ $input_name ] ) ? false : sanitize_text_field( $_POST[ $input_name ] ); }
    290                 }
    291                
    292                 $this->post_status = 'draft';
    293 
    294                 do_action( 'ewd_ufaq_validate_faq_submission', $this );
     158        public function validate_submission()  {
     159                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::validate_submission( $this ) : false;
    295160        }
    296161
    … …  
    299164         * @since 2.0.0
    300165         */
    301         public function decrypt_modified_code( $user_code ) {
    302 
    303                 $decrypted_code = ($user_code / 3) - 5;
    304 
    305                 return $decrypted_code;
     166        public function decrypt_modified_code( $user_code )  {
     167                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::decrypt_modified_code( $this, $user_code ) : false;
    306168        }
    307169
    … …  
    311173         * @since 2.0.0
    312174         */
    313         public function is_valid_submission() {
    314 
    315                 if ( !count( $this->validation_errors ) ) {
    316                         return true;
    317                 }
    318 
    319                 return false;
     175        public function is_valid_submission()  {
     176                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::is_valid_submission( $this ) : false;
    320177        }
    321178
    … …  
    324181         * @since 2.0.0
    325182         */
    326         public function insert_post_data() {
    327                         global $ewd_ufaq_controller;
    328                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'submit-faq' ) ) {
    329                                 return false;
    330                         }
    331 
    332                 $args = array(
    333                         'post_type'             => EWD_UFAQ_FAQ_POST_TYPE,
    334                         'post_title'    => $this->question,
    335                         'post_content'  => ! empty( $this->answer ) ? $this->answer : '',
    336                         'post_status'   => $this->post_status,
    337                 );
    338 
    339                 if ( ! empty( $this->ID ) ) {
    340                         $args['ID'] = $this->ID;
    341                 }
    342 
    343                 $args = apply_filters( 'ewd_ufaq_insert_faq_data', $args, $this );
    344 
    345                 // When updating a FAQ, we need to update the metadata first, so that
    346                 // notifications hooked to the status changes go out with the new metadata.
    347                 // If we're inserting a new FAQ, we have to insert it before we can
    348                 // add metadata, and the default notifications don't fire until it's all done.
    349                 if ( ! empty( $this->ID ) ) {
    350 
    351                         $this->insert_post_meta();
    352                         $this->insert_post_categories();
    353                         $id = wp_insert_post( $args );
    354                 } else {
    355 
    356                         $id = wp_insert_post( $args );
    357                         if ( $id && ! is_wp_error( $id ) ) {
    358                                 $this->ID = $id;
    359                                 $this->insert_post_meta();
    360                                 $this->insert_post_categories();
    361 
    362                                 $this->clear_post_submission();
    363                         }
    364                 }
    365 
    366                 return ! is_wp_error( $id ) && $id !== false;
     183        public function insert_post_data()  {
     184                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_post_data( $this ) : false;
    367185        }
    368186
    … …  
    371189         * @since 2.0.0
    372190         */
    373         public function insert_post_meta() {
    374                 global $ewd_ufaq_controller;
    375 
    376                 $meta = array();
    377 
    378                 if ( ! empty( $this->faq_author ) ) {
    379 
    380                         update_post_meta( $this->ID, 'EWD_UFAQ_Post_Author', $this->faq_author );
    381                 }
    382 
    383                 if ( ! empty( $this->faq_author_email ) ) {
    384                        
    385                         update_post_meta( $this->ID, 'EWD_UFAQ_Post_Author_Email', $this->faq_author_email );
    386                 }
    387 
    388                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    389 
    390                 foreach ( $custom_fields as $custom_field ) {
    391 
    392                         if ( ! empty( $this->custom_fields[ $custom_field->id ] ) ) {
    393 
    394                                 update_post_meta( $this->ID, 'Custom_Field_' . $custom_field->id, $this->custom_fields[ $custom_field->id ] );
    395                         }
    396                 }
     191        public function insert_post_meta()  {
     192                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_post_meta( $this ) : false;
    397193        }
    398194
    … …  
    401197         * @since 2.0.0
    402198         */
    403         public function insert_post_categories() {
    404 
    405                 if ( empty( $this->categories ) or ! is_array( $this->categories ) ) { return; }
    406 
    407                 $submit_categories = array();
    408                 foreach ( $this->categories as $category ) { $submit_categories[] = $category->term_id; }
    409 
    410                 wp_set_object_terms( $this->ID, $submit_categories, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
     199        public function insert_post_categories()  {
     200                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_post_categories( $this ) : false;
    411201        }
    412202
    … …  
    415205         * @since 2.0.0
    416206         */
    417         public function clear_post_submission() {
    418                 global $ewd_ufaq_controller;
    419 
    420                 unset( $_POST['faq_question'] );
    421                 unset( $_POST['faq_answer'] );
    422                 unset( $_POST['post_author'] );
    423                 unset( $_POST['post_author_email'] );
    424 
    425                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    426 
    427                 foreach ( $custom_fields as $custom_field ) {
    428 
    429                         unset( $_POST[ 'ewd_ufaq_custom_field_' . $custom_field->id ] );
    430                 }
     207        public function clear_post_submission()  {
     208                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::clear_post_submission( $this ) : null;
    431209        }
    432210
  • ultimate-faqs/tags/2.7.0/includes/HelperCompatibility.class.php

    r3744649 r3821169  
    1818                        add_action( 'plugins_loaded', array( $this, 'refresh' ), 100 );
    1919                        add_action( 'admin_notices', array( $this, 'display_admin_notice' ) );
     20                        add_action( 'admin_notices', array( $this, 'display_obsolete_package_notice' ) );
    2021
    2122                        $this->refresh();
     23                }
     24                /** Detect known remnants only; never execute or automatically delete customer files. */
     25                public function display_obsolete_package_notice() {
     26                        if ( ! current_user_can( 'manage_options' ) || ! function_exists( 'get_current_screen' ) ) { return; }
     27                        $screen = get_current_screen();
     28                        if ( ! $screen || ( 'plugins' !== $screen->id && EWD_UFAQ_FAQ_POST_TYPE !== $screen->post_type && false === strpos( $screen->id, 'ewd-ufaq' ) ) ) { return; }
     29                        foreach ( array( 'includes/WooCommerce.class.php', 'includes/WPForms.class.php', 'includes/OrderingTable.class.php', 'views/View.SubmitFAQ.class.php', 'lib/PHPSpreadsheet/vendor/autoload.php', 'lib/FPDF/fpdf.php', 'assets/js/ewd-ufaq-analytics.js', 'assets/js/ewd-ufaq-wc-admin.js', 'assets/css/ewd-ufaq-minimalist.css', 'assets/css/jquery-ui.min.css', 'ewd-ufaq-templates/faq-ratings.php', 'ewd-ufaq-templates/submit-faq.php' ) as $file ) {
     30                                if ( is_file( EWD_UFAQ_PLUGIN_DIR . '/' . $file ) ) {
     31                                        echo '<div class="notice notice-warning"><p>' . esc_html__( 'Ultimate FAQs contains obsolete files from an earlier version. Back up the site, then replace the complete ultimate-faqs plugin directory with the approved release ZIP instead of merging files. Keep uploads and theme overrides. Ask your host to reset its PHP opcode cache if necessary. No files have been deleted automatically.', 'ultimate-faqs' ) . '</p></div>';
     32                                        return;
     33                                }
     34                        }
    2235                }
    2336
    … …  
    8699                                return array( 'state' => 'active_legacy_no_descriptor' );
    87100                        }
     101                        foreach ( array( 'api_version', 'supported_free_api_min', 'supported_free_api_max', 'entitlement_contract_version' ) as $field ) {
     102                                if ( ! isset( $helper_descriptor[ $field ] ) || ! is_int( $helper_descriptor[ $field ] ) || $helper_descriptor[ $field ] < 1 ) {
     103                                        return array( 'state' => 'unsupported_entitlement_contract' );
     104                                }
     105                        }
     106                        if ( ! isset( $helper_descriptor['plugin_version'] ) || ! is_string( $helper_descriptor['plugin_version'] )
     107                                || ! preg_match( '/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][A-Za-z0-9.-]+)?$/', $helper_descriptor['plugin_version'] )
     108                                || $helper_descriptor['supported_free_api_min'] > $helper_descriptor['supported_free_api_max'] ) {
     109                                return array( 'state' => 'unsupported_entitlement_contract' );
     110                        }
    88111
    89112                        $helper_version = isset( $helper_descriptor['plugin_version'] ) ? $helper_descriptor['plugin_version'] : '0';
  • ultimate-faqs/tags/2.7.0/includes/Notifications.class.php

    r3744649 r3821169  
    1313        public function __construct() {
    1414               
    15                 add_action( 'ewd_ufaq_insert_faq', array( $this, 'admin_notification_email' ) );
    16                 add_action( 'ewd_ufaq_insert_faq', array( $this, 'user_submission_email' ) );
     15                // Public compatibility facade; Helper owns paid mail hooks and implementation.
    1716        }
    1817
    … …  
    2221         * @since 2.0.0
    2322         */
    24         public function admin_notification_email( $faq ) {
    25                 global $ewd_ufaq_controller;
    26 
    27                 if ( ! $ewd_ufaq_controller->settings->get_setting( 'admin-question-notification' ) ) { return; }
    28 
    29                 $admin_emails = $ewd_ufaq_controller->settings->get_setting( 'admin-notification-email' ) ? explode( ',', $ewd_ufaq_controller->settings->get_setting( 'admin-notification-email' ) ) : (array) get_option( 'admin_email' );
    30        
    31                 $faq_link = site_url() . '/wp-admin/post.php?post=' . $faq->ID . '&action=edit';
    32        
    33                 $subject_line = __( 'New Question Received', 'ultimate-faqs' );
    34        
    35                 $message_body = __( 'Hello Admin,', 'ultimate-faqs' ) . '<br/><br/>';
    36                 $message_body .= __( 'You\'ve received a new question titled ', 'ultimate-faqs' ) . $faq->question . '.<br/><br/>';
    37                
    38                 if ( ! empty( $faq->answer ) ) {
    39 
    40                         $message_body .= __( 'The answer reads:<br>', 'ultimate-faqs' );
    41                         $message_body .= esc_html( $faq->answer ) . '<br><br><br>';
    42                 }
    43                
    44                 $message_body .= __( 'You can view the question in the admin area by going to the following link:<br>', 'ultimate-faqs' );
    45                 $message_body .= '<a href=\'' . $faq_link . '\'>' . __( 'See the FAQ', 'ultimate-faqs' ) . '</a><br/><br/>';
    46                 $message_body .= __( 'Have a great day,', 'ultimate-faqs' ) . '<br/><br/>';
    47                 $message_body .= __( 'Ultimate FAQs Team', 'ultimate-faqs' );
    48        
    49                 $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    50 
    51                         $success = false;
    52                 foreach ( $admin_emails as $admin_email ) {
    53 
    54                         $success = wp_mail( $admin_email, $subject_line, $message_body, $headers );
    55                 }
    56 
    57                 return $success;
     23        public function admin_notification_email( $faq )  {
     24                return class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ? ewdufaqEWDPHSubmissionNotifications::admin_notification_email( $this, $faq ) : false;
    5825        }
    5926
    … …  
    6330         * @since 2.0.0
    6431         */
    65         public function user_submission_email( $faq ) {
    66                 global $ewd_ufaq_controller;
    67 
    68                 if ( ! $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ) ) { return; }
    69 
    70                 $params = array(
    71                         'email_id' => $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ),
    72                         'email_address' => $faq->faq_author_email,
    73                         'post_id' => $faq->ID
    74                 );
    75                
    76                 if ( function_exists( 'ewd_uwpm_send_email' ) ) {
    77                          
    78                         ewd_uwpm_send_email( $params );
    79                 }
    80                 else {
    81 
    82                         $author_emails = $faq->faq_author_email ? explode( ',', $faq->faq_author_email ) : array();
    83        
    84                         $subject_line = apply_filters( 'ewd_ufaq_user_question_submitted_subject_line', __( 'New Question', 'ultimate-faqs' ) );
    85 
    86                         $message_body = __( 'Hello,', 'ultimate-faqs' ) . '<br/><br/>';
    87                         $message_body .= sprintf( __( 'Thank you for submitting your FAQ, %s. ', 'ultimate-faqs' ), $faq->question ) . '<br/><br/>';
    88                         $message_body .= get_bloginfo( 'name' );
    89 
    90                         $message_body = apply_filters( 'ewd_ufaq_user_question_submitted_message_body', $message_body );
    91 
    92                         $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    93 
    94                                 $success = false;
    95                         foreach ( $author_emails as $author_email ) {
    96 
    97                                 if ( ! filter_var( $author_email, FILTER_VALIDATE_EMAIL ) ) { continue;}
    98 
    99                                 $success = wp_mail( $author_email, $subject_line, $message_body, $headers );
    100                         }
    101 
    102                         return $success;
    103                 }
     32        public function user_submission_email( $faq )  {
     33                return class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ? ewdufaqEWDPHSubmissionNotifications::user_submission_email( $this, $faq ) : false;
    10434        }
    10535
    … …  
    10939         * @since 2.4.0
    11040         */
    111         public function user_question_updated( $faq ) {
    112 
    113                 $author_emails = $faq->faq_author_email ? explode( ',', $faq->faq_author_email ) : array();
    114        
    115                 $subject_line = apply_filters( 'ewd_ufaq_user_question_answered_subject_line', __( 'New Question Answer', 'ultimate-faqs' ) );
    116        
    117                 $message_body = __( 'Hello,', 'ultimate-faqs' ) . '<br/><br/>';
    118                 $message_body .= sprintf( __( 'Your FAQ, %s, has received a new question answer: ', 'ultimate-faqs' ), $faq->question ) . '<br/><br/>' . $faq->answer . '<br/><br/>';
    119                 $message_body .= __( 'Thank You,', 'ultimate-faqs' ) . '<br/><br/>';
    120 
    121                 $message_body = apply_filters( 'ewd_ufaq_user_question_answered_message_body', $message_body, $faq );
    122 
    123                 $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    124 
    125                         $success = false;
    126                 foreach ( $author_emails as $author_email ) {
    127 
    128                         if ( ! filter_var( $author_email, FILTER_VALIDATE_EMAIL ) ) { continue;}
    129 
    130                         $success = wp_mail( $author_email, $subject_line, $message_body, $headers );
    131                 }
    132 
    133                 return $success;
     41        public function user_question_updated( $faq )  {
     42                return class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ? ewdufaqEWDPHSubmissionNotifications::user_question_updated( $this, $faq ) : false;
    13443        }
    13544}
  • ultimate-faqs/tags/2.7.0/includes/Permissions.class.php

    r3744649 r3821169  
    125125                        if ( 'faq-order-by' === $setting && 'set_order' === $value ) {
    126126                                $capability = 'ordering'; }
     127                        if ( 'category-order-by' === $setting && 'manual' === $value ) {
     128                                $capability = 'ordering'; }
    127129                        return '' !== $capability && ! $this->check_permission( $capability ) ? $fallback : $value;
    128130                }
  • ultimate-faqs/tags/2.7.0/includes/Query.class.php

    r3744649 r3821169  
    5656        // Max number of pages of faqs matching the query
    5757        public $max_page;
     58        private $prepared = false;
    5859
    5960        /**
    … …  
    102103
    103104                $args = $this->args;
    104                         if ( isset( $args['orderby'] ) && 'set_order' === $args['orderby']
    105                         && ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) {
    106                                 $args['orderby'] = 'title';
    107                         }
    108105
    109106                $args['include_children'] = ( ! empty( $args['include_children'] ) and strtolower( $args['include_children'] ) != 'yes' ) ? false : true;
    … …  
    115112                if ( ! empty( $args['faq_page'] ) ) { $args['paged'] = $args['faq_page']; }
    116113
    117                 if ( ! empty( $args['post__in'] ) ) { $args['post__in'] = is_array( $args['post__in'] ) ? $args['post__in'] : json_decode( str_replace( array( '&lsqb;', '&rsqb;' ), array( '[', ']' ) ) ); }
     114                if ( ! empty( $args['post__in'] ) && ! is_array( $args['post__in'] ) ) {
     115                        $decoded_ids = is_string( $args['post__in'] ) ? json_decode( str_replace( array( '&lsqb;', '&rsqb;' ), array( '[', ']' ), $args['post__in'] ), true ) : null;
     116                        $args['post__in'] = is_array( $decoded_ids ) ? array_values( array_filter( array_map( 'absint', array_filter( $decoded_ids, 'is_scalar' ) ) ) ) : array();
     117                }
    118118
    119119                $explicit_post_ids = ! empty( $args['post__in_string'] )
    … …  
    225225                if ( empty( $explicit_post_ids ) && ! empty( $args['orderby'] ) ) {
    226226
    227                         if ( $args['orderby'] == 'rating' or $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
     227                        if ( $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
    228228                        elseif ( $args['orderby'] == 'date' ) { $orderby['date'] = $args['order']; }
    229229                        elseif ( $args['orderby'] == 'title' ) { $orderby['title'] = $args['order']; }
    230                         elseif ( $args['orderby'] == 'set_order' ) { $orderby['meta_value_num'] = $args['order']; }
    231                 }
    232 
    233                 if ( empty( $explicit_post_ids ) && $args['orderby'] == 'rating' ) { $args['meta_key'] = 'FAQ_Total_Score'; }
    234                 elseif ( empty( $explicit_post_ids ) && $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
    235                         elseif ( empty( $explicit_post_ids ) && 'set_order' === $args['orderby'] ) {
    236                                 // Manual ordering must not filter out reusable FAQs which have no rank.
    237                                 $manual_order_query = array(
    238                                         'relation'          => 'OR',
    239                                         'ufaq_manual_order' => array(
    240                                                 'key'     => 'ufaq_order',
    241                                                 'compare' => 'EXISTS',
    242                                                 'type'    => 'NUMERIC',
    243                                         ),
    244                                         'ufaq_unordered'    => array(
    245                                                 'key'     => 'ufaq_order',
    246                                                 'compare' => 'NOT EXISTS',
    247                                         ),
    248                                 );
    249                                 $args['meta_query'] = empty( $args['meta_query'] )
    250                                         ? $manual_order_query
    251                                         : array(
    252                                                 'relation' => 'AND',
    253                                                 $args['meta_query'],
    254                                                 $manual_order_query,
    255                                         );
    256                                 unset( $args['meta_key'], $orderby['meta_value_num'] );
    257                                 $orderby['ufaq_manual_order'] = $args['order'];
    258                                 $orderby['ID']                = $args['order'];
    259                         }
     230                }
     231
     232                if ( empty( $explicit_post_ids ) && isset( $args['orderby'] ) && $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
    260233               
    261234                if ( empty( $explicit_post_ids ) && ! empty( $orderby ) ) { $args['orderby'] = $orderby; }
    262235
     236                $args = apply_filters( 'ewd_ufaq_query_args', $args, $this->context, $this );
     237                if ( isset( $args['orderby'] ) && in_array( $args['orderby'], array( 'set_order', 'rating' ), true ) ) { $args['orderby'] = array( 'title' => $args['order'] ); }
    263238                $this->args = $args;
     239                $this->prepared = true;
    264240
    265241                return $this->args;
    … …  
    275251                $args = array();
    276252
    277                 if ( isset( $_REQUEST['faq_page'] ) ) {
     253                if ( isset( $_REQUEST['faq_page'] ) && is_scalar( $_REQUEST['faq_page'] ) ) {
    278254
    279255                        $args['faq_page'] = intval( $_REQUEST['faq_page'] );
    280256                }
    281257
    282                 if ( isset( $_REQUEST['search_string'] ) ) {
    283 
    284                         $args['search_string'] = sanitize_text_field( stripslashes( $_REQUEST['search_string'] ) );
    285                 }
    286 
    287                 if ( isset( $_REQUEST['post_count'] ) ) {
     258                if ( isset( $_REQUEST['search_string'] ) && is_scalar( $_REQUEST['search_string'] ) ) {
     259
     260                        $args['search_string'] = sanitize_text_field( stripslashes( (string) $_REQUEST['search_string'] ) );
     261                }
     262
     263                if ( isset( $_REQUEST['post_count'] ) && is_scalar( $_REQUEST['post_count'] ) ) {
    288264
    289265                        $args['post_count'] = sanitize_text_field( $_REQUEST['post_count'] );
    290266                }
    291267
    292                 if ( isset( $_REQUEST['orderby'] ) ) {
     268                if ( isset( $_REQUEST['orderby'] ) && is_scalar( $_REQUEST['orderby'] ) ) {
    293269
    294270                        $args['orderby'] = sanitize_text_field( $_REQUEST['orderby'] );
    295271                }
    296272
    297                 if ( isset( $_REQUEST['order'] ) ) {
     273                if ( isset( $_REQUEST['order'] ) && is_scalar( $_REQUEST['order'] ) ) {
    298274
    299275                        $args['order'] = sanitize_text_field( $_REQUEST['order'] );
    300276                }
    301277
    302                 if ( isset( $_REQUEST['include_category'] ) ) {
     278                if ( isset( $_REQUEST['include_category'] ) && is_scalar( $_REQUEST['include_category'] ) ) {
    303279
    304280                        $args['include_category'] = sanitize_text_field( $_REQUEST['include_category'] );
    305281                }
    306282
    307                 if ( isset( $_REQUEST['exclude_category'] ) ) {
     283                if ( isset( $_REQUEST['exclude_category'] ) && is_scalar( $_REQUEST['exclude_category'] ) ) {
    308284
    309285                        $args['exclude_category'] = sanitize_text_field( $_REQUEST['exclude_category'] );
    … …  
    315291                }
    316292
    317                 if ( isset( $_REQUEST['include_tag'] ) ) {
     293                if ( isset( $_REQUEST['include_tag'] ) && is_scalar( $_REQUEST['include_tag'] ) ) {
    318294
    319295                        $args['include_tag'] = sanitize_text_field( $_REQUEST['include_tag'] );
    … …  
    326302
    327303                $this->args = array_merge( $this->args, $args );
     304                $this->prepared = false;
    328305        }
    329306
    … …  
    337314                $faqs = array();
    338315
    339                 $args = apply_filters( 'ewd_ufaq_query_args', $this->args, $this->context );
     316                $args = $this->prepared ? $this->args : $this->prepare_args();
    340317               
    341318                $query = new WP_Query( $args );
  • ultimate-faqs/tags/2.7.0/includes/Settings.class.php

    r3744649 r3821169  
    9696                        $raw      = ! empty( $this->settings ) ? $this->settings : get_option( 'ewd-ufaq-settings', array() );
    9797                        if ( 'faq-order-by' === $setting && isset( $raw[ $setting ] ) && 'set_order' === $raw[ $setting ] ) {
     98                                $required = 'ordering';
     99                        }
     100                        if ( 'category-order-by' === $setting && isset( $raw[ $setting ] ) && 'manual' === $raw[ $setting ] ) {
    98101                                $required = 'ordering';
    99102                        }
  • ultimate-faqs/tags/2.7.0/includes/template-functions.php

    r3704732 r3821169  
    121121                return ewdufaqBasicSearch::render( $args );
    122122        }
    123 
    124         $query = new ewdufaqQuery( $args );
    125         $query->parse_request_args();
    126         $query->prepare_args();
    127 
    128         // Render faqs
    129         ewd_ufaq_load_view_files();
    130 
    131         $faqs = new ewdufaqViewFAQSearch( $args );
    132 
    133         $faqs->set_faqs( $query->get_faqs() );
    134        
    135         $ewd_ufaq_controller->shortcode_printing = true;
    136 
    137         $output = $faqs->render();
    138 
    139         $ewd_ufaq_controller->shortcode_printing = false;
    140 
    141         return $output;
     123        return class_exists( 'ewdufaqEWDPHSearch', false ) ? ewdufaqEWDPHSearch::shortcode( $args ) : ewdufaqBasicSearch::render( $args );
    142124}
    143125add_shortcode( 'ultimate-faq-search', 'ewd_ufaq_search_faqs_shortcode' );
    … …  
    166148        $args = shortcode_atts( $submit_faq_atts, $atts );
    167149
    168         // Handle FAQ submission
    169         if ( isset( $_POST['submit_question'] ) ) {
    170 
    171                 $args['faq_submitted'] = true;
    172 
    173                 $faq = new ewdufaqFAQ();
    174                 $success = $faq->insert_faq();
    175 
    176                 if ( $success ) {
    177 
    178                         $args['update_message'] = ! empty( $args['success_message'] ) ? $args['success_message'] : $ewd_ufaq_controller->settings->get_setting( 'label-thank-you-submit' );
    179                 }
    180                 else {
    181 
    182                         $args['update_message'] = '';
    183 
    184                         foreach ( $faq->validation_errors as $validation_error ) {
    185 
    186                                 $args['update_message'] .= '<br />' . $validation_error['message'];
    187                         }
    188                 }
    189         }
    190 
    191         // Render faq
    192         ewd_ufaq_load_view_files();
    193 
    194         $submit_faq = new ewdufaqViewSubmitFAQ( $args );
    195 
    196         $ewd_ufaq_controller->shortcode_printing = true;
    197 
    198         $output = $submit_faq->render();
    199 
    200         $ewd_ufaq_controller->shortcode_printing = false;
    201 
    202         return $output;
     150        return apply_filters( 'ewd_ufaq_submit_output', '', $args );
    203151}
    204152add_shortcode( 'submit-question', 'ewd_ufaq_submit_faq_shortcode' );
    … …  
    339287function ewd_ufaq_validate_captcha() {
    340288
    341         $modifiedcode = intval( $_POST['ewd_ufaq_modified_captcha'] );
    342         $usercode = intval( $_POST['ewd_ufaq_captcha'] );
    343 
    344         $code = ewd_ufaq_decrypt_catpcha_code( $modifiedcode );
    345 
    346         $validate_captcha = $code == $usercode ? 'Yes' : 'No';
    347 
    348         return $validate_captcha;
     289        return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::validate_captcha() : 'No';
    349290}
    350291}
    … …  
    353294function ewd_ufaq_encrypt_captcha_code( $code ) {
    354295       
    355         $modifiedcode = ($code + 5) * 3;
    356 
    357         return $modifiedcode;
    358 }
    359 }
    360 
    361 if ( ! function_exists( 'ewd_ufaq_encrypt_captcha_code' ) ) {
     296        return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::encrypt_captcha( $code ) : false;
     297}
     298}
     299
     300if ( ! function_exists( 'ewd_ufaq_decrypt_catpcha_code' ) ) {
    362301function ewd_ufaq_decrypt_catpcha_code( $modifiedcode ) {
    363302       
    364         $code = ($modifiedcode / 3) - 5;
    365 
    366         return $code;
     303        return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::decrypt_captcha( $modifiedcode ) : false;
    367304}
    368305}
  • ultimate-faqs/tags/2.7.0/readme.txt

    r3744649 r3821169  
    44Requires at least: 6.0
    55Tested up to: 7.1
    6 Stable tag: 2.6.0
     6Stable tag: 2.7.0
    77Requires PHP: 7.4
    88License: GPLv3
    … …  
    240240== Changelog ==
    241241
    242 = 2.6.0 (2026-10-12) =
    243 - Added the ability to assign FAQ categories when creating FAQs directly in the Display FAQs block.
    244 - Added a separate "Move FAQ to Trash" action in the block editor, distinct from removing an FAQ from a page.
    245 - Improved FAQ library management and selection for sites with larger numbers of FAQs.
    246 - Improved validation, reliability, and error handling for FAQ import/export operations.
    247 - Updated Premium license validation and entitlement handling, including improved license status, recovery, and compatibility checks.
    248 - Improved preservation of existing FAQ content and settings when Premium access is unavailable.
    249 
    250 = 2.5.0 (2026-09-20) =
    251 - <strong>This is a major update with many changes, including some big changes. We suggest testing this update in a staging environment before updating your live environment. Or wait a few days before updating in the event that an issue is identified that requires a fix/new update.</strong>
    252 - Added the ability to create and manage FAQs directly in the Display FAQs block.
    253 - Added new local analytics functionality that can identify content gaps and use AI to suggest or automatically generate new FAQs to fill the gaps. You need to specify an AI provider in WP Settings > Connectors for this to work.
    254 - Updated the search functionality available in the free version.
    255 - Hardened public counters and AI Assist privacy, validation, and error handling.
    256 - Updated the bundled PhpSpreadsheet runtime to the PHP 7.4-compatible 1.30.6 security release and hardened CSV/XLS/XLSX imports.
     242= 2.7.0 (2026-11-24) =
     243- **If you are using the premium version, please make sure to also update the EWD Premium Helper plugin to version 0.3.1 at the same time.**
     244- Several updates have been made to separate and streamline the functionality of the premium version via the EWD Premium Helper plugin.
     245- The FAQ order table has been revamped to allow for setting an order number and to allow ordering of categories.
     246- WooCommerce FAQ selection: Added paged search and category browsing for large libraries.
     247- TranslatePress compatibility: Prevent language prefixes from incorrectly changing the licensed site identity.
    257248
    258249[See changelog for all versions](https://www.etoilewebdesign.com/changelogs/ultimate-faqs.txt).
    … …  
    260251== Upgrade Notice ==
    261252
    262 = 2.6.0 =
    263 This update includes changes to the functionality that lets you create FAQs directly in the block, as well as to the interaction between this plugin and the Premium Helper. If you make use of this functionality in the block or your site uses the Premium Helper, we recommend testing the update on a staging site before updating your production site.
     253= 2.7.0 =
     254Several updates have been made to separate and streamline the functionality of the premium version via the EWD Premium Helper plugin. If you are using the premium version, please make sure to also update the EWD Premium Helper plugin to version 0.3.1 at the same time.
  • ultimate-faqs/tags/2.7.0/ultimate-faqs.php

    r3744649 r3821169  
    44 * Plugin URI: https://www.etoilewebdesign.com/plugins/ultimate-faq/
    55 * Description: Full-featured FAQ and accordion plugin with advanced search, simple UI and easy-to-use Gutenberg blocks and shortcodes.
    6  * Version: 2.6.0
     6 * Version: 2.7.0
    77 * Author: Etoile Web Design
    88 * Author URI: https://www.etoilewebdesign.com/
    … …  
    1414 * Requires PHP: 7.4
    1515 * WC requires at least: 7.1
    16  * WC tested up to: 11.2
     16 * WC tested up to: 11.3
    1717 */
    1818
    … …  
    6767                define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
    6868                define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
    69                         define( 'EWD_UFAQ_VERSION', '2.6.0' );
    70                         define( 'EWD_UFAQ_HELPER_API_VERSION', 2 );
    71                         define( 'EWD_UFAQ_MIN_HELPER_VERSION', '0.2.0' );
    72                         define( 'EWD_UFAQ_MAX_HELPER_API_VERSION', 2 );
     69                        define( 'EWD_UFAQ_VERSION', '2.7.0' );
     70                        define( 'EWD_UFAQ_HELPER_API_VERSION', 3 );
     71                        define( 'EWD_UFAQ_MIN_HELPER_VERSION', '0.3.0' );
     72                        define( 'EWD_UFAQ_MAX_HELPER_API_VERSION', 3 );
    7373                        define( 'EWD_UFAQ_ENTITLEMENT_CONTRACT_VERSION', 1 );
    7474                define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
    … …  
    102102                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
    103103                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Notifications.class.php' );
    104                 require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/OrderingTable.class.php' );
    105104                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Permissions.class.php' );
    106105                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Query.class.php' );
     106                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/RetainedData.class.php' );
    107107                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/ReviewAsk.class.php' );
    108108                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Settings.class.php' );
    … …  
    111111                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Upgrades.class.php' );
    112112                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Widgets.class.php' );
    113                 require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/WooCommerce.class.php' );
    114                 require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/WPForms.class.php' );
    115113        }
    116114
    … …  
    133131                $this->permissions       = new ewdufaqPermissions();
    134132                $this->settings          = new ewdufaqSettings();
     133                ewdufaqRetainedData::instance();
    135134                $this->helper_compatibility = new ewdufaqHelperCompatibility();
    136135                        // Register adapters regardless of initial entitlement; check at execution time.
    137                         $this->woocommerce = new ewdufaqWooCommerce();
    138                         $this->wpforms     = new ewdufaqWPForms();
    139136
    140137                new ewdufaqAJAX();
    … …  
    144141                new ewdufaqEditorFAQWorkflow();
    145142                if ( function_exists( 'register_block_pattern' ) ) { new ewdufaqPatterns(); }
    146                 new ewdufaqOrderingTable();
    147143                new ewdufaqUltimateWPMail();
    148144                new ewdufaqUpgrades();
    … …  
    353349                wp_enqueue_script( 'jquery-ui-sortable' );
    354350
    355                 wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery', 'jquery-ui-sortable' ), EWD_UFAQ_VERSION, true );
     351                wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
    356352
    357353                $args = array(
    … …  
    371367        public function register_assets() {
    372368
    373                 wp_register_style( 'ewd-ufaq-rrssb', EWD_UFAQ_PLUGIN_URL . '/assets/css/rrssb-min.css', array(), EWD_UFAQ_VERSION );
    374                 wp_register_style( 'ewd-ufaq-jquery-ui', EWD_UFAQ_PLUGIN_URL . '/assets/css/jquery-ui.min.css', array(), EWD_UFAQ_VERSION );
    375                
    376369                wp_register_style( 'ewd-ufaq-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq.css', array(), EWD_UFAQ_VERSION );
    377                 wp_register_style( 'ewd-ufaq-minimalist', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-minimalist.css', array(), EWD_UFAQ_VERSION );
    378370
    379371                wp_register_script( 'ewd-ufaq-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq.js', array( 'jquery', 'jquery-ui-core' ), EWD_UFAQ_VERSION, true );
  • ultimate-faqs/tags/2.7.0/views/Base.class.php

    r2510277 r3821169  
    1212require_once( EWD_UFAQ_PLUGIN_DIR . '/views/View.FAQs.class.php' );
    1313require_once( EWD_UFAQ_PLUGIN_DIR . '/views/View.FAQSearch.class.php' );
    14 require_once( EWD_UFAQ_PLUGIN_DIR . '/views/View.SubmitFAQ.class.php' );
    1514
    1615class ewdufaqBase {
  • ultimate-faqs/tags/2.7.0/views/View.FAQ.class.php

    r3704732 r3821169  
    218218         * @since 2.0.0
    219219         */
    220         public function maybe_print_custom_fields() {
    221                 global $ewd_ufaq_controller;
    222                
    223                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) ) ) { return; }
    224                
    225                 $template = $this->find_template( 'faq-custom-fields' );
    226                
    227                 if ( $template ) {
    228                         include( $template );
    229                 }
     220        public function maybe_print_custom_fields()  {
     221                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_custom_fields', $this );
    230222        }
    231223
    … …  
    269261         * @since 2.0.0
    270262         */
    271         public function maybe_print_ratings() {
    272                 global $ewd_ufaq_controller;
    273                
    274                 if ( ! $ewd_ufaq_controller->settings->get_setting( 'faq-ratings' ) ) { return; }
    275                
    276                 $template = $this->find_template( 'faq-ratings' );
    277                
    278                 if ( $template ) {
    279                         include( $template );
    280                 }
     263        public function maybe_print_ratings()  {
     264                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_ratings', $this );
    281265        }
    282266
    … …  
    289273         * @since 2.0.0
    290274         */
    291         public function maybe_print_social_media() {
    292                 global $ewd_ufaq_controller;
    293                
    294                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
    295 
    296                 if ( ! is_array( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
    297 
    298                 if ( sizeof( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) == 1 and in_array( '', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
    299                
    300                 $template = $this->find_template( 'faq-social-media' );
    301                
    302                 if ( $template ) {
    303                         include( $template );
    304                 }
     275        public function maybe_print_social_media()  {
     276                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_social_media', $this );
    305277        }
    306278
    … …  
    361333         * @since 2.0.0
    362334         */
    363         public function print_social_media_buttons() {
    364                 global $ewd_ufaq_controller;
    365                
    366                 if ( in_array( 'facebook', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_facebook_button(); }
    367                 if ( in_array( 'twitter', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_twitter_button(); }
    368                 if ( in_array( 'linkedin', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_linkedin_button(); }
    369                 if ( in_array( 'pinterest', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_pinterest_button(); }
    370                 if ( in_array( 'email', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_email_button(); }
     335        public function print_social_media_buttons()  {
     336                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_social_media_buttons', $this );
    371337        }
    372338
    … …  
    376342         * @since 2.0.0
    377343         */
    378         public function print_facebook_button() {
    379                
    380                 $template = $this->find_template( 'faq-social-media-facebook' );
    381                
    382                 if ( $template ) {
    383                         include( $template );
    384                 }
     344        public function print_facebook_button()  {
     345                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_facebook_button', $this );
    385346        }
    386347
    … …  
    390351         * @since 2.0.0
    391352         */
    392         public function print_twitter_button() {
    393                
    394                 $template = $this->find_template( 'faq-social-media-twitter' );
    395                
    396                 if ( $template ) {
    397                         include( $template );
    398                 }
     353        public function print_twitter_button()  {
     354                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_twitter_button', $this );
    399355        }
    400356
    … …  
    404360         * @since 2.0.0
    405361         */
    406         public function print_linkedin_button() {
    407                
    408                 $template = $this->find_template( 'faq-social-media-linkedin' );
    409                
    410                 if ( $template ) {
    411                         include( $template );
    412                 }
     362        public function print_linkedin_button()  {
     363                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_linkedin_button', $this );
    413364        }
    414365
    … …  
    418369         * @since 2.0.0
    419370         */
    420         public function print_pinterest_button() {
    421                
    422                 $template = $this->find_template( 'faq-social-media-pinterest' );
    423                
    424                 if ( $template ) {
    425                         include( $template );
    426                 }
     371        public function print_pinterest_button()  {
     372                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_pinterest_button', $this );
    427373        }
    428374
    … …  
    432378         * @since 2.0.0
    433379         */
    434         public function print_email_button() {
    435                
    436                 $template = $this->find_template( 'faq-social-media-email' );
    437                
    438                 if ( $template ) {
    439                         include( $template );
    440                 }
     380        public function print_email_button()  {
     381                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_email_button', $this );
    441382        }
    442383
    … …  
    459400                global $ewd_ufaq_controller;
    460401
    461                 return is_array( $ewd_ufaq_controller->settings->get_setting( 'faq-elements-order' ) ) ? $ewd_ufaq_controller->settings->get_setting( 'faq-elements-order' ) : json_decode( $ewd_ufaq_controller->settings->get_setting( 'faq-elements-order' ) );
     402                $elements = array( 'categories' => 'Categories', 'body' => 'Body', 'author_date' => 'Author/Date', 'tags' => 'Tags', 'permalink' => 'Permalink', 'comments' => 'Comments', 'back_to_top' => 'Back to Top' );
     403                return apply_filters( 'ewd_ufaq_faq_elements_order', $elements, $this );
    462404        }
    463405
    … …  
    467409         * @since 2.0.0
    468410         */
    469         public function get_color_block_shape() {
    470                 global $ewd_ufaq_controller;
    471 
    472                 return 'ewd-ufaq-' . $ewd_ufaq_controller->settings->get_setting( 'color-block-shape' );
    473         }
     411        public function get_color_block_shape()  {
     412                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_color_block_shape( $this ) : '';
     413        }
    474414
    475415        /**
    … …  
    500440         * @since 2.0.0
    501441         */
    502         public function get_custom_fields() {
    503                 global $ewd_ufaq_controller;
    504 
    505                 return ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    506         }
     442        public function get_custom_fields()  {
     443                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_custom_fields( $this ) : array();
     444        }
    507445
    508446        /**
    … …  
    511449         * @since 2.0.0
    512450         */
    513         public function get_custom_field_value( $custom_field ) {
    514 
    515                 $value = get_post_meta( $this->faq->post->ID, 'Custom_Field_' . $custom_field->id, true );
    516 
    517                 if ( $custom_field->type == 'file' ) {
    518 
    519                         return ! empty( $value ) ? '<a href="' . esc_attr( $value ) . '">' . strrpos( $value, '/' ) ? esc_html( substr( $value, strrpos( $value, '/' ) + 1 ) ) : esc_html( $value ) . '</a>' : '';
    520                 }
    521                 elseif ( $custom_field->type == 'link' ) {
    522 
    523                         return ! empty( $value ) ? '<a href="' . esc_attr( $value ) . '" target="_blank">' . esc_attr( $value ) . '</a>' : '';
    524                 }
    525                 else { return $value; }
     451        public function get_custom_field_value( $custom_field )  {
     452                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_custom_field_value( $this, $custom_field ) : '';
    526453        }
    527454
    … …  
    534461                global $ewd_ufaq_controller;
    535462
    536                 return $ewd_ufaq_controller->settings->get_setting( 'label-categories' ) ? $ewd_ufaq_controller->settings->get_setting( 'label-categories' ) : ( sizeOf( $this->faq->categories ) == 1 ? __( 'Category:', 'ultimate-faqs' ) : __( 'Categories:', 'ultimate-faqs' ) );
     463                return apply_filters( 'ewd_ufaq_custom_label', count( $this->faq->categories ) === 1 ? __( 'Category:', 'ultimate-faqs' ) : __( 'Categories:', 'ultimate-faqs' ), 'label-categories', $this );
    537464        }
    538465
    … …  
    558485                global $ewd_ufaq_controller;
    559486
    560                 return $ewd_ufaq_controller->settings->get_setting( 'label-tags' ) ? $ewd_ufaq_controller->settings->get_setting( 'label-tags' ) : ( sizeOf( $this->faq->tags ) == 1 ? __( 'Tag:', 'ultimate-faqs' ) : __( 'Tags:', 'ultimate-faqs' ) );
     487                return apply_filters( 'ewd_ufaq_custom_label', count( $this->faq->tags ) === 1 ? __( 'Tag:', 'ultimate-faqs' ) : __( 'Tags:', 'ultimate-faqs' ), 'label-tags', $this );
    561488        }
    562489
    … …  
    579506         * @since 2.0.0
    580507         */
    581         public function get_thumbs_up_image() {
    582                 global $ewd_ufaq_controller;
    583 
    584                 $img_url = ( $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) and $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) != 'http://' ) ? $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) : EWD_UFAQ_PLUGIN_URL . '/assets/img/Thumbs-up-icon.png';
    585 
    586                 return '<img src="' . esc_url( $img_url ) . '" alt="' . __( "Thumbs Up Icon", "ultimate-faqs" ) . '">';
    587         }
     508        public function get_thumbs_up_image()  {
     509                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_thumbs_up_image( $this ) : '';
     510        }
    588511
    589512        /**
    … …  
    592515         * @since 2.0.0
    593516         */
    594         public function get_up_votes() {
    595 
    596                 return get_post_meta( $this->faq->post->ID, "FAQ_Up_Votes", true ) ? get_post_meta( $this->faq->post->ID, "FAQ_Up_Votes", true ) : 0;
    597         }
     517        public function get_up_votes()  {
     518                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_up_votes( $this ) : 0;
     519        }
    598520
    599521        /**
    … …  
    602524         * @since 2.0.0
    603525         */
    604         public function get_thumbs_down_image() {
    605                 global $ewd_ufaq_controller;
    606 
    607                 $img_url = ( $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) and $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) != 'http://' ) ? $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) : EWD_UFAQ_PLUGIN_URL . '/assets/img/Thumbs-down-icon.png';
    608 
    609                 return '<img src="' . esc_url( $img_url ) . '" alt="' . __( "Thumbs Down Icon", "ultimate-faqs" ) . '">';
    610         }
     526        public function get_thumbs_down_image()  {
     527                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_thumbs_down_image( $this ) : '';
     528        }
    611529
    612530        /**
    … …  
    615533         * @since 2.0.0
    616534         */
    617         public function get_down_votes() {
    618 
    619                 return get_post_meta( $this->faq->post->ID, "FAQ_Down_Votes", true ) ? get_post_meta( $this->faq->post->ID, "FAQ_Down_Votes", true ) : 0;
    620         }
     535        public function get_down_votes()  {
     536                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_down_votes( $this ) : 0;
     537        }
    621538
    622539        /**
    … …  
    625542         * @since 2.0.0
    626543         */
    627         public function get_social_twitter_link() {
    628 
    629                 $text = __( 'Check out this helpful FAQ', 'ultimate-faqs' ) . ': ';
    630 
    631                 return 'https://twitter.com/intent/tweet?text=' . urlencode( $text ) . urlencode( $this->faq->post->post_title ) . urlencode( ' | ' ) . urlencode( $this->permalink );
    632         }
     544        public function get_social_twitter_link()  {
     545                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_twitter_link( $this ) : '';
     546        }
    633547
    634548        /**
    … …  
    637551         * @since 2.0.0
    638552         */
    639         public function get_social_linkedin_link() {
    640 
    641                 $text = __( 'Check out this helpful FAQ', 'ultimate-faqs' );
    642 
    643                 return 'http://www.linkedin.com/shareArticle?mini=true&amp;url=' . $this->permalink . "&amp;title=" . urlencode( $text ) . "&amp;summary=" . urlencode( $this->faq->post->post_title );
    644         }
     553        public function get_social_linkedin_link()  {
     554                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_linkedin_link( $this ) : '';
     555        }
    645556
    646557        /**
    … …  
    649560         * @since 2.0.0
    650561         */
    651         public function get_social_pinterest_link() {
    652 
    653                 $text = __( 'Check out this helpful FAQ', 'ultimate-faqs' ) . ': ';
    654 
    655                 return 'http://pinterest.com/pin/create/button/?url=' . $this->permalink . "&amp;description=" . urlencode( $text ) . urlencode( $this->faq->post->post_title );
    656         }
     562        public function get_social_pinterest_link()  {
     563                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_pinterest_link( $this ) : '';
     564        }
    657565
    658566        /**
    … …  
    661569         * @since 2.0.0
    662570         */
    663         public function get_social_email_mailto_link() {
    664 
    665                 $subject = __( 'Check out this helpful FAQ', 'ultimate-faqs' );
    666 
    667                 return 'mailto:?subject=' . urlencode( $subject ) . "&amp;body=" . urlencode( $this->faq->post->post_title ) . urlencode( ' | ' ) . urlencode( $this->permalink );
    668         }
     571        public function get_social_email_mailto_link()  {
     572                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_email_mailto_link( $this ) : '';
     573        }
    669574
    670575        /**
    … …  
    679584                        array(
    680585                                'ewd-ufaq-faq-div',
    681                                 'ewd-ufaq-faq-column-count-' . $ewd_ufaq_controller->settings->get_setting( 'number-of-columns' ),
    682                                 'ewd-ufaq-faq-responsive-columns-' . $ewd_ufaq_controller->settings->get_setting( 'responsive-columns' ),
    683                                 'ewd-ufaq-faq-display-style-' . $ewd_ufaq_controller->settings->get_setting( 'display-style' ),
     586                                'ewd-ufaq-faq-column-count-one',
     587                                'ewd-ufaq-faq-responsive-columns-',
     588                                'ewd-ufaq-faq-display-style-default',
    684589                        )
    685590                );
    … …  
    729634                $this->date = get_the_date( '', $this->faq->post->ID );
    730635               
    731                 if ( ! empty( $this->search_string ) and $ewd_ufaq_controller->settings->get_setting( 'highlight-search-term' ) ) {
    732 
    733                         $this->faq_title  = $this->highlight_across_tags( $this->faq_title,  $this->search_string );
    734                         $this->faq_answer = $this->highlight_across_tags( $this->faq_answer, $this->search_string );
    735                 }
     636                do_action( 'ewd_ufaq_faq_display_variables', $this );
    736637               
    737638                remove_filter( 'siteorigin_panels_filter_content_enabled', array( $this, 'disable_site_origin_page_builder' ) );
    … …  
    746647         * @since 2.0.0
    747648         */
    748         public function highlight_across_tags( $html, $term, $class = 'ewd-ufaq-highlight-search-term' ) {
    749 
    750                 $term = trim( $term );
    751                 if ( $term === '' ) { return $html; }
    752 
    753                 $pattern = '/' . preg_quote( $term, '/' ) . '/iu';
    754 
    755                 // Parse HTML
    756                 $dom = new DOMDocument( '1.0', 'UTF-8' );
    757                 libxml_use_internal_errors( true );
    758                 $dom->loadHTML( '<?xml encoding="utf-8" ?>' . $html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
    759                 libxml_clear_errors();
    760 
    761                 $xpath = new DOMXPath( $dom );
    762 
    763                 // Collect all text nodes in document order and build a flat text map
    764                 $nodes  = array();
    765                 $full   = '';
    766                 $offset = 0;
    767 
    768                 // Include empty text nodes too (a match might begin/end at their edges)
    769                 foreach ( $xpath->query( '//text()' ) as $t ) {
    770                         $text    = isset( $t->nodeValue ) ? $t->nodeValue : '';
    771                         $len     = mb_strlen( $text, 'UTF-8' );
    772                         $nodes[] = array( 'node' => $t, 'start' => $offset, 'end' => $offset + $len );
    773                         $full   .= $text;
    774                         $offset += $len;
    775                 }
    776 
    777                 if ( $full === '' || empty( $nodes ) ) {
    778                         // Nothing to do
    779                         $result = $dom->saveHTML();
    780                         return preg_replace( '/^<\?xml.*?\?>/u', '', $result ) ? preg_replace( '/^<\?xml.*?\?>/u', '', $result ) : $html;
    781                 }
    782 
    783                 // Find matches in the flattened text
    784                 if ( ! preg_match_all( $pattern, $full, $m, PREG_OFFSET_CAPTURE ) ) {
    785                         $result = $dom->saveHTML();
    786                         return preg_replace( '/^<\?xml.*?\?>/u', '', $result ) ? preg_replace( '/^<\?xml.*?\?>/u', '', $result ) : $html;
    787                 }
    788 
    789                 // Build match list (convert byte offsets to Unicode codepoint offsets)
    790                 $matches = array();
    791                 foreach ( $m[0] as $mm ) {
    792                         $match_text = $mm[0];
    793                         $start_byte = $mm[1];
    794 
    795                         $pre    = mb_substr( $full, 0, $start_byte, 'UTF-8' );
    796                         $start  = mb_strlen( $pre, 'UTF-8' );
    797                         $length = mb_strlen( $match_text, 'UTF-8' );
    798 
    799                         $matches[] = array( 'start' => $start, 'length' => $length );
    800                 }
    801 
    802                 if ( empty( $matches ) ) {
    803                         $result = $dom->saveHTML();
    804                         return preg_replace( '/^<\?xml.*?\?>/u', '', $result ) ? preg_replace( '/^<\?xml.*?\?>/u', '', $result ) : $html;
    805                 }
    806 
    807                 // Process matches from right to left so earlier offsets aren't invalidated
    808                 usort(
    809                         $matches,
    810                         function( $a, $b ) {
    811                                 if ( $a['start'] === $b['start'] ) { return 0; }
    812                                 return ( $a['start'] < $b['start'] ) ? 1 : -1;
    813                         }
    814                 );
    815 
    816                 foreach ( $matches as $match ) {
    817                         $m_start = $match['start'];
    818                         $m_end   = $match['start'] + $match['length'];
    819 
    820                         // Walk text nodes and wrap overlapping slices
    821                         foreach ( $nodes as $entry ) {
    822 
    823                                 /** @var DOMText $text_node */
    824                                 $text_node = $entry['node'];
    825                                 $n_start   = $entry['start'];
    826                                 $n_end     = $entry['end'];
    827 
    828                                 // No overlap?
    829                                 if ( $m_end <= $n_start || $m_start >= $n_end ) { continue; }
    830 
    831                                 // Local offsets in this node
    832                                 $local_start = max( 0, $m_start - $n_start );
    833                                 $local_end   = min( $n_end, $m_end ) - $n_start;
    834 
    835                                 // Split into [before][target][after]
    836                                 // Note: DOMText::splitText uses UTF-16 offsets internally but PHP maps by characters.
    837                                 // Using mb_* derived offsets aligns with DOM for BMP; for safety we keep to mb_strlen logic.
    838                                 if ( $local_end < mb_strlen( $text_node->data, 'UTF-8' ) ) {
    839                                         $after_node = $text_node->splitText( $local_end );
    840                                 } else {
    841                                         $after_node = null;
    842                                 }
    843 
    844                                 $target_node = $text_node;
    845                                 if ( $local_start > 0 ) {
    846                                         $target_node = $text_node->splitText( $local_start );
    847                                 }
    848 
    849                                 // Wrap the target slice
    850                                 $span = $dom->createElement( 'span' );
    851                                 $span->setAttribute( 'class', $class );
    852                                 $target_node->parentNode->replaceChild( $span, $target_node );
    853                                 $span->appendChild( $target_node );
    854                         }
    855                 }
    856 
    857                 // Return HTML without the XML declaration we prepended
    858                 $result = $dom->saveHTML();
    859                 $result = preg_replace( '/^<\?xml.*?\?>/u', '', $result );
    860 
    861                 return $result ? $result : $html;
     649        public function highlight_across_tags( $html, $term, $class = 'ewd-ufaq-highlight-search-term' )  {
     650                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::highlight_across_tags( $this, $html, $term, $class ) : $html;
    862651        }
    863652
    … …  
    1082871         */
    1083872        public function enqueue_assets() {
    1084                
    1085                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    1086                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
     873                global $ewd_ufaq_controller;
     874                if ( ! $ewd_ufaq_controller->get_front_end_php_data( 'ewd-ufaq-js', 'ewd_ufaq_php_data' ) ) {
     875                        $args = array( 'nonce' => wp_create_nonce( 'ewd-ufaq-js' ), 'faq_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ), 'category_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ), 'faq_scroll' => $ewd_ufaq_controller->settings->get_setting( 'scroll-to-top' ) );
     876                        $ewd_ufaq_controller->add_front_end_php_data( 'ewd-ufaq-js', 'ewd_ufaq_php_data', apply_filters( 'ewd_ufaq_js_localize_data', $args, $this ) );
     877                }
     878               
    1087879                wp_enqueue_style( 'ewd-ufaq-css' );
    1088880
    1089                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    1090                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
    1091 
    1092881                wp_enqueue_script( 'ewd-ufaq-js' );
    1093 
     882                do_action( 'ewd_ufaq_view_assets', $this );
     883
     884        }
     885        public function get_body_classes() {
     886                $classes = array( 'ewd-ufaq-faq-body' );
     887                if ( ! $this->display_all_answers ) { $classes[] = 'ewd-ufaq-hidden'; }
     888                return apply_filters( 'ewd_ufaq_faq_body_classes', $classes, $this );
    1094889        }
    1095890}
  • ultimate-faqs/tags/2.7.0/views/View.FAQSearch.class.php

    r3704732 r3821169  
    2626         */
    2727        public function render() {
    28                 global $ewd_ufaq_controller;
    29 
    30                 // Add any dependent stylesheets or javascript
    31                 $this->enqueue_assets();
    32 
    33                 if ( empty( $this->show_on_load ) ) {
    34                         $this->faqs = array();
    35                 }
    36                 else {
    37                         $this->add_schema_data();
    38                 }
    39 
    40                 $this->set_faqs_options();
    41 
    42                 $this->create_faq_data();
    43 
    44                 // Add css classes to the slider
    45                 $this->classes = $this->get_classes();
    46 
    47                 ob_start();
    48 
    49                 $this->add_custom_styling();
    50 
    51                 $template = $this->find_template( 'faqs-search' );
    52                 if ( $template ) {
    53                         include( $template );
    54                 }
    55 
    56                 $template = $this->find_template( 'faqs' );
    57                 if ( $template ) {
    58                         include( $template );
    59                 }
    60 
    61                 $output = ob_get_clean();
    62 
    63                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) == 'list' ){
    64 
    65                         $output = $this->replace_list_header( $output );
    66                 }
    67 
    68                 return apply_filters( 'ewd_ufaq_search_faqs_output', $output, $this );
     28                return class_exists( 'ewdufaqEWDPHSearch', false ) ? ewdufaqEWDPHSearch::render( $this ) : ewdufaqBasicSearch::render( get_object_vars( $this ) );
    6929        }
    7030
    … …  
    8848         */
    8949        public function maybe_print_search_submit() {
    90                 global $ewd_ufaq_controller;
    91 
    92                 if ( $ewd_ufaq_controller->settings->get_setting( 'auto-complete-titles' ) ) { return; }
    93 
    94                 $template = $this->find_template( 'faqs-search-submit' );
    95                 if ( $template ) {
    96                         include( $template );
    97                 }
     50                if ( class_exists( 'ewdufaqEWDPHSearch', false ) ) { ewdufaqEWDPHSearch::maybe_print_search_submit( $this ); }
    9851        }
    9952
    … …  
    10962                        array(
    11063                                'ewd-ufaq-faq-list',
    111                                 'ewd-ufaq-page-type-' . $ewd_ufaq_controller->settings->get_setting( 'page-type' ),
    112                                 'ewd-ufaq-category-tabs-' . $ewd_ufaq_controller->settings->get_setting( 'category-tabs' ),
     64                                'ewd-ufaq-page-type-distinct',
     65                                'ewd-ufaq-category-tabs-',
    11366                                'ewd-ufaq-search'
    11467                        )
    11568                );
    11669
    117                 if ( $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ) or $ewd_ufaq_controller->settings->get_setting( 'category-tabs' ) ) {
     70                if ( $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ) ) {
    11871                        $classes[] = 'ewd-ufaq-faq-category-title-accordion';
    11972                }
  • ultimate-faqs/tags/2.7.0/views/View.FAQs.class.php

    r3704732 r3821169  
    134134                $output = ob_get_clean();
    135135
    136                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) == 'list' ){
    137 
    138                         $output = $this->replace_list_header( $output );
    139                 }
     136                $output = apply_filters( 'ewd_ufaq_rendered_list_output', $output, $this );
    140137
    141138                return apply_filters( 'ewd_ufaq_faqs_output', $output, $this );
    … …  
    180177         * @since 2.0.0
    181178         */
    182         public function maybe_print_header() {
    183                 global $ewd_ufaq_controller;
    184                
    185                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) != 'list' ) { return; }
    186                
    187                 echo '%list_header_placeholder%';
     179        public function maybe_print_header()  {
     180                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_header', $this );
    188181        }
    189182
    … …  
    218211                        $args[ 'orderby' ] = $this->category_orderby;
    219212                }
    220                 elseif ( ! empty( $this->category_orderby ) ) {
    221 
    222                         $args[ 'meta_key' ] = 'ufaq_category_order';
    223                         $args[ 'orderby' ] = 'meta_value_num';
    224 
    225                 }
     213                $args = apply_filters( 'ewd_ufaq_category_query_args', $args, $this );
    226214
    227215                $categories = get_terms( $args );
    … …  
    418406         * @since 2.0.0
    419407         */
    420         public function maybe_print_pagination() {
    421 
    422                 if ( $this->max_page <= 1 ) { return; }
    423 
    424                 $template = $this->find_template( 'faqs-pagination' );
    425                
    426                 if ( $template ) {
    427                         include( $template );
    428                 }
     408        public function maybe_print_pagination()  {
     409                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_pagination', $this );
    429410        }
    430411
    … …  
    434415         * @since 2.0.0
    435416         */
    436         public function replace_list_header( $output ) {
    437 
    438                 if ( $this->group_by_category ) { $template = $this->find_template( 'faqs-category-list-header' ); }
    439                 else { $template = $this->find_template( 'faqs-list-header' ); }
    440                
    441                 ob_start();
    442 
    443                 if ( $template ) {
    444                         include( $template );
    445                 }
    446 
    447                 $list_header = ob_get_clean();
    448 
    449                 return str_replace( '%list_header_placeholder%', $list_header, $output );
     417        public function replace_list_header( $output )  {
     418                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::replace_list_header( $this, $output ) : $output;
    450419        }
    451420
    … …  
    503472                        array(
    504473                                'ewd-ufaq-faq-list',
    505                                 'ewd-ufaq-page-type-' . $ewd_ufaq_controller->settings->get_setting( 'page-type' ),
    506                                 'ewd-ufaq-category-tabs-' . $ewd_ufaq_controller->settings->get_setting( 'category-tabs' )
     474                                'ewd-ufaq-page-type-distinct',
     475                                'ewd-ufaq-category-tabs-'
    507476                        )
    508477                );
    … …  
    564533                $this->max_page = ceil( $this->faq_count / $this->faqs_per_page );
    565534
    566                 if ( ! $this->group_by_category and $ewd_ufaq_controller->settings->get_setting( 'display-style' ) != 'list' ) { return; }
     535                if ( ! apply_filters( 'ewd_ufaq_needs_category_data', (bool) $this->group_by_category, $this ) ) { return; }
    567536
    568537                $args = array(
    … …  
    576545                        $args[ 'orderby' ] = $this->category_orderby;
    577546                }
    578                 elseif ( ! empty( $this->category_orderby ) ) {
    579 
    580                         $args[ 'meta_key' ] = 'ufaq_category_order';
    581                         $args[ 'orderby' ] = 'meta_value_num';
    582 
    583                 }
     547                $args = apply_filters( 'ewd_ufaq_category_query_args', $args, $this );
    584548
    585549                $categories = get_terms( $args );
    … …  
    717681                global $ewd_ufaq_controller;
    718682
    719                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol' ) ) ) { return false; }
     683                if ( ! $this->get_category_toggle_symbol() ) { return false; }
    720684
    721685                if ( empty( $ewd_ufaq_controller->settings->get_setting( 'faq-category-toggle' ) ) ) { return false; }
    … …  
    732696                global $ewd_ufaq_controller;
    733697
    734                 return 'ewd-ufaq-' . $ewd_ufaq_controller->settings->get_setting( 'color-block-shape' );
     698                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_color_block_shape( $this ) : '';
    735699        }
    736700
    … …  
    740704         * @since 2.4.3
    741705         */
    742         public function get_category_toggle_symbol() {
    743                 global $ewd_ufaq_controller;
    744 
    745                 return strtolower( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol' ) );
    746         }
     706        public function get_category_toggle_symbol()  {
     707                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_category_toggle_symbol( $this ) : '';
     708        }
    747709
    748710        /**
    … …  
    790752         */
    791753        public function enqueue_assets() {
    792                 global $ewd_ufaq_controller, $wp_scripts;
    793 
    794                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    795                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
     754                global $ewd_ufaq_controller;
    796755                wp_enqueue_style( 'ewd-ufaq-css' );
    797                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) == 'minimalist' ) {
    798                         wp_enqueue_style( 'ewd-ufaq-minimalist' );
    799                 }
    800 
    801                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    802                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
    803 
    804                 $handle = 'ewd-ufaq-js';
     756                wp_enqueue_script( 'ewd-ufaq-js' );
    805757                $args = array(
    806                         'faq_accordion'         => isset( $this->faq_accordion ) ? $this->faq_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ),
    807                         'category_accordion'    => isset( $this->category_accordion ) ? $this->category_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ),
    808                         'faq_scroll'            => $ewd_ufaq_controller->settings->get_setting( 'scroll-to-top' ),
    809                         'reveal_effect'         => $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ),
    810                         'retrieving_results'    => $ewd_ufaq_controller->settings->get_setting( 'label-retrieving-results' ),
    811                         'highlight_search_term' => $ewd_ufaq_controller->settings->get_setting( 'highlight-search-term' ),
    812                         'save_search_terms'     => $ewd_ufaq_controller->settings->get_setting( 'save-search-terms' ),
    813                         'autocomplete_question' => $ewd_ufaq_controller->settings->get_setting( 'auto-complete-titles' ),
    814                         'question_titles'       => $this->get_faq_titles(),
    815                         'display_faq'           => 0,
    816                         'nonce'                 => wp_create_nonce( $handle ),
     758                        'faq_accordion' => isset( $this->faq_accordion ) ? $this->faq_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ),
     759                        'category_accordion' => isset( $this->category_accordion ) ? $this->category_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ),
     760                        'faq_scroll' => $ewd_ufaq_controller->settings->get_setting( 'scroll-to-top' ),
     761                        'display_faq' => 0,
     762                        'nonce' => wp_create_nonce( 'ewd-ufaq-js' ),
    817763                );
    818 
    819                 if ( ! empty( get_query_var( 'single_faq' ) ) ) {
    820 
     764                if ( get_query_var( 'single_faq' ) ) {
    821765                        $faq = get_page_by_path( get_query_var( 'single_faq' ), OBJECT, EWD_UFAQ_FAQ_POST_TYPE );
    822                         $args['display_faq'] = $faq->ID;
    823                 }
    824                 elseif ( isset( $_GET['Display_FAQ'] ) ) {
    825                         $args['display_faq'] = intval( $_GET['Display_FAQ'] );
    826                 }
    827 
    828                 // Fetch any existing script data
    829                 $prev_question_titles = $ewd_ufaq_controller->get_front_end_php_data( $handle, 'question_titles' );
    830 
    831                 if ( ! empty( $prev_question_titles ) ) {
    832                         $args['question_titles'] = array_merge( $prev_question_titles, $args['question_titles'] );
    833                         $args['question_titles'] = array_unique( $args['question_titles'] );
    834                 }
    835 
    836                 $ewd_ufaq_controller->add_front_end_php_data( $handle, 'question_titles', $args['question_titles'] );
    837 
    838                 wp_enqueue_script( $handle );
    839                
    840                 $ewd_ufaq_controller->add_front_end_php_data( $handle, 'ewd_ufaq_php_data', apply_filters( 'ewd_ufaq_js_localize_data', $args ) );
    841 
    842                 wp_enqueue_script( 'jquery-ui-core' );
    843 
    844                 if ( $ewd_ufaq_controller->settings->get_setting( 'auto-complete-titles' ) ) {
    845 
    846                         wp_enqueue_script( 'jquery-ui-autocomplete' );
    847                 }
    848 
    849                 if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) != 'none' ) {
    850 
    851                         wp_enqueue_script( 'jquery-effects-core' );
    852                         wp_enqueue_script( 'jquery-ui-autocomplete' );
    853 
    854                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'blind' ) { wp_enqueue_script( 'jquery-effects-blind' ); }
    855                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'bounce' ) { wp_enqueue_script( 'jquery-effects-bounce' ); }
    856                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'clip' ) { wp_enqueue_script( 'jquery-effects-clip' ); }
    857                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'drop' ) { wp_enqueue_script( 'jquery-effects-drop' ); }
    858                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'explode' ) { wp_enqueue_script( 'jquery-effects-explode' ); }
    859                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'fade' ) { wp_enqueue_script( 'jquery-effects-fade' ); }
    860                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'fold' ) { wp_enqueue_script( 'jquery-effects-fold' ); }
    861                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'highlight' ) { wp_enqueue_script( 'jquery-effects-highlight' ); }
    862                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'pulsate' ) { wp_enqueue_script( 'jquery-effects-pulsate' ); }
    863                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'shake' ) { wp_enqueue_script( 'jquery-effects-shake' ); }
    864                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'slide' ) { wp_enqueue_script( 'jquery-effects-slide' ); }
    865                 }
    866 
     766                        $args['display_faq'] = $faq instanceof WP_Post ? $faq->ID : 0;
     767                } elseif ( isset( $_GET['Display_FAQ'] ) && is_scalar( $_GET['Display_FAQ'] ) ) {
     768                        $args['display_faq'] = absint( $_GET['Display_FAQ'] );
     769                }
     770                $ewd_ufaq_controller->add_front_end_php_data( 'ewd-ufaq-js', 'ewd_ufaq_php_data', apply_filters( 'ewd_ufaq_js_localize_data', $args, $this ) );
     771                do_action( 'ewd_ufaq_view_assets', $this );
    867772        }
    868773}
  • ultimate-faqs/tags/2.7.0/views/View.class.php

    r3744649 r3821169  
    7171         */
    7272        function find_template( $template ) {
     73                global $ewd_ufaq_controller;
     74                $paid = array(
     75                        'faq-custom-fields' => 'fields',
     76                        'faq-ratings' => 'premium',
     77                        'faq-social-media' => 'premium',
     78                        'faq-social-media-email' => 'premium',
     79                        'faq-social-media-facebook' => 'premium',
     80                        'faq-social-media-linkedin' => 'premium',
     81                        'faq-social-media-pinterest' => 'premium',
     82                        'faq-social-media-twitter' => 'premium',
     83                        'faqs-pagination' => 'premium',
     84                        'faqs-list-header' => 'premium',
     85                        'faqs-category-list-header' => 'premium',
     86                        'faqs-search' => 'search',
     87                        'faqs-search-submit' => 'search',
     88                        'submit-faq' => 'submit-faq',
     89                        'submit-faq-captcha' => 'submit-faq',
     90                        'submit-faq-custom-field-checkbox' => 'submit-faq',
     91                        'submit-faq-custom-field-date' => 'submit-faq',
     92                        'submit-faq-custom-field-datetime' => 'submit-faq',
     93                        'submit-faq-custom-field-radio' => 'submit-faq',
     94                        'submit-faq-custom-field-select' => 'submit-faq',
     95                        'submit-faq-custom-field-text' => 'submit-faq',
     96                        'submit-faq-custom-field-textarea' => 'submit-faq',
     97                        'submit-faq-field-author-email' => 'submit-faq',
     98                        'submit-faq-field-author' => 'submit-faq',
     99                        'submit-faq-field-faq-answer' => 'submit-faq',
     100                        'submit-faq-field-faq-question' => 'submit-faq',
     101                        'submit-faq-submitted-faq-message' => 'submit-faq',
     102                );
     103                if ( ! is_string( $template ) || ( 0 === strpos( $template, 'submit-faq' ) && ! isset( $paid[ $template ] ) ) ) { return false; }
     104                $capability = isset( $paid[ $template ] ) ? $paid[ $template ] : '';
     105                if ( $capability && ( ! isset( $ewd_ufaq_controller->permissions ) || ! $ewd_ufaq_controller->permissions->check_permission( $capability ) ) ) {
     106                        return false;
     107                }
    73108
    74109                $this->template_dirs = array(
    … …  
    78113                );
    79114               
    80                 $this->template_dirs = apply_filters( 'ewd_ufaq_template_directories', $this->template_dirs );
     115                $this->template_dirs = apply_filters( 'ewd_ufaq_template_directories', $this->template_dirs, $template, $this );
    81116
    82117                foreach ( $this->template_dirs as $dir ) {
     118                        // Never execute an obsolete paid default left by a merge-style update.
     119                        // Child/parent and explicitly supplied integration directories still work.
     120                        if ( $capability && rtrim( wp_normalize_path( $dir ), '/' ) === wp_normalize_path( EWD_UFAQ_PLUGIN_DIR . '/' . EWD_UFAQ_TEMPLATE_DIR ) ) { continue; }
    83121                        if ( file_exists( $dir . $template . '.php' ) ) {
    84122                                return $dir . $template . '.php';
    … …  
    86124                }
    87125
     126                if ( $capability ) { do_action( 'ewd_ufaq_missing_paid_template', $template ); }
    88127                return false;
    89128        }
    … …  
    110149                if ( empty( $this->label_defaults ) ) { $this->set_label_defaults(); }
    111150
    112                 return ! empty( $ewd_ufaq_controller->settings->get_setting( $label_name ) ) ? $ewd_ufaq_controller->settings->get_setting( $label_name ) : $this->label_defaults[ $label_name ];
     151                $default = isset( $this->label_defaults[ $label_name ] ) ? $this->label_defaults[ $label_name ] : '';
     152                return apply_filters( 'ewd_ufaq_custom_label', $default, $label_name, $this );
    113153        }
    114154
    … …  
    150190
    151191        public function add_custom_styling() {
    152                 global $ewd_ufaq_controller;
    153 
    154                 $heading_type = $ewd_ufaq_controller->settings->get_setting( 'styling-faq-heading-type' );
    155                 $category_heading_type = $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-type' );
    156 
    157                 $css = '';
    158 
    159                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-background-color' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { background-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-background-color' ) . ' !important; }'; }
    160                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-font-color' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-font-color' ) . ' !important; }'; }
    161                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-size' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { border-width: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-size' ) . ' !important; }'; }
    162                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-color' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { border-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-color' ) . ' !important; }'; }
    163                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-radius' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { border-radius: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-radius' ) . ' !important; }'; }
    164                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol-size' ) != '' ) { $css .= '.ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol-size' ) . ' !important; }'; }
    165                        
    166                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-background-color' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { background-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-background-color' ) . ' !important; }'; }
    167                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-font-color' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-font-color' ) . ' !important; }'; }
    168                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-size' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { border-width: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-size' ) . ' !important; }'; }
    169                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-color' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { border-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-color' ) . ' !important; }'; }
    170                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-radius' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { border-radius: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-radius' ) . ' !important; }'; }
    171                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol-size' ) != '' ) { $css .= '.ewd-ufaq-faq-category-title .ewd-ufaq-category-post-margin-symbol span { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol-size' ) . ' !important; }'; }
    172                        
    173                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) != '' ) {
    174 
    175                                 $css .= ".ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active a,.ewd-ufaq-faq-display-style-block:hover, .ewd-ufaq-faq-display-style-block:hover a, .ewd-ufaq-faq-display-style-block:hover $heading_type { background-color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) . ' !important; }';
    176                                 $css .= ".ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-border_block:hover, .ewd-ufaq-faq-display-style-border_block:hover $heading_type { background-color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) . ' !important; }';
    177                                 $css .= ".ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body { border-color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) . ' !important; }';
    178                                 $css .= ".ewd-ufaq-faq-display-style-border_block .comment-reply-title, .ewd-ufaq-faq-display-style-border_block:hover .comment-reply-title { background-color: transparent !important; }";
    179                         }
    180 
    181                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-block-font-color' ) != '' ) {
    182 
    183                                 $css .= ".ewd-ufaq-faq-display-style-block:hover .ewd-ufaq-post-margin-symbol, .ewd-ufaq-category-post-margin-symbol, .ewd-ufaq-faq-display-style-block:hover $heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-font-color' ) . ' !important; }';
    184                                 $css .= ".ewd-ufaq-faq-display-style-border_block:hover .ewd-ufaq-post-margin-symbol, .ewd-ufaq-category-post-margin-symbol, .ewd-ufaq-faq-display-style-border_block:hover $heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-font-color' ) . ' !important; }';
    185                         }
    186 
    187                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-font' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-font' ) . ' !important; }'; }
    188                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-size' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-size' ) . ' !important; }'; }
    189                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-color' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-color' ) . ' !important; }'; }
    190                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-margin' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-margin' ) . ' !important; }'; }
    191                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-padding' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-padding' ) . ' !important; }'; }
    192 
    193                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-font' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { font-family: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-font' ) . ' !important; }'; }
    194                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-size' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { font-size: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-size' ) . ' !important; }'; }
    195                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-color' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-color' ) . ' !important; }'; }
    196                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-margin' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { margin: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-margin' ) . ' !important; }'; }
    197                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-padding' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { padding: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-padding' ) . ' !important; }'; }
    198                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-icon-top-margin' ) != '' ) { $css .= ".ewd-ufaq-post-margin-symbol { margin-top: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-icon-top-margin' ) . ' !important; }'; }
    199                        
    200                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font' ) . ' !important; }'; }
    201                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-size' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-size' ) . ' !important; }'; }
    202                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-color' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-color' ) . ' !important; }'; }
    203                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-margin' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-margin' ) . ' !important; }'; }
    204                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-padding' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-padding' ) . ' !important; }'; }
    205 
    206                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font' ) . ' !important; }'; }
    207                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-size' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-size' ) . ' !important; }'; }
    208                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-color' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-color' ) . ' !important; }'; }
    209                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-margin' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-margin' ) . ' !important; }'; }
    210                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-padding' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-padding' ) . ' !important; }'; }
    211 
    212                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font' ) != '' ) { $css .= "div.ewd-ufaq-faq-category-title $category_heading_type { font-family: " . $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font' ) . ' !important; }'; }
    213                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-size' ) != '' ) { $css .= "div.ewd-ufaq-faq-category-title $category_heading_type { font-size: " . $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-size' ) . ' !important; }'; }
    214                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-color' ) != '' ) { $css .= "div.ewd-ufaq-faq-category-title $category_heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-color' ) . ' !important; }'; }
    215                        
    216                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-font' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-font' ) . ' !important; }'; }
    217                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-size' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-size' ) . ' !important; }'; }
    218                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-color' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-color' ) . ' !important; }'; }
    219                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-margin' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-margin' ) . ' !important; }'; }
    220                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-padding' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-padding' ) . ' !important; }'; }
    221 
    222                         $css .= $ewd_ufaq_controller->settings->get_setting( 'custom-css' );
    223 
    224                 if( ! empty( $css ) ) {
    225                         echo '<style>';
    226                                 echo $css;
    227                         echo '</style>';
     192                // The Basic settings Custom CSS box is a Free feature, distinct from paid
     193                // per-element styling controls. Keep it effective without Helper or rights.
     194                $css = $this->get_option( 'custom-css' );
     195                $css = apply_filters( 'ewd_ufaq_custom_styles', is_string( $css ) ? $css : '', $this );
     196                if ( is_string( $css ) && '' !== $css ) {
     197                        echo '<style>' . str_ireplace( '</style', '', $css ) . '</style>';
    228198                }
    229199        }
  • ultimate-faqs/trunk/assets/css/ewd-ufaq-admin.css

    r3744649 r3821169  
    1 .ewd-ufaq-clear {
     1
     2.ewd-ufaq-clear{
    23        clear: both;
    3 }
    4 .ewd-ufaq-item {
    5         cursor: move;
    64}
    75
    86.ufaq_page_ewd-ufaq-dashboard,
    97.ufaq_page_ewd-ufaq-settings,
    10 .post-type-ufaq,
    11 .ufaq_page_ewd-ufaq-ordering-table {
     8.post-type-ufaq{
    129        background: #fff;
    1310}
     11
    1412.ufaq_page_ewd-ufaq-settings .wrap,
    15 .post-type-ufaq .wrap,
    16 .ufaq_page_ewd-ufaq-ordering-table .wrap {
     13.post-type-ufaq .wrap{
    1714        margin: 10px 0 0 -20px;
    1815        box-sizing: border-box;
    1916}
     17
    2018.ufaq_page_ewd-ufaq-settings .wrap *,
    21 .post-type-ufaq .wrap *,
    22 .ufaq_page_ewd-ufaq-ordering-table .wrap * {
     19.post-type-ufaq .wrap *{
    2320        box-sizing: border-box;
    2421}
    2522
    26 
    27 /* BANNER */
    28 
    29 .ewd-ufaq-dashboard-new-upgrade-banner {
     23.ewd-ufaq-dashboard-new-upgrade-banner{
    3024        position: relative;
    3125        display: flex;
    … …  
    3630        box-sizing: border-box;
    3731}
    38 .ewd-ufaq-dashboard-new-upgrade-banner * {
     32
     33.ewd-ufaq-dashboard-new-upgrade-banner *{
    3934        box-sizing: border-box;
    4035}
    41 .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     36
     37.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    4238        position: absolute;
    4339        height: 112px;
    … …  
    4844        background-size: 112px 112px;
    4945}
    50 .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     46
     47.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    5148        position: absolute;
    5249        height: 112px;
    … …  
    5552        top: 84px;
    5653}
    57 .ewd-ufaq-dashboard-new-upgrade-button {
     54
     55.ewd-ufaq-dashboard-new-upgrade-button{
    5856        display: flex;
    5957        justify-content: center;
    … …  
    7270        transition: background .25s, color .25s, border-color .25s;
    7371}
    74 .ewd-ufaq-dashboard-new-upgrade-button:hover {
     72
     73.ewd-ufaq-dashboard-new-upgrade-button:hover{
    7574        background: #915add;
    7675        border-color: #915add;
    7776        color: #fff;
    7877}
    79 .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button  {
     78
     79.ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button{
    8080        background-color: transparent;
    8181        border: 1px solid #0acbaa;
    8282        color: #0acbaa;
    8383}
    84 .ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button:hover  {
     84
     85.ewd-ufaq-dashboard-new-upgrade-button.ewd-ufaq-dashboard-new-trial-button:hover{
    8586        background-color: #0acbaa;
    8687        border-color: #0acbaa;
    8788        color: #fff;
    8889}
    89 .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     90
     91.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    9092        position: absolute;
    9193        display: flex;
    … …  
    9799        color: #fff;
    98100}
    99 .ewd-ufaq-dashboard-banner-title {
     101
     102.ewd-ufaq-dashboard-banner-title{
    100103        font-size: 29px;
    101104        line-height: 32px;
    102105        font-weight: bold;
    103106}
    104 .ewd-ufaq-dashboard-banner-brief {
     107
     108.ewd-ufaq-dashboard-banner-brief{
    105109        margin-top: 14px;
    106110        font-size: 14px;
    107111}
    108112
     113
    109114@media screen and (min-width: 1700px) {
    110         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     115.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    111116                left: 272px;
    112117        }
    113         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     118
     119.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    114120                right: 228px;
    115121        }
    116         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     122
     123.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    117124                width: calc(100% - 880px);
    118125                left: 420px;
    119         }
    120 }
     126        }}
     127
    121128@media screen and (max-width: 1200px) {
    122         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     129.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    123130                left: 54px;
    124131        }
    125         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     132
     133.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    126134                right: 32px;
    127135        }
    128         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     136
     137.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    129138                width: calc(100% - 466px);
    130139                left: 202px;
    131         }
    132 }
     140        }}
     141
    133142@media screen and (max-width: 800px) {
    134         .ewd-ufaq-dashboard-new-upgrade-banner {
     143.ewd-ufaq-dashboard-new-upgrade-banner{
    135144                height: 512px;
    136145                height: 300px;
    137146        }
    138         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon {
     147
     148.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-icon{
    139149                left: calc(50% - 56px);
    140150                top: 48px;
    141151                display: none;
    142152        }
    143         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text {
     153
     154.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-text{
    144155                width: 80%;
    145156                left: 10%;
    … …  
    150161                top: 42px;
    151162        }
    152         .ewd-ufaq-dashboard-banner-brief {
     163
     164.ewd-ufaq-dashboard-banner-brief{
    153165                display: none;
    154         } 
    155         .ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons {
     166        }
     167
     168.ewd-ufaq-dashboard-new-upgrade-banner .ewd-ufaq-dashboard-banner-buttons{
    156169                right: calc(50% - 96px);
    157170                top: 368px;
    158171                top: 172px;
    159         }
    160 }
    161 
    162 
    163 /* MENU */
    164 
    165 .ewd-ufaq-admin-header-menu {
     172        }}
     173
     174.ewd-ufaq-admin-header-menu{
    166175        margin: 48px 96px 0 76px;
    167176}
    168 .ewd-ufaq-admin-header-menu .nav-tab-wrapper {
     177
     178.ewd-ufaq-admin-header-menu .nav-tab-wrapper{
    169179        border: 0;
    170180        margin: 0;
    … …  
    174184        border-bottom: 1px solid #e9e9e9;
    175185}
    176 .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab {
     186
     187.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab{
    177188        border: 0;
    178189        margin: 0 28px -1px 0;
    … …  
    183194        font-size: 20px;
    184195}
     196
    185197.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab:nth-of-type(1n+2):hover,
    186 .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab.nav-tab-active {
     198.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab.nav-tab-active{
    187199        color: #7B31AF;
    188200        border-bottom-color: #7B31AF;
    189201}
    190 .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
     202
     203.ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open{
    191204        display: none;
    192205        align-items: center;
    193206}
    194 .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open .dashicons {
     207
     208.ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open .dashicons{
    195209        display: flex;
    196210        justify-content: center;
    … …  
    204218        width: 32px;
    205219}
     220
    206221#ewd-ufaq-dash-mobile-menu-up-caret,
    207 #ewd-ufaq-dash-mobile-menu-down-caret {
     222#ewd-ufaq-dash-mobile-menu-down-caret{
    208223        display: none;
    209224}
    210225
    211226
     227
    212228@media screen and (max-width: 1600px) {
    213         .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab {
     229.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab{
    214230                font-size: 18px;
    215         }
    216 }
     231        }}
     232
    217233@media screen and (max-width: 1024px) {
    218         .ewd-ufaq-admin-header-menu {
     234.ewd-ufaq-admin-header-menu{
    219235                margin: 40px 32px 0 22px;
    220236        }
    221         .ewd-ufaq-admin-header-menu .nav-tab-wrapper {
     237
     238.ewd-ufaq-admin-header-menu .nav-tab-wrapper{
    222239                border-bottom: none;
    223240        }
    224         .ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open {
     241
     242.ewd-ufaq-admin-header-menu .nav-tab#ewd-ufaq-dash-mobile-menu-open{
    225243                display: flex;
    226244        }
    227         .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab {
     245
     246.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab{
    228247                font-size: 22px;
    229248        }
    230         .ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab:nth-of-type(1) {
     249
     250.ewd-ufaq-admin-header-menu .nav-tab-wrapper .nav-tab:nth-of-type(1){
    231251                width: 100%;
    232252                font-size: 28px;
    233253                margin-bottom: 16px;
    234         }
    235 }
    236 
    237 
    238 /* PAGE GLOBALS */
    239 
    240 .post-type-ufaq .wrap,
    241 .ufaq_page_ewd-ufaq-ordering-table .wrap {
     254        }}
     255
     256.post-type-ufaq .wrap{
    242257        padding: 0 96px;
    243258}
    244 .ufaq_page_ewd-ufaq-settings .wrap {
     259
     260.ufaq_page_ewd-ufaq-settings .wrap{
    245261        padding: 0;
    246262}
    247 .wrap h1 {
     263
     264.wrap h1{
    248265        display: inline-block;
    249266        width: 100%;
    … …  
    253270        color: #212427;
    254271}
     272
    255273@media screen and (max-width: 1024px) {
    256         .post-type-ufaq .wrap,
    257         .ufaq_page_ewd-ufaq-ordering-table .wrap {
     274.post-type-ufaq .wrap{
    258275                padding: 0 32px 0 42px;
    259276        }
    260         .ufaq_page_ewd-ufaq-settings .wrap {
     277
     278.ufaq_page_ewd-ufaq-settings .wrap{
    261279                padding: 0;
    262         }
    263 }       
    264 
    265 
    266 /* DASHBOARD */
    267 
    268 #ewd-ufaq-dashboard-content-area {
     280        }}
     281
     282#ewd-ufaq-dashboard-content-area{
    269283        display: flex;
    270284        flex-direction: column;
    … …  
    274288        box-sizing: border-box;
    275289}
    276 #ewd-ufaq-dashboard-content-area * {
     290
     291#ewd-ufaq-dashboard-content-area *{
    277292        box-sizing: border-box;
    278293}
    279294
    280 .ewd-ufaq-dashboard-visit-our-site {
     295.ewd-ufaq-dashboard-visit-our-site{
    281296        display: block;
    282297        text-align: center;
    … …  
    289304        font-size: 16px;
    290305}
     306
    291307.ewd-ufaq-dashboard-visit-our-site a,
    292 .ewd-ufaq-dashboard-visit-our-site a:hover {
     308.ewd-ufaq-dashboard-visit-our-site a:hover{
    293309        color: #fff;
    294310}
    295311
    296 .ewd-ufaq-dashboard-support-widgets {
     312.ewd-ufaq-dashboard-support-widgets{
    297313        display: grid;
    298314        grid-template-columns: repeat(2, 1fr);
    … …  
    301317        margin: 48px 0 0;
    302318}
    303 .ewd-ufaq-dashboard-support-widgets li {
     319
     320.ewd-ufaq-dashboard-support-widgets li{
    304321        display: flex;
    305322        flex-direction: column;
    … …  
    311328        justify-content: space-between;
    312329}
    313 .ewd-ufaq-dashboard-support-widgets-title {
     330
     331.ewd-ufaq-dashboard-support-widgets-title{
    314332        font-size: 16px;
    315333        font-weight: bold;
    316334        color: #212427;
    317335}
    318 .ewd-ufaq-dashboard-support-widgets-text-and-link {
     336
     337.ewd-ufaq-dashboard-support-widgets-text-and-link{
    319338        display: flex;
    320339        justify-content: space-between;
    321340        align-items: center;
    322341}
    323 .ewd-ufaq-dashboard-support-widgets-text {
     342
     343.ewd-ufaq-dashboard-support-widgets-text{
    324344        font-size: 16px;
    325345        color: #5f5f5f;
    326346}
    327 .ewd-ufaq-dashboard-support-widgets-text span {
     347
     348.ewd-ufaq-dashboard-support-widgets-text span{
    328349        margin-right: 12px;
    329350}
    330 .ewd-ufaq-dashboard-support-widgets-link {
     351
     352.ewd-ufaq-dashboard-support-widgets-link{
    331353        display: flex;
    332354        justify-content: center;
    … …  
    344366        transition: background .25s, color .25s, border-color .25s;
    345367}
    346 .ewd-ufaq-dashboard-support-widgets-link:hover {
     368
     369.ewd-ufaq-dashboard-support-widgets-link:hover{
    347370        background: #915add;
    348371        border-color: #915add;
    … …  
    350373}
    351374
    352 .ewd-ufaq-dashboard-catalogs {
     375.ewd-ufaq-dashboard-catalogs{
    353376        display: flex;
    354377        flex-direction: column;
    … …  
    358381        margin: 40px 0 0;
    359382}
    360 .ewd-ufaq-dashboard-catalogs-title {
     383
     384.ewd-ufaq-dashboard-catalogs-title{
    361385        font-size: 16px;
    362386        font-weight: bold;
    … …  
    365389}
    366390
    367 .ewd-ufaq-license-status summary {
     391.ewd-ufaq-license-status summary{
    368392        cursor: pointer;
    369393}
    370 .ewd-ufaq-license-status form {
     394
     395.ewd-ufaq-license-status form{
    371396        margin-top: 16px;
    372397        display: flex;
    … …  
    375400        gap: 12px;
    376401}
    377 .ewd-ufaq-license-status form:first-of-type {
     402
     403.ewd-ufaq-license-status form:first-of-type{
    378404        margin-bottom: 32px;
    379405}
    380 .ewd-ufaq-license-status input[type="text"] {
     406
     407.ewd-ufaq-license-status input[type="text"]{
    381408        min-height: 30px;
    382409        height: 30px;
    … …  
    384411        margin: 0;
    385412}
    386 .ewd-ufaq-license-status input[name="key"], .ewd-ufaq-license-status button[name="ewd_upgrade_to_full"] {
     413
     414.ewd-ufaq-license-status input[name="key"], .ewd-ufaq-license-status button[name="ewd_upgrade_to_full"]{
    387415        height: 40px;
    388416}
    389417
    390 .ewd-ufaq-dashboard-get-premium-and-trial {
    391         display: flex;
    392         flex-direction: column;
    393 }
    394 .ewd-ufaq-dashboard-get-premium-and-trial.trial-happening {
     418.ewd-ufaq-dashboard-get-premium-and-trial{
     419        display: flex;
     420        flex-direction: column;
     421}
     422
     423.ewd-ufaq-dashboard-get-premium-and-trial.trial-happening{
    395424        flex-direction: row;
    396425        justify-content: space-between;
    397426}
    398427
    399 #ewd-ufaq-dashboard-new-footer-one {
     428#ewd-ufaq-dashboard-new-footer-one{
    400429        display: flex;
    401430        flex-direction: column;
    … …  
    406435        background: #7B31AF;
    407436}
    408 .ewd-ufaq-dashboard-new-footer-one-inside {
     437
     438.ewd-ufaq-dashboard-new-footer-one-inside{
    409439        display: flex;
    410440        justify-content: space-between;
    … …  
    412442        width: 100%;
    413443}
    414 .ewd-ufaq-dashboard-new-footer-one-left {
     444
     445.ewd-ufaq-dashboard-new-footer-one-left{
    415446        display: flex;
    416447        flex-direction: column;
    … …  
    418449        margin-bottom: 32px;
    419450}
    420 .ewd-ufaq-dashboard-new-footer-one-title {
     451
     452.ewd-ufaq-dashboard-new-footer-one-title{
    421453        font-size: 16px;
    422454        font-weight: bold;
    … …  
    424456        line-height: 1.2;
    425457}
    426 .ewd-ufaq-dashboard-new-footer-one-benefits {
     458
     459.ewd-ufaq-dashboard-new-footer-one-benefits{
    427460        width: 100%;
    428461        margin-top: 32px;
    … …  
    433466        margin: 40px 0 0;
    434467}
    435 .ewd-ufaq-dashboard-new-footer-one-benefits li {
     468
     469.ewd-ufaq-dashboard-new-footer-one-benefits li{
    436470        margin: 0;
    437471        padding-left: 36px;
    … …  
    444478        color: #fbfbfb
    445479}
    446 .ewd-ufaq-dashboard-new-footer-one-buttons {
     480
     481.ewd-ufaq-dashboard-new-footer-one-buttons{
    447482        display: flex;
    448483        flex-direction: column;
    449484        width: 192px;
    450485}
    451 .ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button {
     486
     487.ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button{
    452488        background: #fff;
    453489        border: 1px solid #fff;
    … …  
    456492        transition: background .25s, color .25s, border-color .25s;
    457493}
    458 .ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button:hover {
     494
     495.ewd-ufaq-dashboard-new-footer-one-buttons .ewd-ufaq-dashboard-new-upgrade-button:hover{
    459496        background: #ece2f3;
    460497        border-color: #ece2f3;
    461498        color: #212427;
    462499}
    463 .ewd-premium-helper-dashboard-get-premium-widget-button  {
     500
     501.ewd-premium-helper-dashboard-get-premium-widget-button{
    464502        background: transparent !important;
    465503        border: 1px solid #fff !important;
    466504        color: #fff !important;
    467505}
    468 .ewd-premium-helper-dashboard-get-premium-widget-button:hover  {
     506
     507.ewd-premium-helper-dashboard-get-premium-widget-button:hover{
    469508        background: #fff !important;
    470509        border-color: #fff !important;
    471510        color: #212427 !important;
    472511}
    473 .trial-happening #ewd-ufaq-dashboard-new-footer-one {
     512
     513.trial-happening #ewd-ufaq-dashboard-new-footer-one{
    474514        width: calc(70% - 12px);
    475515}
    476 .trial-happening .ewd-ufaq-dashboard-new-footer-one-inside {
    477         flex-direction: column;
    478 }
    479 .trial-happening .ewd-ufaq-dashboard-new-footer-one-left {
     516
     517.trial-happening .ewd-ufaq-dashboard-new-footer-one-inside{
     518        flex-direction: column;
     519}
     520
     521.trial-happening .ewd-ufaq-dashboard-new-footer-one-left{
    480522        width: 100%;
    481523}
    482 .trial-happening .ewd-ufaq-dashboard-new-footer-one-title {
     524
     525.trial-happening .ewd-ufaq-dashboard-new-footer-one-title{
    483526        text-align: center;
    484527}
    485 .trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits {
     528
     529.trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits{
    486530        grid-template-columns: repeat(2, 1fr);
    487531}
    488 .trial-happening .ewd-ufaq-dashboard-new-footer-one-buttons {
     532
     533.trial-happening .ewd-ufaq-dashboard-new-footer-one-buttons{
    489534        width: 100%;
    490535        justify-content: center;
    … …  
    492537}
    493538
    494 .ewd-ufaq-dashboard-trial-container {
     539.ewd-ufaq-dashboard-trial-container{
    495540        display: flex;
    496541        flex-direction: column;
    … …  
    500545        margin: 40px 0 0;
    501546}
    502 .trial-happening .ewd-ufaq-dashboard-trial-container {
     547
     548.trial-happening .ewd-ufaq-dashboard-trial-container{
    503549        width: calc(30% - 12px);
    504550}
    505551
    506 .ewd-ufaq-dashboard-guarantee {
     552.ewd-ufaq-dashboard-guarantee{
    507553        display: flex;
    508554        align-items: center;
    … …  
    512558        color: #5f5f5f;
    513559}
    514 .ewd-ufaq-dashboard-guarantee img {
     560
     561.ewd-ufaq-dashboard-guarantee img{
    515562        width: 128px;
    516563        height: auto;
    517564        margin-right: 32px;
    518565}
    519 .ewd-ufaq-dashboard-guarantee-title-and-text {
    520         display: flex;
    521         flex-direction: column;
    522 }
    523 .ewd-ufaq-dashboard-guarantee-title {
     566
     567.ewd-ufaq-dashboard-guarantee-title-and-text{
     568        display: flex;
     569        flex-direction: column;
     570}
     571
     572.ewd-ufaq-dashboard-guarantee-title{
    524573        font-size: 24px;
    525574        font-weight: bold;
    … …  
    528577        color: #212427
    529578}
    530 .ewd-ufaq-dashboard-guarantee-text {
     579
     580.ewd-ufaq-dashboard-guarantee-text{
    531581        font-size: 14px;
    532582        font-weight: normal;
    533583}
    534  
    535 .ewd-ufaq-dashboard-testimonials-and-other-plugins {
     584
     585.ewd-ufaq-dashboard-testimonials-and-other-plugins{
    536586        display: flex;
    537587        justify-content: space-between;
    538588}
    539589
    540 .ewd-ufaq-dashboard-other-plugins-container {
     590.ewd-ufaq-dashboard-other-plugins-container{
    541591        display: flex;
    542592        flex-direction: column;
    … …  
    548598        background: linear-gradient(91.21deg, rgba(120, 48, 170, 0.5) -9.34%, rgba(255, 255, 255, 0) 34.79%, rgba(251, 250, 252, 0.0105472) 81.09%, rgba(89, 36, 126, 0.5) 133.01%);
    549599}
    550 .ewd-ufaq-dashboard-other-plugins-container-title {
     600
     601.ewd-ufaq-dashboard-other-plugins-container-title{
    551602        font-size: 16px;
    552603        font-weight: bold;
    … …  
    554605        margin-bottom: 8px;
    555606}
    556 .ewd-ufaq-dashboard-other-plugins {
     607
     608.ewd-ufaq-dashboard-other-plugins{
    557609        display: flex;
    558610        flex-direction: column;
    559611        margin: 0;
    560612}
    561 .ewd-ufaq-dashboard-other-plugins li {
     613
     614.ewd-ufaq-dashboard-other-plugins li{
    562615        display: flex;
    563616        margin: 28px 0 0;
    564617}
    565 .ewd-ufaq-dashboard-other-plugins li img {
     618
     619.ewd-ufaq-dashboard-other-plugins li img{
    566620        width: 120px;
    567621        height: 120px;
    568622        margin-right: 20px;
    569623}
    570 .ewd-ufaq-dashboard-other-plugins-text {
    571         display: flex;
    572         flex-direction: column;
    573 }
    574 .ewd-ufaq-dashboard-other-plugins-title {
     624
     625.ewd-ufaq-dashboard-other-plugins-text{
     626        display: flex;
     627        flex-direction: column;
     628}
     629
     630.ewd-ufaq-dashboard-other-plugins-title{
    575631        font-size: 16px;
    576632        font-weight: bold;
    … …  
    578634        color: #212427;
    579635}
    580 .ewd-ufaq-dashboard-other-plugins-blurb {
     636
     637.ewd-ufaq-dashboard-other-plugins-blurb{
    581638        font-size: 14px;
    582639        color: #5f5f5f;
    583640}
    584641
    585 .ewd-ufaq-dashboard-testimonials-container {
     642.ewd-ufaq-dashboard-testimonials-container{
    586643        display: flex;
    587644        flex-direction: column;
    … …  
    593650        background: linear-gradient(91.21deg, rgba(120, 48, 170, 0.5) -9.34%, rgba(255, 255, 255, 0) 34.79%, rgba(251, 250, 252, 0.0105472) 81.09%, rgba(89, 36, 126, 0.5) 133.01%);
    594651}
    595 .ewd-ufaq-dashboard-testimonials-container-title {
     652
     653.ewd-ufaq-dashboard-testimonials-container-title{
    596654        font-size: 16px;
    597655        font-weight: bold;
    … …  
    599657        margin-bottom: 8px;
    600658}
    601 .ewd-ufaq-dashboard-testimonials {
    602         display: flex;
    603         flex-direction: column;
    604 }
    605 .ewd-ufaq-dashboard-testimonials li {
     659
     660.ewd-ufaq-dashboard-testimonials{
     661        display: flex;
     662        flex-direction: column;
     663}
     664
     665.ewd-ufaq-dashboard-testimonials li{
    606666        text-align: center;
    607667}
    608 .ewd-ufaq-dashboard-testimonials li img {
     668
     669.ewd-ufaq-dashboard-testimonials li img{
    609670        width: 140px;
    610671        height: auto;
    611672        margin-top: 8px;
    612673}
    613 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-title {
     674
     675.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-title{
    614676        margin: 28px 0 20px;
    615677        font-size: 30px;
    … …  
    618680        color: #212427;
    619681}
    620 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-author {
     682
     683.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-author{
    621684        font-size: 16px;
    622685        color: #5f5f5f;
    623686}
    624 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text {
     687
     688.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text{
    625689        padding: 24px 10% 0;
    626690        font-size: 14px;
    627691        color: #5f5f5f;
    628692}
    629 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a {
     693
     694.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a{
    630695        color: #0acbaa;
    631696        text-decoration: none;
    632697        font-weight: bold;
    633698}
    634 .ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a:hover {
     699
     700.ewd-ufaq-dashboard-testimonials li .ewd-ufaq-dashboard-testimonial-text a:hover{
    635701        color: #1CE6C3;
    636702}
     703
    637704 
    638705@media screen and (max-width: 1024px) {
    639         #ewd-ufaq-dashboard-content-area {
     706#ewd-ufaq-dashboard-content-area{
    640707                padding: 0 32px 0 22px;
    641708        }
    642         .ewd-ufaq-dashboard-support-widgets {
     709
     710.ewd-ufaq-dashboard-support-widgets{
    643711                grid-template-columns: repeat(1, 1fr);
    644712        }
    645         .ewd-ufaq-dashboard-get-premium-and-trial.trial-happening {
     713
     714.ewd-ufaq-dashboard-get-premium-and-trial.trial-happening{
    646715                flex-direction: column;
    647716                justify-content: initial;
    648717        }
    649         .trial-happening #ewd-ufaq-dashboard-new-footer-one,
    650         .trial-happening .ewd-ufaq-dashboard-trial-container {
     718
     719.trial-happening #ewd-ufaq-dashboard-new-footer-one,
     720        .trial-happening .ewd-ufaq-dashboard-trial-container{
    651721                width: 100%;
    652722        }
    653         .ewd-ufaq-dashboard-new-footer-one-inside {
     723
     724.ewd-ufaq-dashboard-new-footer-one-inside{
    654725                flex-direction: column;
    655726        }
    656         .ewd-ufaq-dashboard-new-footer-one-left {
     727
     728.ewd-ufaq-dashboard-new-footer-one-left{
    657729                width: 100%;
    658730        }
    659         .ewd-ufaq-dashboard-new-footer-one-title {
     731
     732.ewd-ufaq-dashboard-new-footer-one-title{
    660733                text-align: center;
    661734        }
    662         .ewd-ufaq-dashboard-new-footer-one-benefits {
     735
     736.ewd-ufaq-dashboard-new-footer-one-benefits{
    663737                grid-template-columns: repeat(2, 1fr);
    664738        }
    665         .ewd-ufaq-dashboard-new-footer-one-buttons {
     739
     740.ewd-ufaq-dashboard-new-footer-one-buttons{
    666741                width: 100%;
    667742                justify-content: center;
    668743                margin-top: 32px;
    669744        }
    670         .ewd-ufaq-dashboard-testimonials-and-other-plugins {
     745
     746.ewd-ufaq-dashboard-testimonials-and-other-plugins{
    671747                flex-direction: column;
    672748                justify-content: initial;
    673749        }
    674         .ewd-ufaq-dashboard-other-plugins-container,
    675         .ewd-ufaq-dashboard-testimonials-container {
     750
     751.ewd-ufaq-dashboard-other-plugins-container,
     752        .ewd-ufaq-dashboard-testimonials-container{
    676753                width: 100%;
    677         }
    678 }       
     754        }}
     755       
    679756@media screen and (max-width: 568px) {
    680         .ewd-ufaq-dashboard-new-footer-one-benefits,
    681         .trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits {
     757.ewd-ufaq-dashboard-new-footer-one-benefits,
     758        .trial-happening .ewd-ufaq-dashboard-new-footer-one-benefits{
    682759                grid-template-columns: repeat(1, 1fr);
    683         }
    684 }
    685 
    686 
    687 /* FOOTER */
    688 
    689 #ewd-ufaq-dashboard-new-footer-two {
     760        }}
     761
     762#ewd-ufaq-dashboard-new-footer-two{
    690763        display: flex;
    691764        margin: 40px 0 0 -20px;
    … …  
    695768        box-sizing: border-box;
    696769}
    697 #ewd-ufaq-dashboard-new-footer-two * {
     770
     771#ewd-ufaq-dashboard-new-footer-two *{
    698772        box-sizing: border-box;
    699773}
    700 .ewd-ufaq-dashboard-new-footer-two-inside {
     774
     775.ewd-ufaq-dashboard-new-footer-two-inside{
    701776        display: flex;
    702777        flex-wrap: wrap;
    … …  
    704779        padding: 48px 96px;
    705780}
    706 .ewd-ufaq-dashboard-new-footer-two-icon {
     781
     782.ewd-ufaq-dashboard-new-footer-two-icon{
    707783        width: 110px;
    708784        height: 105px;
    709785        margin-right: 40px;
    710786}
    711 .ewd-ufaq-dashboard-new-footer-two-blurb {
     787
     788.ewd-ufaq-dashboard-new-footer-two-blurb{
    712789        width: 300px;
    713790        line-height: 1.7;
    714791        font-size: 12px;
    715792}
    716 .ewd-ufaq-dashboard-new-footer-two-menu {
     793
     794.ewd-ufaq-dashboard-new-footer-two-menu{
    717795        width: 150px;
    718796        margin: 0;
    … …  
    722800        flex-direction: column;
    723801}
    724 .ewd-ufaq-dashboard-new-footer-two-menu:first-of-type {
     802
     803.ewd-ufaq-dashboard-new-footer-two-menu:first-of-type{
    725804        margin-left: auto;
    726805}
    727 .ewd-ufaq-dashboard-new-footer-two-menu li {
     806
     807.ewd-ufaq-dashboard-new-footer-two-menu li{
    728808        font-weight: bold;
    729809        margin-bottom: 4px;
    … …  
    731811        font-size: 14px;
    732812}
    733 .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
     813
     814.ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type{
    734815        margin-bottom: 9px;
    735816}
    736 .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
     817
     818.ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type{
    737819        margin-bottom: 0;
    738820}
    739 .ewd-ufaq-dashboard-new-footer-two-menu li a {
     821
     822.ewd-ufaq-dashboard-new-footer-two-menu li a{
    740823        font-weight: normal;
    741824        color: #D3DFF5;
    … …  
    743826        font-size: 14px;
    744827}
    745 .ewd-ufaq-dashboard-new-footer-two-menu li a:hover {
     828
     829.ewd-ufaq-dashboard-new-footer-two-menu li a:hover{
    746830        color: #fff;
    747831}
    748832
     833
    749834@media screen and (max-width: 1024px) {
    750         .ewd-ufaq-dashboard-new-footer-two-inside {
     835.ewd-ufaq-dashboard-new-footer-two-inside{
    751836                flex-direction: column;
    752837                flex-wrap: nowrap;
    753838                align-items: center;
    754         }       
    755         .ewd-ufaq-dashboard-new-footer-two-icon {
     839        }
     840
     841.ewd-ufaq-dashboard-new-footer-two-icon{
    756842                margin-right: 0;
    757843        }
    758         .ewd-ufaq-dashboard-new-footer-two-blurb {
     844
     845.ewd-ufaq-dashboard-new-footer-two-blurb{
    759846                display: none;
    760847        }
    761         .ewd-ufaq-dashboard-new-footer-two-menu,
    762         .ewd-ufaq-dashboard-new-footer-two-menu:first-of-type {
     848
     849.ewd-ufaq-dashboard-new-footer-two-menu,
     850        .ewd-ufaq-dashboard-new-footer-two-menu:first-of-type{
    763851                margin: 32px 0 0;
    764852        }
    765         .ewd-ufaq-dashboard-new-footer-two-menu li {
     853
     854.ewd-ufaq-dashboard-new-footer-two-menu li{
    766855                text-align: center;
    767856                margin-bottom: 4px;
    768857                font-size: 14px;
    769858        }
    770         .ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type {
     859
     860.ewd-ufaq-dashboard-new-footer-two-menu li:first-of-type{
    771861                margin-bottom: 9px;
    772862        }
    773         .ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type {
     863
     864.ewd-ufaq-dashboard-new-footer-two-menu li:last-of-type{
    774865                margin-bottom: 0;
    775866        }
    776         .ewd-ufaq-dashboard-new-footer-two-menu li a {
     867
     868.ewd-ufaq-dashboard-new-footer-two-menu li a{
    777869                font-size: 14px;
    778         }
    779 }
    780 
    781 
    782 /* SETTINGS PREVIEW */
    783 
    784 .ewd-ufaq-settings-preview {
     870        }}
     871
     872.ewd-ufaq-settings-preview{
    785873        display: flex;
    786874        flex-direction: column;
    … …  
    788876        padding: 24px 96px 0 96px;
    789877}
    790 .ewd-ufaq-settings-preview h2 {
     878
     879.ewd-ufaq-settings-preview h2{
    791880        display: block !important;
    792881        font-size: 28px !important;
    793882        padding: 0 !important;
    794883}
    795 .ewd-ufaq-settings-preview h2 span {
     884
     885.ewd-ufaq-settings-preview h2 span{
    796886        position: absolute;
    797887        margin-left: 16px;
    … …  
    802892        padding: 2px 8px;
    803893        text-transform: uppercase;
    804 } 
    805 .ewd-ufaq-settings-preview p {
     894}
     895
     896.ewd-ufaq-settings-preview p{
    806897        margin: 40px 0 16px;
    807898        font-size: 16px;
    808899        color: #5f5f5f;
    809 } 
    810 .ewd-ufaq-settings-preview-images {
     900}
     901
     902.ewd-ufaq-settings-preview-images{
    811903        display: flex;
    812904        justify-content: space-between;
    813905        width: 100%;
    814906}
    815 .ewd-ufaq-settings-preview-images img {
     907
     908.ewd-ufaq-settings-preview-images img{
    816909        width: calc(50% - 12px);
    817910        border: 1px solid #ddd;
    … …  
    820913}
    821914
    822 .ewd-ufaq-settings-preview-other-features {
     915.ewd-ufaq-settings-preview-other-features{
    823916        display: flex;
    824917        flex-direction: column;
    … …  
    826919}
    827920
     921
    828922@media screen and (max-width: 1024px) {
    829         .ewd-ufaq-settings-preview {
     923.ewd-ufaq-settings-preview{
    830924                padding: 24px 32px 0 42px;
    831         }
    832 }
     925        }}
     926
    833927@media screen and (max-width: 768px) {
    834         .ewd-ufaq-settings-preview-images {
     928.ewd-ufaq-settings-preview-images{
    835929                flex-direction: column;
    836930                justify-content: initial;
    837931        }
    838         .ewd-ufaq-settings-preview-images img {
     932
     933.ewd-ufaq-settings-preview-images img{
    839934                width: 100%;
    840         }
    841 }
    842 
    843 
    844 /********************************
    845 SEARCH TERMS TABLE IN SETTINGS
    846 ********************************/
    847 
    848 .ewd-ufaq-search-terms-box,
    849 .ewd-ufaq-search-terms-box * {
    850         box-sizing: border-box;
    851 }
    852 .ewd-ufaq-search-terms-box {
    853         position: relative;
    854         display: flex;
    855         flex-direction: column;
    856         width: 100%;
    857         max-width: 400px;
    858         border: 1px solid #ccc;
    859         border-radius: 14px;
    860         margin: 21px 0 0;
    861 }
    862 .ewd-ufaq-search-term-each {
    863         display: flex;
    864         flex-basis: 100%;
    865         border-bottom: 1px solid #ccc;
    866 }
    867 .ewd-ufaq-search-term-each:last-of-type {
    868         border-bottom: none;
    869 }
    870 .ewd-ufaq-search-term-each-label,
    871 .ewd-ufaq-search-term-each-value {
    872         padding: 10px 16px;
    873 }
    874 .ewd-ufaq-search-term-each-label {
    875         border-right: 1px solid #ccc;
    876         font-weight: bold;
    877         flex-basis: 80%;
    878 }
    879 .ewd-ufaq-search-term-each-value {
    880         flex-basis: 20%;
    881         text-align: center;
    882 }
    883 .ewd-ufaq-settings-reset-search-terms {
     935        }}
     936
     937.ewd-ufaq-settings-reset-search-terms{
    884938        position: relative;
    885939        float: left;
    … …  
    896950        transition: background .35s;
    897951}
    898 .ewd-ufaq-settings-reset-search-terms:hover {
     952
     953.ewd-ufaq-settings-reset-search-terms:hover{
    899954        background: #894ae1;
    900955}
    901956
    902 
    903 /************
    904 EXTRA
    905 ************/
    906 
    907 #ewd-ufaq-custom-fields-table select {
    908         width: 100% !important;
    909 }
    910 #ewd-ufaq-custom-fields-table th {
    911         padding: 20px 10px 20px 10px !important;
    912 }
    913 
    914 .ewd-ufaq-import-export-container {
    915         position: relative;
    916         float: left;
    917         margin-left: 32px;
    918         width: calc(100% - 32px);
    919 }
    920 
    921 input[name="ewd_ufaq_export_pdf"] {
     957input[name="ewd_ufaq_export_pdf"]{
    922958        margin-top: 8px !important;
    923959}
    924960
    925 .ewd-ufaq-meta-field label {
     961.ewd-ufaq-meta-field label{
    926962        display: inline-block;
    927963        width: 150px;
    928964        margin: 12px 0;
    929965}
     966
    930967       
    931968
    … …  
    947984}
    948985
    949 .ewd-ufaq-toggle-symbol {
     986.ewd-ufaq-toggle-symbol{
    950987        font-family: 'ewd-toggle-icon';
    951988        letter-spacing: 6px;
    … …  
    953990}
    954991
    955 input[name=toggle_symbol] {
     992input[name=toggle_symbol]{
    956993        margin-right: 10px;
    957994}
    958995
    959 
    960 /****************
    961 ORDER TABLE
    962 ****************/
    963 #ewd-ufaq-ordering-table-container {
    964         width: 100%;
    965 }
    966 #ewd-ufaq-ordering-table-explanation {
    967         font-size: 16px;
    968         color: #212427;
    969         margin-bottom: 28px;
    970 }
    971 .ewd-ufaq-ordering-table thead tr,
    972 .ewd-ufaq-ordering-table tfoot tr {
    973         background: #F8F4FF;
    974 }
    975 .ewd-ufaq-ordering-table th {
    976         padding: 12px 10px;
    977 }
    978 .ewd-ufaq-ordering-table td {
    979         padding: 8px 10px;
    980 }
    981 .ewd-ufaq-ordering-table tbody tr:nth-of-type(2n+2) {
    982         background: #F8F4FF;
    983 }
    984 
    985 
    986 /*
    987 ==============================================
    988 About Us page
    989 ==============================================
    990 */
    991 
    992 .ufaq_page_ewd-ufaq-about-us #wpcontent {
     996.ufaq_page_ewd-ufaq-about-us #wpcontent{
    993997background: #fff;
    994998}
    995999
    996 .ewd-ufaq-about-us-logo {
     1000.ewd-ufaq-about-us-logo{
    9971001display: flex;
    9981002width: 100%;
    9991003padding: 24px 0 0 32px;
    10001004}
    1001 .ewd-ufaq-about-us-logo img {
     1005
     1006.ewd-ufaq-about-us-logo img{
    10021007width: 300px;
    10031008height: auto;
    … …  
    10071012#ewd-ufaq-about-us-tabs-menu *,
    10081013.ewd-ufaq-about-us-tab,
    1009 .ewd-ufaq-about-us-tab * {
     1014.ewd-ufaq-about-us-tab *{
    10101015box-sizing: border-box;
    10111016}
    10121017
    1013 .ewd-ufaq-about-us-tabs {
     1018.ewd-ufaq-about-us-tabs{
    10141019display: flex;
    10151020flex-direction: column;
    … …  
    10211026}
    10221027
    1023 #ewd-ufaq-about-us-tabs-menu {
     1028#ewd-ufaq-about-us-tabs-menu{
    10241029display: flex;
    10251030justify-content: space-between;
    … …  
    10291034margin: 0;
    10301035}
    1031 .ewd-ufaq-about-us-tab-menu-item {
     1036
     1037.ewd-ufaq-about-us-tab-menu-item{
    10321038width: 25%;
    10331039background: #f3f3f3;
    … …  
    10421048transition: background .35s;
    10431049}
    1044 .ewd-ufaq-about-us-tab-menu-item:hover {
     1050
     1051.ewd-ufaq-about-us-tab-menu-item:hover{
    10451052background: #fff;
    10461053color: #000;
    10471054}
    1048 .ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected {
     1055
     1056.ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected{
    10491057background: #fff;
    10501058color: #000;
    10511059border-bottom: none;
    10521060}
    1053 .ewd-ufaq-about-us-tab-menu-item:first-of-type {
     1061
     1062.ewd-ufaq-about-us-tab-menu-item:first-of-type{
    10541063border-left: none;
    10551064}
    10561065
    1057 .ewd-ufaq-about-us-tab {
     1066.ewd-ufaq-about-us-tab{
    10581067display: flex;
    10591068flex-direction: column;
    … …  
    10621071width: 100%;
    10631072}
    1064 .ewd-ufaq-about-us-tab p {
     1073
     1074.ewd-ufaq-about-us-tab p{
    10651075color: #555;
    10661076}
     1077
    10671078.ewd-ufaq-about-us-feature-suggestion input,
    1068 .ewd-ufaq-about-us-feature-suggestion textarea {
     1079.ewd-ufaq-about-us-feature-suggestion textarea{
    10691080width: 100%;
    10701081max-width: 400px;
    … …  
    10771088        font-weight: normal;
    10781089}
    1079 .ewd-ufaq-about-us-feature-suggestion textarea {
     1090
     1091.ewd-ufaq-about-us-feature-suggestion textarea{
    10801092min-height: 160px;
    10811093}
    10821094
    1083 .ewd-ufaq-about-us-tab-button {
     1095.ewd-ufaq-about-us-tab-button{
    10841096display: flex;
    10851097margin-top: 12px;
    … …  
    10921104        transition: background .35s;
    10931105}
    1094 .ewd-ufaq-about-us-tab-button-purchase {
     1106
     1107.ewd-ufaq-about-us-tab-button-purchase{
    10951108        background: #6026B4;
    10961109        color:  #fff;
    10971110margin-top: 24px;
    10981111}
    1099 .ewd-ufaq-about-us-tab-button-purchase:hover {
     1112
     1113.ewd-ufaq-about-us-tab-button-purchase:hover{
    11001114        background: #7a40cb;
    11011115        color:  #fff;
    11021116}
    1103 .ewd-ufaq-about-us-tab-button-walkthrough {
     1117
     1118.ewd-ufaq-about-us-tab-button-walkthrough{
    11041119        background: #6026B4;
    11051120        color:  #fff;
    11061121margin-bottom: 24px;
    11071122}
    1108 .ewd-ufaq-about-us-tab-button-walkthrough:hover {
     1123
     1124.ewd-ufaq-about-us-tab-button-walkthrough:hover{
    11091125        background: #7a40cb;
    11101126        color:  #fff;
    11111127}
    1112 .ewd-ufaq-about-us-tab-button-youtube {
     1128
     1129.ewd-ufaq-about-us-tab-button-youtube{
    11131130        background: #f00;
    11141131        color:  #fff;
    11151132}
    1116 .ewd-ufaq-about-us-tab-button-youtube:hover {
     1133
     1134.ewd-ufaq-about-us-tab-button-youtube:hover{
    11171135        background: #fe4c4c;
    11181136        color:  #fff;
    11191137}
    1120 .ewd-ufaq-about-us-send-feature-suggestion {
     1138
     1139.ewd-ufaq-about-us-send-feature-suggestion{
    11211140        background: #6026B4;
    11221141        color:  #fff;
    11231142}
    1124 .ewd-ufaq-about-us-send-feature-suggestion:hover {
     1143
     1144.ewd-ufaq-about-us-send-feature-suggestion:hover{
    11251145        background: #7a40cb;
    11261146        color:  #fff;
    11271147}
    11281148
    1129 .ewd-ufaq-about-us-premium-table {
     1149.ewd-ufaq-about-us-premium-table{
    11301150display: flex;
    11311151flex-direction: column;
    … …  
    11371157overflow: hidden;
    11381158}
     1159
    11391160.ewd-ufaq-about-us-premium-table-head,
    1140 .ewd-ufaq-about-us-premium-table-body {
     1161.ewd-ufaq-about-us-premium-table-body{
    11411162display: flex;
    11421163justify-content: space-between;
    11431164}
    1144 .ewd-ufaq-about-us-premium-table-cell {
     1165
     1166.ewd-ufaq-about-us-premium-table-cell{
    11451167display: flex;
    11461168align-items: center;
    … …  
    11501172padding: 8px 16px;
    11511173}
    1152 .ewd-ufaq-about-us-premium-table-cell:first-of-type {
     1174
     1175.ewd-ufaq-about-us-premium-table-cell:first-of-type{
    11531176border-left: none;
    11541177}
    1155 .ewd-ufaq-about-us-premium-table-cell:last-of-type {
     1178
     1179.ewd-ufaq-about-us-premium-table-cell:last-of-type{
    11561180background: #f8f1ff;
    11571181}
    11581182
    1159 .ewd-ufaq-about-us-premium-table-head .ewd-ufaq-about-us-premium-table-cell {
     1183.ewd-ufaq-about-us-premium-table-head .ewd-ufaq-about-us-premium-table-cell{
    11601184font-weight: bold;
    11611185border-top: none;
    11621186}
    1163 .ewd-ufaq-about-us-premium-table-cell img {
     1187
     1188.ewd-ufaq-about-us-premium-table-cell img{
    11641189width: 16px;
    11651190height: auto;
    11661191}
    11671192
     1193
    11681194@media screen and (max-width: 668px) {
    1169 #ewd-ufaq-about-us-tabs-menu {
     1195#ewd-ufaq-about-us-tabs-menu{
    11701196        flex-wrap: wrap;
    11711197}
    1172         .ewd-ufaq-about-us-tab-menu-item {
     1198
     1199.ewd-ufaq-about-us-tab-menu-item{
    11731200        width: 100%;
    11741201        border-left: none;
    11751202}
    1176 .ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected {
     1203
     1204.ewd-ufaq-about-us-tab-menu-item.ewd-ufaq-tab-selected{
    11771205        background: #fff;
    11781206        color: #000;
    11791207        border-bottom: 1px solid #ddd;
    1180 }
    1181 }
    1182 
    1183 
    1184 /* OVERWRITING EWDPH STYLING */
    1185 
    1186 .ewd-premium-helper-dashboard-new-widget-box {
     1208}}
     1209
     1210.ewd-premium-helper-dashboard-new-widget-box{
    11871211        float: none !important;
    11881212        background: transparent !important;
    … …  
    11901214        margin: 48px 0 -8px !important;
    11911215}
    1192 .ewd-premium-helper-dashboard-new-widget-box-top {
     1216
     1217.ewd-premium-helper-dashboard-new-widget-box-top{
    11931218        font-weight: normal !important;
    11941219        color: #5f5f5f !important;
    … …  
    12011226        padding: 32px !important;
    12021227}
    1203 .ewd-premium-helper-dashboard-key-widget {
     1228
     1229.ewd-premium-helper-dashboard-key-widget{
    12041230        display: flex;
    12051231        flex-wrap: wrap;
    … …  
    12141240        background-repeat: no-repeat;
    12151241}
    1216 .ewd-premium-helper-dashboard-key-widget-input {
     1242
     1243.ewd-premium-helper-dashboard-key-widget-input{
    12171244        float: none !important;
    12181245        display: flex;
    … …  
    12281255        color: #737373 !important
    12291256}
    1230 .ewd-premium-helper-dashboard-key-widget-input::placeholder {
     1257
     1258.ewd-premium-helper-dashboard-key-widget-input::placeholder{
    12311259        color: #bbb;
    12321260}
    1233 .ewd-premium-helper-dashboard-key-widget-submit {
     1261
     1262.ewd-premium-helper-dashboard-key-widget-submit{
    12341263        float: none !important;
    12351264        display: flex;
    … …  
    12501279        text-transform: uppercase;
    12511280}
    1252 .ewd-premium-helper-dashboard-key-widget-submit:hover {
     1281
     1282.ewd-premium-helper-dashboard-key-widget-submit:hover{
    12531283        background: #F2BD49;
    12541284}
    1255 .ewd-premium-helper-dashboard-key-widget-text {
     1285
     1286.ewd-premium-helper-dashboard-key-widget-text{
    12561287        float: none !important;
    12571288        width: 100%;
    … …  
    12621293        font-weight: normal;
    12631294}
    1264 .ewd-premium-helper-dashboard-key-widget-text a {
     1295
     1296.ewd-premium-helper-dashboard-key-widget-text a{
    12651297        color: #0acbaa;
    12661298        text-decoration: none;
    12671299        font-weight: bold;
    12681300}
    1269 .ewd-premium-helper-dashboard-key-widget-text a:hover {
     1301
     1302.ewd-premium-helper-dashboard-key-widget-text a:hover{
    12701303        color: #1CE6C3;
    12711304        text-decoration: none;
    12721305}
    12731306
    1274 .ewd-ufaq-dashboard-trial-container .ewd-premium-helper-dashboard-new-widget-box-bottom {
     1307.ewd-ufaq-dashboard-trial-container .ewd-premium-helper-dashboard-new-widget-box-bottom{
    12751308        float: none !important;
    12761309        width: 100% !important;
    … …  
    12801313}
    12811314
     1315
    12821316@media screen and (max-width: 768px) {
    1283         .ewd-premium-helper-dashboard-key-widget {
     1317.ewd-premium-helper-dashboard-key-widget{
    12841318                padding: 0 !important;
    12851319                background-image: none !important;
    12861320        }
    1287                 .ewd-premium-helper-dashboard-key-widget-input {
     1321
     1322.ewd-premium-helper-dashboard-key-widget-input{
    12881323                width: 100% !important;
    12891324                border-radius: 8px !important;
    … …  
    12911326                border-bottom-right-radius: 0 !important;
    12921327        }
    1293         .ewd-premium-helper-dashboard-key-widget-submit {
     1328
     1329.ewd-premium-helper-dashboard-key-widget-submit{
    12941330                width: 100% !important;
    12951331                border-radius: 8px !important;
    12961332                border-top-left-radius: 0 !important;
    12971333                border-top-right-radius: 0 !important;
    1298         }
    1299 }
    1300 
    1301 
    1302 .ewd-ufaq-hidden {
     1334        }}
     1335
     1336.ewd-ufaq-hidden{
    13031337        display: none !important;
    13041338}
     1339
     1340
     1341/****************************************/
     1342/** FAQ ORDERING SCREEN FILTERING AREA **/
     1343/****************************************/
     1344
     1345.ewd-ufaq-order-toolbar legend {
     1346        margin: 16px 0;
     1347        padding-left: 0;
     1348        font-size: 20px;
     1349}
     1350.ewd-ufaq-order-rows td span {
     1351        display: block;
     1352}
  • ultimate-faqs/trunk/assets/css/ewd-ufaq.css

    r3399160 r3821169  
    1 .ewd-ufaq-hidden {
     1
     2.ewd-ufaq-hidden{
    23  display:none;
    34}
    45
    5 .ewd-ufaq-faq-category-title-toggle {
    6   cursor: pointer;
    7 }
    8 
    9 .ewd-ufaq-faq-category-body-hidden {
     6.ewd-ufaq-faq-category-title-toggle{
     7  cursor: pointer;
     8}
     9
     10.ewd-ufaq-faq-category-body-hidden{
    1011  display: none;
    1112}
    1213
    13 .ewd-ufaq-clear {
     14.ewd-ufaq-clear{
    1415  clear:both;
    1516}
    1617
    17 .ewd-ufaq-permalink {
     18.ewd-ufaq-permalink{
    1819  margin: 24px 0;
    1920}
    20 .ewd-ufaq-permalink-image {
     21
     22.ewd-ufaq-permalink-image{
    2123        background: url("../img/insert_link.png");
    2224        height: 21px;
    … …  
    2628}
    2729
    28 
    29 .ewd-ufaq-author {
     30.ewd-ufaq-author{
    3031  font-weight: 600;
    3132}
    32 .ewd-ufaq-date {
     33
     34.ewd-ufaq-date{
    3335  font-weight: 600;
    3436}
    3537
    36 .ewd-ufaq-faq-category-title {
     38.ewd-ufaq-faq-category-title{
    3739  width: 100%;
    3840  clear: both;
    … …  
    4648}
    4749
    48 .ewd-ufaq-faq-category-inner {
     50.ewd-ufaq-faq-category-inner{
    4951  margin-bottom: 48px;
    5052}
    5153
    52 .ewd-ufaq-faq-body {
     54.ewd-ufaq-faq-body{
    5355  padding:10px 25px;
    5456  padding-left: 55px;
    5557}
     58
    5659.ewd-ufaq-faq-search{
    5760  margin:5px 0 !important;
    5861}
    59 .ewd-ufaq-highlight-search-term {
    60   background: #f7ff00;
    61 }
    62 .ewd-ufaq-no-results-found {
     62
     63.ewd-ufaq-no-results-found{
    6364  margin-top: 16px;
    6465}
    … …  
    6768width: auto !important;
    6869}
    69 .ewd-ufaq-text-input {
     70
     71.ewd-ufaq-text-input{
    7072  border-radius: 0 !important;
    7173  margin:15px !important;
    7274}
    73 .ewd-ufaq-submit{
    74 border-radius: 0 !important;
    75 }
    76 .ewd-ufaq-faq-header{
    77   margin:10px;
    78 }
    79 .ewd-ufaq-faq-header a:hover{
    80   text-decoration: none;
    81 }
     75
    8276div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin{
    8377  text-decoration: none;
    8478}
     79
    8580div.ewd-ufaq-faq-title div.ewd-ufaq-post-margin-symbol{
    8681  text-decoration: none;
    … …  
    9792  border-width: 0;
    9893}
     94
    9995.ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span{
    10096display: inline-block;
    … …  
    10298margin: 0 auto;
    10399}
    104 .ewd-ufaq-faq-title-text {
     100
     101.ewd-ufaq-faq-title-text{
    105102  float: left;
    106103  width: 85%;
    107104}
     105
    108106.ewd-ufaq-faq-title h1,
    109107.ewd-ufaq-faq-title h2,
    … …  
    111109.ewd-ufaq-faq-title h4,
    112110.ewd-ufaq-faq-title h5,
    113 .ewd-ufaq-faq-title h6 {
     111.ewd-ufaq-faq-title h6{
    114112  display:inline-block;
    115113  margin:5px !important;
    116114}
    117115
    118 
    119 
    120 
    121 .ewd-ufaq-custom-field-label, .ewd-ufaq-custom-field-value {
    122   position: relative;
    123   float: left;
    124   margin-top: 14px;
    125 }
    126 .ewd-ufaq-custom-field-label {
    127   font-weight: normal;
    128 }
    129 
    130 .ewd-ufaq-faq-body .comment-respond {
     116.ewd-ufaq-faq-body .comment-respond{
    131117  margin-top: 24px;
    132118}
    133 .ewd-ufaq-faq-body li.comment {
     119
     120.ewd-ufaq-faq-body li.comment{
    134121  list-style-type: none;
    135122}
    136 .ewd-ufaq-faq-body textarea {
     123
     124.ewd-ufaq-faq-body textarea{
    137125  clear: both;
    138126  display: block;
    … …  
    141129  height: 100px;
    142130}
    143 .ewd-ufaq-faq-body .comment-form-comment label {
     131
     132.ewd-ufaq-faq-body .comment-form-comment label{
    144133  clear: both;
    145134  display: block;
    … …  
    147136  width: 100%;
    148137}
    149 .ewd-ufaq-faq-body .submit {
     138
     139.ewd-ufaq-faq-body .submit{
    150140  width: auto;
    151141  background: transparent;
    … …  
    154144  margin-bottom: 20px;
    155145}
    156 .ewd-ufaq-faq-body .submit:hover {
     146
     147.ewd-ufaq-faq-body .submit:hover{
    157148  background: #111;
    158149  color: #fff;
    159150}
    160 .ewd-ufaq-faq-body .comment-author img {
     151
     152.ewd-ufaq-faq-body .comment-author img{
    161153  margin-right: 8px;
    162154}
    163 .ewd-ufaq-faq-body .comment-body p {
     155
     156.ewd-ufaq-faq-body .comment-body p{
    164157  margin: 10px 0;
    165158  margin-top: 10px !important;
    166159}
    167 .ewd-ufaq-faq-body .reply {
     160
     161.ewd-ufaq-faq-body .reply{
    168162  text-transform: uppercase;
    169163}
    170164
    171 .ewd-ufaq-faq-body .ewd-ufaq-back-to-top-link {
    172   cursor: pointer;
    173 }
    174 
    175 .ewd-ufaq-ratings {
    176   padding: 14px 0 0;
    177   display: inline-block;
    178   width: 100%;
    179   margin-bottom: 20px;
    180 }
    181 .ewd-ufaq-down-vote {
    182   background-position: 0px 8px !important;
    183   height: 50px !important;
    184 }
    185 
    186 
    187 /***********************
    188 * Pagination
    189 ***********************/
    190 .ewd-ufaq-bottom {
    191   clear: both;
    192 }
    193 .ewd-ufaq-previous-faqs h4 {
    194   float: left;
    195   padding-left: 12px;
    196   cursor: pointer;
    197   font-weight: 600;
    198 }
    199 .ewd-ufaq-next-faqs h4 {
    200   float: right;
    201   padding-right: 12px;
    202   cursor: pointer;
    203   font-weight: 600;
    204 }
    205 .ewd-ufaq-load-more h4 {
    206   text-align: center;
    207   cursor: pointer;
    208   font-weight: 600;
    209 }
    210 
    211 
    212 /***********************
    213 * Columns
    214 ***********************/
    215 .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two {
    216   width: 48%;
    217   margin-right: 2%;
    218   float: left;
    219   clear: none;
    220 }
    221 .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three {
    222   width: 31%;
    223   margin-right: 2%;
    224   float: left;
    225   clear: none;
    226 }
    227 .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four {
    228   width: 23%;
    229   margin-right: 2%;
    230   float: left;
    231   clear: none;
    232 }
    233 
    234 @media only screen and (max-width: 960px) {
    235   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
    236   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
    237     width: 48%;
    238     margin-right: 2%;
    239   }
    240 }
    241 @media only screen and (max-width: 520px) {
    242   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-two.ewd-ufaq-faq-responsive-columns-1,
    243   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-three.ewd-ufaq-faq-responsive-columns-1,
    244   .ewd-ufaq-faq-div.ewd-ufaq-faq-column-count-four.ewd-ufaq-faq-responsive-columns-1 {
    245     width: 100%;
    246     margin-right: none;
    247   }
    248 }
    249 
    250 /***********************
    251 Color Block Style
    252 ***********************/
    253 .ewd-ufaq-faq-display-style-color_block .ewd-ufaq-post-margin-symbol {
    254   background-color: #1188cc;
    255   color: #ffffff;
    256 }
    257 
    258 .ewd-ufaq-Circle {
    259   border-radius: 18px;
    260 }
    261 
    262 .ewd-ufaq-Square {
    263   border-radius: 0px;
    264 }
    265 
    266 
    267 /***********************
    268 Block Style
    269 ***********************/
    270 .ewd-ufaq-faq-div {
     165.ewd-ufaq-faq-body .ewd-ufaq-back-to-top-link{
     166  cursor: pointer;
     167}
     168
     169.ewd-ufaq-faq-div{
    271170  margin: 2px 0;
    272171  padding:2px 0;
    273172  clear: both;
    274173}
     174
    275175.ewd-ufaq-faq-toggle:hover, .ewd-ufaq-faq-toggle a:hover{
    276176  cursor: pointer;
    … …  
    278178  text-decoration: none;
    279179}
    280 .ewd-ufaq-faq-display-style-block a, .ewd-ufaq-faq-display-style-block a:visited, .ewd-ufaq-faq-display-style-block a:active{
    281   text-decoration: none;
    282 }
    283 .ewd-ufaq-faq-display-style-block:hover,
    284 .ewd-ufaq-faq-display-style-block:hover a,
    285 .ewd-ufaq-faq-display-style-block:hover h1,
    286 .ewd-ufaq-faq-display-style-block:hover h2,
    287 .ewd-ufaq-faq-display-style-block:hover h3,
    288 .ewd-ufaq-faq-display-style-block:hover h4,
    289 .ewd-ufaq-faq-display-style-block:hover h5,
    290 .ewd-ufaq-faq-display-style-block:hover h6 {
    291   text-decoration: none !important;
    292   color:#fff;
    293   background: #1188cc;
    294 }
    295 .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active a{
    296   color:#fff;
    297   background: #1188cc;
    298 }
    299 
    300 
    301 /***********************
    302 List Style
    303 ***********************/
    304 .ewd-ufaq-faq-header-title a {
    305   display: inline-block;
    306 }
    307 
    308 
    309 /***********************
    310 Border Block Style
    311 ***********************/
    312 .ewd-ufaq-faq-div {
     180
     181.ewd-ufaq-faq-div{
    313182  margin: 2px 0;
    314183  padding:2px 0;
    315184  clear: both;
    316185}
     186
    317187.ewd-ufaq-faq-toggle:hover, .ewd-ufaq-faq-toggle a:hover{
    318188  cursor: pointer;
    … …  
    320190  text-decoration: none;
    321191}
    322 .ewd-ufaq-faq-display-style-border_block a, .ewd-ufaq-faq-display-style-border_block a:visited, .ewd-ufaq-faq-display-style-border_block a:active{
    323   text-decoration: none;
    324 }
    325 .ewd-ufaq-faq-display-style-border_block:hover,
    326 .ewd-ufaq-faq-display-style-border_block:hover a,
    327 .ewd-ufaq-faq-display-style-border_block:hover h1,
    328 .ewd-ufaq-faq-display-style-border_block:hover h2,
    329 .ewd-ufaq-faq-display-style-border_block:hover h3,
    330 .ewd-ufaq-faq-display-style-border_block:hover h4,
    331 .ewd-ufaq-faq-display-style-border_block:hover h5,
    332 .ewd-ufaq-faq-display-style-border_block:hover h6 {
    333   text-decoration: none !important;
    334   color:#fff;
    335   background: #1188cc;
    336 }
    337 .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active a{
    338   color:#fff !important;
    339   background: #1188cc;
    340 }
    341 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body {
    342   color:#555 !important;
    343   background: #fff;
    344   border: 3px solid #1188cc;
    345   border-bottom: 2px solid #1188cc;
    346 }
    347 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body a {
    348   color:#000 !important;
    349   background: transparent;
    350 }
    351 
    352 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links {
    353 margin-top: 4px;
    354 }
    355 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-social-links ul {
    356 float: left;
    357 margin-bottom: 14px;
    358 position: relative;
    359 width: auto;
    360 }
    361 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink {
    362 margin: 24px 0;
    363 }
    364 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-permalink-image {
    365 margin-top: -32px;
    366 margin-left: 112px;
    367 }
    368 
    369 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-author-date {
    370   margin-bottom: 14px;
    371 }
    372 
    373 .ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-categories {
    374   margin: 14px 0;
    375 }
    376 
    377 .ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active .ewd-ufaq-faq-title-text {
    378   color: #fff !important;
    379 }
    380 
    381 .ewd-ufaq-faq-display-style-border_block .comment-reply-title {
    382   background: transparent !important;
    383   color: #000 !important;
    384 }
    385 .ewd-ufaq-faq-display-style-border_block:hover .comment-reply-title {
    386   color: #000 !important;
    387 }
    388 
    389 
    390 
    391 /***********************
    392 Contemporary Style
    393 ***********************/
    394 .ewd-ufaq-faq-display-style-contemporary {
    395 border-bottom: 1px solid #ccc;
    396 padding: 0;
    397 margin: 0;
    398 }
    399 .ewd-ufaq-faq-display-style-contemporary:first-of-type {
    400 border-top: 1px solid #ccc;
    401 }
    402 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-title {
    403 background: #f7f7f7;
    404 padding: 8px 0 8px 4px;
    405 }
    406 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-post-margin-symbol {
    407 float: right;
    408 height: auto;
    409 }
    410 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-body {
    411 padding: 20px 25px 10px;
    412 padding-left: 40px;
    413 }
    414 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-faq-tags, .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links {
    415 margin-top: 4px;
    416 }
    417 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-social-links ul {
    418 float: left;
    419 margin-bottom: 14px;
    420 position: relative;
    421 width: auto;
    422 }
    423 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-permalink {
    424 margin-left: 0;
    425 margin-bottom: 10px;
    426 }
    427 .ewd-ufaq-faq-display-style-contemporary .ewd-ufaq-back-to-top {
    428   margin-bottom: 14px;
    429 }
    430 
    431 .ewd-ufaq-social-links-label {
    432   float: left;
    433   margin-right: 8px;
    434   position: relative;
    435   top: 3px;
    436 }
    437 
    438 
    439 
    440 
    441 /***********************
    442 Ratings
    443 ***********************/
    444 .ewd-ufaq-rating-button {
    445   position: relative;
    446   float: left;
    447   width: 60px;
    448   height: 48px;
    449   margin-right: 12px;
    450   line-height: 48px;
    451   font-weight: 600;
    452   cursor: pointer;
    453 
    454 }
    455 .ewd-ufaq-rating-button img {
    456   position: absolute;
    457   top: 0;
    458   left: 0;
    459   width: 75%;
    460   height: auto;
    461 }
    462 .ewd-ufaq-rating-button span {
    463   text-align: right;
    464   width: 100%;
    465   display: block;
    466 }
    467 .ewd-ufaq-up-vote {
    468   background: transparent;
    469   background-repeat: no-repeat;
    470 }
    471 .ewd-ufaq-down-vote {
    472   background: transparent;
    473   background-repeat: no-repeat;
    474 }
    475 .ewd-ufaq-ratings-custom-image {
    476   background: transparent;
    477 }
    478 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image,
    479 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image {
    480   background: none;
    481   padding-left: 0;
    482 }
    483 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-up-image img,
    484 .ewd-ufaq-rating-button.ewd-ufaq-rating-button-custom-down-image img {
    485   position: relative;
    486   float: left;
    487   width: 48px;
    488   height: auto;
    489   margin-right: 4px;
    490 }
    491 
    492 
    493 /************************
    494 * Expand/Collapse
    495 ************************/
     192
    496193.ewd-ufaq-expand-all,
    497 .ewd-ufaq-collapse-all {
     194.ewd-ufaq-collapse-all{
    498195  text-decoration: none;
    499196  cursor: pointer;
    500197  font-size: 0.9em;
    501198}
     199
     200
    502201
    503202/*
    … …  
    520219.ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol,
    521220.ewd-ufaq-faq-category-title .ewd-ufaq-category-post-margin-symbol,
    522 .ewd-ufaq-toggle-all-symbol {
     221.ewd-ufaq-toggle-all-symbol{
    523222  font-family: 'ewd-toggle-icon';
    524 }
    525 
    526 
    527 /*
    528 ==============================================
    529 PChanges
    530 ==============================================
    531 */
    532 
    533 .ewd-ufaq-question-update{
    534 font-size: 1.2em;
    535 margin-bottom: 20px;
    536 }
    537 .ewd-ufaq-question-form .form-field {
    538   margin-bottom: 20px;
    539 }
    540 
    541 .rrssb-buttons li a .rrssb-text {
    542 color: #fff;
    543 margin-left: 5px;
    544 }
    545 
    546 .ewd-ufaq-social-links .rrssb-buttons li {
    547 margin-bottom: 5px;
    548223}
    549224
    … …  
    551226clear: both;
    552227}
     228
     229
    553230@media only screen and (max-width: 810px) {
    554 
    555 .ewd-ufaq-faq-title-text {
     231.ewd-ufaq-faq-title-text{
    556232width: 80%;
    557 }
    558 
    559 }
    560 
    561 
    562 
    563 /*
    564 ==============================================
    565 Pagination
    566 ==============================================
    567 */
    568 .ewd-ufaq-previous-faqs, .ewd-ufaq-next-faqs {
    569     margin-top: 16px;
    570 }
    571 .ewd-ufaq-previous-faqs {
    572     float: left;
    573 }
    574 .ewd-ufaq-next-faqs {
    575     float: right;
    576 }
    577 
    578 /* clears the 'X' from Internet Explorer */
    579 #ewd-ufaq-jquery-ajax-search input[type=search]::-ms-clear {
    580   display: none; width : 0; height: 0;
    581 }
    582 #ewd-ufaq-jquery-ajax-search input[type=search]::-ms-reveal {
    583   display: none; width : 0; height: 0;
    584 }
    585 
    586 /* clears the 'X' from Chrome */
    587 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-decoration,
    588 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-cancel-button,
    589 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-results-button,
    590 #ewd-ufaq-jquery-ajax-search input[type="search"]::-webkit-search-results-decoration {
    591   -webkit-appearance: none;
    592 }
    593 
    594 #ewd-ufaq-jquery-ajax-search * {
    595   vertical-align: middle;
    596 }
    597 #ewd-ufaq-jquery-ajax-search .search-field {
    598   display:  inline-block;
    599   margin:  15px;
    600   position: relative;
    601 }
    602 #ewd-ufaq-jquery-ajax-search .search-field .ewd-ufaq-text-input {
    603   margin: 0 !important;
    604   padding: 8px 30px 8px 12px !important;
    605 }
    606 #ewd-ufaq-jquery-ajax-search .clear-field {
    607   display: inline;
    608   padding: 0;
    609   margin: 0;
    610   height: 100%;
    611   background: transparent;
    612   position: absolute;
    613   top: 0;
    614   right: 0;
    615   color: black;
    616   transition: width 0.35s, opacity 0.25s;
    617   transform: translateX(15px);
    618   opacity: 0;
    619   width: 0;
    620 }
    621 #ewd-ufaq-jquery-ajax-search .clear-field.slide-in {
    622   opacity: 1;
    623   width: 30px;
    624   animation: slide-in-right 0.5s forwards;
    625   -webkit-animation: slide-in-right 0.5s forwards;
    626 }
    627 #ewd-ufaq-jquery-ajax-search .clear-field.slide-out {
    628   opacity: 0;
    629   width: 0;
    630   animation: slide-out-right 0.5s forwards;
    631   -webkit-animation: slide-out-right 0.5s forwards;
    632 }
    633 #ewd-ufaq-jquery-ajax-search .clear-field:hover,
    634 #ewd-ufaq-jquery-ajax-search .clear-field:focus {
    635   border-radius: 0;
    636 }
    637 @keyframes slide-in-right {
    638   100% {
    639     transform: translateX(0px);
    640   }
    641 }
    642 @keyframes slide-out-right {
    643   0% {
    644     transform: translateX(0px);
    645   }
    646   100% {
    647     transform: translateX(15px);
    648   }
    649 }
    650 
    651 
    652 /***************
    653 BLOCK PATTERNS
    654 ***************/
     233}}
     234
    655235.ewd-ufaq-pattern-faqs,
    656236.ewd-ufaq-pattern-featured-faqs,
    657237.ewd-ufaq-pattern-search,
    658 .ewd-ufaq-pattern-submit {
     238.ewd-ufaq-pattern-submit{
    659239        width: 100%;
    660240}
    661241
    662 /***************
    663 CATEGORY TABS
    664 ***************/
    665 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faqs {
    666   display: flex;
    667   width: 100%;
    668   position: relative;
    669 }
    670 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faq-category {
    671   display: flex;
    672   flex-direction: column;
    673   margin-right: 40px;
    674 }
    675 .ewd-ufaq-category-tabs-1 .ewd-ufaq-category-tab-selected h3 {
    676   font-weight: bold;
    677   text-decoration: underline;
    678 }
    679 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faq-category-inner {
    680   position: absolute;
    681   left: 0;
    682   top: 72px;
    683   width: 100%;
    684 }
    685 .ewd-ufaq-category-tabs-1 .ewd-ufaq-faq-category .ewd-ufaq-faq-category {
    686   position: relative;
    687   margin-right: 0;
    688   margin-top: 24px;
    689   width: 100%;
    690   clear: both;
    691   display: flex;
    692   flex-direction: column;
    693 }
    694 
    695 .ewd-ufaq-faq-category-body-hidden {
     242.ewd-ufaq-faq-category-body-hidden{
    696243  display: none;
    697244}
    698245
    699 
    700 /**********************/
    701 /** NEW META BUBBLES **/
    702 /**********************/
    703 
    704246.ewd-ufaq-faq-categories,
    705 .ewd-ufaq-faq-tags {
     247.ewd-ufaq-faq-tags{
    706248        margin: 14px 0;
    707249        display: flex;
    … …  
    711253        color: #212427;
    712254}
     255
    713256.ewd-ufaq-faq-categories a,
    714 .ewd-ufaq-faq-tags a {
     257.ewd-ufaq-faq-tags a{
    715258        text-decoration: none;
    716259        padding: 4px 12px;
    … …  
    719262        border-radius: 100px;
    720263}
    721 .ewd-ufaq-faq-custom-fields {
    722   margin-bottom: 14px;
    723 }
    724 .ewd-ufaq-custom-field-label {
    725   color: #212427;
    726 }
    727 
    728 /**********************/
    729 /**** COMPACT META ****/
    730 /**********************/
    731 
    732 .ewd-ufaq-compact-faq-meta {
    733         display: flex;
    734         width: 100%;
    735         flex-wrap: wrap;
    736         justify-content: right;
    737         align-items: center;
    738         gap: 0;
    739 }
    740 .ewd-ufaq-compact-faq-meta > div {
    741         width: 100%;
    742 }
    743 .ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink {
    744         width: auto;
    745         order: 25;
    746 }
    747 .ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink a {
    748         font-size: 16px;
    749         color: #7a7a7a;
    750         font-weight: normal;
    751         text-decoration: none;
    752 }
    753 .ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink-image {
    754         display: none;
    755 }
    756 .ewd-ufaq-compact-faq-meta .ewd-ufaq-social-links {
    757         width: auto;
    758         order: 26;
    759 }
    760 .ewd-ufaq-compact-faq-meta .ewd-ufaq-social-links-label {
    761         display: none;
    762 }
    763 .ewd-ufaq-compact-faq-meta .rrssb-buttons {
    764         height: auto;
    765         display: flex;
    766         align-items: center;
    767         margin: 0;
    768         float: none;
    769         gap: 4px;
    770 }
    771 .ewd-ufaq-compact-faq-meta .rrssb-buttons li {
    772         float: none;
    773         height: auto;
    774         line-height: initial;
    775         padding: 0;
    776         margin: 0;
    777 }
    778 .ewd-ufaq-compact-faq-meta .rrssb-buttons li a {
    779         height: auto;
    780         padding: 0;
    781         font-weight: normal;
    782         font-size: 16px;
    783         text-align: left;
    784         width: auto;
    785         border-radius: 0;
    786 }
    787 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-facebook a,
    788 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-twitter a,
    789 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-linkedin a,
    790 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-pinterest a,
    791 .ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-email a {
    792         background-color: transparent;
    793 }
    794 .ewd-ufaq-compact-faq-meta .rrssb-buttons li a .rrssb-icon,
    795 .ewd-ufaq-compact-faq-meta .rrssb-buttons li a .rrssb-text {
    796         display: none;
    797 }
    798 .ewd-ufaq-compact-faq-meta .ewd-ufaq-ratings {
    799         width: auto;
    800         order: 27;
    801         padding: 0;
    802         margin: 0;
    803         display: flex;
    804         align-items: center;
    805 }
    806 .ewd-ufaq-compact-faq-meta .ewd-ufaq-rating-button {
    807         float: none;
    808         width: auto;
    809         height: auto;
    810         margin: 0;
    811         line-height: initial;
    812         font-weight: normal;
    813   display: flex;
    814 }
    815 .ewd-ufaq-compact-faq-meta .ewd-ufaq-rating-button img {
    816         display: none !important;
    817 }
    818 .ewd-ufaq-compact-faq-meta .ewd-ufaq-rating-button span {
    819         width: auto;
    820   margin-left: 2px;
    821 }
    822 .ewd-ufaq-compact-faq-meta .ewd-ufaq-down-vote {
    823         height: auto !important;
    824         margin-left: 4px;
    825 }
    826 .ewd-ufaq-compact-faq-meta .ewd-ufaq-ratings-label {
    827         display: none;
    828 }
    829 
    830 .ewd-ufaq-hidden {
     264
     265.ewd-ufaq-hidden{
    831266  display: none;
    832267}
  • ultimate-faqs/trunk/assets/js/ewd-ufaq-admin.js

    r3507393 r3821169  
    6464} );
    6565
    66 jQuery(document).ready(function($) {
    67 
    68         $( '.ewd-ufaq-list' ).sortable({
    69                 items: '.ewd-ufaq-item',
    70                 opacity: 0.6,
    71                 cursor: 'move',
    72                 axis: 'y',
    73                 update: function() {
    74                                 var order = jQuery( this ).sortable( 'serialize' )
    75                                   + '&action=ewd_ufaq_update_faq_order'
    76                                   + '&nonce='+ewd_ufaq_php_data.nonce;
    77                                 jQuery.post( ajaxurl, order, function( response ) {} );
    78                 }
    79         });
    80 
    81         if ( jQuery( 'input[name="taxonomy"]' ).length && jQuery( 'input[name="taxonomy"]' ).val() == 'ufaq-category' ) {
    82 
    83         jQuery( 'table.wp-list-table tbody' ).sortable({
    84                 items: 'tr.level-0',
    85                 opacity: 0.6,
    86                 cursor: 'move',
    87                 update: function() {
    88 
    89                                 var params = {
    90                                         nonce: ewd_ufaq_php_data.nonce,
    91                                         action: 'ewd_ufaq_update_category_order'
    92                                 };
    93 
    94                                 var query_string = jQuery( this ).sortable('serialize');
    95                                 var data = jQuery.param( params ) + '&' + query_string;
    96 
    97                                 jQuery.post( ajaxurl, data, function( response ) {});
    98                 }
    99         })
    100     }
    101 });
     66// Helper owns explicit one-record order edits; partial sortable lists are never submitted.
    10267
    10368jQuery(document).ready(function($) {
    … …  
    10873});
    10974
    110 jQuery(document).ready(function($){
    111 
    112         $( '.sap-new-admin-add-button' ).on( 'click', function() {
    113 
    114                 setTimeout( ewd_ufaq_field_added_handler, 500);
    115         });
    116 });
    117 
    118 function ewd_ufaq_field_added_handler() {
    119 
    120         var highest = 0;
    121         jQuery( '.sap-infinite-table input[data-name="id"]' ).each( function() {
    122                 highest = Math.max( highest, this.value );
    123         });
    124 
    125         jQuery( '.sap-infinite-table  tbody tr:last-of-type span.sap-infinite-table-hidden-value' ).html( highest + 1 );
    126         jQuery( '.sap-infinite-table  tbody tr:last-of-type input[data-name="id"]' ).val( highest + 1 );
    127 }
     75// Helper owns custom-field input behavior.
    12876
    12977// Reset button for search term statistics
  • ultimate-faqs/trunk/assets/js/ewd-ufaq-managed-editor.js

    r3744649 r3821169  
    363363                }
    364364
    365                 function moveFaq( id, offset ) {
    366                         if ( busy || isSaving || trashRequests.current[ id ] ) { return; }
    367                         var from = selectedIds.indexOf( id );
    368                         var to = from + offset;
    369                         if ( from < 0 || to < 0 || to >= selectedIds.length ) { return; }
    370                         var next = selectedIds.slice();
    371                         next.splice( from, 1 ); next.splice( to, 0, id ); setIds( next );
    372                 }
    373365
    374366                var selected = selectedIds.map( function( id, index ) {
    … …  
    387379                                        el( Button, { isSecondary: true, disabled: busy || isSaving, onClick: function() { retryCategories( id ); } }, __( 'Retry category assignment', 'ultimate-faqs' ) ) ) : null,
    388380                                el( 'div', { className: 'ewd-ufaq-managed-actions' },
    389                                         config.canOrderFaqs ? el( Button, { isSmall: true, disabled: busy || isSaving || trashing[ id ] || index === 0, onClick: function() { moveFaq( id, -1 ); } }, __( 'Up', 'ultimate-faqs' ) ) : null,
    390                                         config.canOrderFaqs ? el( Button, { isSmall: true, disabled: busy || isSaving || trashing[ id ] || index === selectedIds.length - 1, onClick: function() { moveFaq( id, 1 ); } }, __( 'Down', 'ultimate-faqs' ) ) : null,
     381                                        typeof window.ewdUfaqManagedOrderControls === 'function' ? window.ewdUfaqManagedOrderControls( { id: id, index: index, ids: selectedIds, setIds: setIds, disabled: busy || isSaving || trashing[id] } ) : null,
    391382                                        el( Button, { isSmall: true, disabled: busy || isSaving || trashing[ id ], onClick: function() { removeFaq( id ); } }, __( 'Remove', 'ultimate-faqs' ) ),
    392383                                        record && record.can_delete ? el( Button, { isSmall: true, isDestructive: true, disabled: busy || isSaving || trashing[ id ], onClick: function() { setTrashId( id ); } }, trashing[ id ] ? __( 'Moving FAQ to Trash…', 'ultimate-faqs' ) : __( 'Move FAQ to Trash', 'ultimate-faqs' ) ) : null
  • ultimate-faqs/trunk/assets/js/ewd-ufaq.js

    r3704732 r3821169  
    1 var filtering_running = false;
    2 var wpforms_search_running = 'No';
    3 
    4 var ajax_ctrlr = {
    5 
    6         last_run: new Date(),
    7         srch_str: '',
    8         schdl_to_run_state: false,
    9         schdl_to_run_delay: 250,
    10         search_save_schdl_to_run_delay: 3000,
    11         schdl_to_run_cntr: 0,
    12         schdl_to_run_hndl: null,
    13         search_save_schdl_to_run_hndl: null,
    14 
    15         schedule_to_run: function() {
    16                 ajax_ctrlr.schdl_to_run_cntr++;
    17 
    18                 if(ajax_ctrlr.schdl_to_run_cntr % 5 == 0) {
    19                         ajax_ctrlr.schdl_to_run_delay += 250;
    20                         ajax_ctrlr.schdl_to_run_reset();
    21                 }
    22 
    23                 if( ! ajax_ctrlr.schdl_to_run_state) {
    24                         return;
    25                 }
    26 
    27                 let crnt_run = new Date();
    28 
    29                 if(crnt_run - ajax_ctrlr.last_run > ajax_ctrlr.schdl_to_run_delay) {
    30                         ajax_ctrlr.schdl_to_run_state = false;
    31                         ajax_ctrlr.schdl_to_run_cntr = 0;
    32                         ajax_ctrlr.last_run = new Date();
    33 
    34                         ewd_ufaq_ajax_reload();
    35 
    36                         ajax_ctrlr.save_search_schdl_to_run_reset();
    37                 }
    38         },
    39         schdl_to_run_reset: function () {
    40                 clearInterval(ajax_ctrlr.schdl_to_run_hndl);
    41                 ajax_ctrlr.schdl_to_run_hndl = setInterval(ajax_ctrlr.schedule_to_run, ajax_ctrlr.schdl_to_run_delay);
    42         },
    43         run_search_ajax: function( elm ) {
    44                 ajax_ctrlr.clear_field( elm );
    45 
    46                 let srch_str = jQuery(elm).val();
    47 
    48                 if( ajax_ctrlr.schdl_to_run_delay > 250 ) {
    49                         ajax_ctrlr.schdl_to_run_delay = 250;
    50                         ajax_ctrlr.schdl_to_run_reset();
    51                 }
    52 
    53                 if(srch_str != ajax_ctrlr.srch_str) {
    54                         ajax_ctrlr.srch_str = srch_str;
    55                         ajax_ctrlr.schdl_to_run_state = true;
    56                         ajax_ctrlr.last_run = new Date();
    57                 }
    58         },
    59         save_search_term: function() {
    60                 var params = {};
    61 
    62                 params.nonce       = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.nonce : '';
    63                 params.search_term = ajax_ctrlr.srch_str;
    64                 params.action      = 'ewd_ufaq_record_search_term';
    65 
    66                 var data = jQuery.param( params );
    67                 jQuery.post(ajaxurl, data, function(response) {});
    68         },
    69         save_search_schdl_to_run_reset: function() {
    70 
    71                 if ( typeof ewd_ufaq_php_data == 'undefined' || ! ewd_ufaq_php_data.save_search_terms ) { return false; }
    72 
    73                 clearTimeout(ajax_ctrlr.search_save_schdl_to_run_hndl);
    74                 ajax_ctrlr.search_save_schdl_to_run_hndl = setTimeout(ajax_ctrlr.save_search_term, ajax_ctrlr.search_save_schdl_to_run_delay);
    75         },
    76         clear_field: function ( srch_elm ) {
    77                 let cf = jQuery(srch_elm).parent('.search-field').find('.clear-field').eq(0);
    78                 if( 0 < jQuery(srch_elm).val().length ) {
    79                         if( 'hidden' == cf.data('state') ) {
    80                                 cf.data('state', 'visible');
    81                                 cf.removeClass('slide-out').addClass('slide-in');
    82                         }
    83                 }
    84                 else {
    85                         cf.data('state', 'hidden');
    86                         cf.removeClass('slide-in').addClass('slide-out');
    87                 }
    88         }
    89 };
    90 
    91 jQuery(function(){ //DOM Ready
    92         ufaqSetClickHandlers();
    93         UFAQSetAutoCompleteClickHandlers();
    94         UFAQSetRatingHandlers();
    95         UFAQSetExpandCollapseHandlers();
    96         UFAQSetPaginationHandlers();
    97 
    98         UFAQWPFormsHandler();
    99 });
    100 
    101 function ewd_ufaq_run_effect( display, faq_element ) {
    102 
    103         var selected_effect = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.reveal_effect : 'none';
    104 
    105         // most effect types need no options passed by default
    106         var options = {};
    107 
    108         // some effects have required parameters
    109         if ( selected_effect === 'size' ) {
    110 
    111         options = { to: { width: 200, height: 60 } };
    112         }
    113 
    114         // run the effect
    115         if ( display == 'show' ) { faq_element.find( '.ewd-ufaq-faq-body' ).show( selected_effect, options, 500, ewd_ufaq_toggle_hidden_class( faq_element ) ); }
    116         if ( display == 'hide' ) { faq_element.find( '.ewd-ufaq-faq-body' ).hide( selected_effect, options, 500, ewd_ufaq_toggle_hidden_class( faq_element ) ); }
    117 };
     1jQuery(function() { ufaqSetClickHandlers(); UFAQSetExpandCollapseHandlers(); });
     2
     3
    1184
    1195// callback function to bring a hidden box back
    120 function ewd_ufaq_toggle_hidden_class( faq_element ) {
    121 
    122         setTimeout( function() { faq_element.find( '.ewd-ufaq-faq-body' ).toggleClass( 'ewd-ufaq-hidden' ); }, 500 );
    123 };
     6
    1247
    1258function ufaqSetClickHandlers( context ) {
    1269
    12710        var interaction_scope = context ? jQuery( context ) : jQuery( document );
     11        UFAQSetExpandCollapseHandlers( context );
    12812
    12913        interaction_scope.find( '.ewd-ufaq-faq-toggle' ).off( 'click' ).on( 'click', function( event ) {
    … …  
    13519                event.preventDefault();
    13620               
    137                 faq = jQuery( this ).parent();
     21                var faq = jQuery( this ).parent();
    13822               
    13923                if ( faq.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) {
    … …  
    14125                        EWD_UFAQ_Reveal_FAQ( faq );
    14226
    143                         if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.faq_scroll ) { jQuery('html, body').animate({scrollTop: jQuery(this).offset().top -80}, 100); }
     27                        if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.faq_scroll ) { jQuery( this.ownerDocument ).find('html, body').animate({scrollTop: jQuery(this).offset().top -80}, 100); }
    14428                }
    14529                else {
    … …  
    15236               
    15337                var category_title = jQuery( this );
     38                var context_document = jQuery( this.ownerDocument );
    15439                var category = category_title.parent();
    15540                var category_inner = category.find( '.ewd-ufaq-faq-category-inner' ).first();
    156                 var category_inner_height = category_inner.outerHeight( true );
    157                 var faqs_list = category_inner.parent();
    158                 var faqs_list_height = faqs_list.outerHeight( true );
    159                 var total_faqs_height = category_inner_height + faqs_list_height;
    160 
    161                 jQuery( '.ewd-ufaq-category-tabs-1' ).css( 'height', total_faqs_height + 'px' );
    16241
    16342                jQuery( this ).toggleClass( 'ewd-ufaq-category-tab-selected' );
    … …  
    16746                if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.category_accordion ) {
    16847
    169                         jQuery( '.ewd-ufaq-faq-category-inner' ).each( function( index, object ) {
     48                        context_document.find( '.ewd-ufaq-faq-category-inner' ).each( function( index, object ) {
    17049                       
    17150                                if ( object != category_inner.get( 0 ) ) { jQuery( this ).addClass( 'ewd-ufaq-faq-category-body-hidden' ); }
    17251                        });
    17352
    174                         jQuery( '.ewd-ufaq-faq-category-title-toggle' ).each (function() {
    175 
    176                                 if ( jQuery( this ) != category_title ) { jQuery( this ).removeClass( 'ewd-ufaq-category-tab-selected' ); }
     53                        context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).each (function() {
     54
     55                                if ( this !== category_title[0] ) { jQuery( this ).removeClass( 'ewd-ufaq-category-tab-selected' ); }
    17756                        });
    17857                }
    17958
    180                 jQuery( '.ewd-ufaq-faq-category-title-toggle' ).each( function() {
     59                context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).each( function() {
    18160                        var span = jQuery( this ).find( '.ewd-ufaq-category-post-margin-symbol span' );
    18261
    18362                        if ( jQuery( this).hasClass( 'ewd-ufaq-category-tab-selected' ) )  {
    184                                 span.html( span.html().toUpperCase() );
     63                                span.text( span.text().toUpperCase() );
    18564                        }
    18665                        else {
    187                                 span.html( span.html().toLowerCase() );
     66                                span.text( span.text().toLowerCase() );
    18867                        }
    18968                } );
     69                if ( typeof window.ewdUfaqCategoryLayout === 'function' ) { window.ewdUfaqCategoryLayout( category_title ); }
    19070        });
    19171
    … …  
    19373                event.preventDefault();
    19474
    195                 jQuery( 'html, body' ).animate( { scrollTop: jQuery( '#ewd-ufaq-faq-list' ).offset().top -80 }, 100 );
     75                var context_document = jQuery( this.ownerDocument );
     76                var list = jQuery( this ).closest( '#ewd-ufaq-faq-list' );
     77                if ( list.length ) { context_document.find( 'html, body' ).animate( { scrollTop: list.offset().top -80 }, 100 ); }
    19678        });
    19779
    … …  
    20082
    20183                var faq_id = jQuery( this ).data( 'postid' );
    202                 var faq = jQuery( '#ewd-ufaq-post-' + faq_id ).first();
     84                var context_document = jQuery( this.ownerDocument );
     85                var faq = context_document.find( '#ewd-ufaq-post-' + faq_id ).first();
     86                if ( ! faq.length ) { return; }
    20387
    20488                if ( faq.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) {
    … …  
    20791                }
    20892
    209                 jQuery( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
    210         });
    211 }
    212 
    213 function UFAQSetAutoCompleteClickHandlers() {
    214 
    215         jQuery( '.ewd-ufaq-text-auto-complete' ).on( 'keyup', function() {
    216 
    217                 jQuery( '.ewd-ufaq-text-auto-complete' ).autocomplete({
    218 
    219                         source: typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.question_titles : '',
    220                         minLength: 3,
    221                         appendTo: '#ewd-ufaq-jquery-ajax-search',
    222                         select: function( event, ui ) {
    223                                 jQuery( this ).val( ui.item.value );
    224                                 ewd_ufaq_ajax_reload();
    225                         }
    226                 });
    227 
    228                 jQuery( '.ewd-ufaq-text-auto-complete' ).autocomplete( 'enable' );
    229         });
    230 }
     93                context_document.find( 'html, body' ).animate( { scrollTop: faq.offset().top - 20 }, 100 );
     94        });
     95}
     96
     97
    23198
    23299function EWD_UFAQ_Reveal_FAQ( faq_element ) {
     100        if ( ! faq_element || ! faq_element.length ) { return; }
    233101
    234102        var post_id = faq_element.data( 'post_id' );
    … …  
    243111        jQuery.post(ajaxurl, data, function(response) {});
    244112
    245         faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html( faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html().toUpperCase() );
     113        faq_element.find( '.ewd-ufaq-post-margin-symbol' ).each( function() { jQuery( this ).text( jQuery( this ).text().toUpperCase() ); } );
    246114
    247115        faq_element.find( '.ewd-ufaq-faq-excerpt' ).addClass( 'ewd-ufaq-hidden' );
    248116       
    249         if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect != 'none' ) { ewd_ufaq_run_effect( 'show', faq_element ); }
     117        if ( typeof ewd_ufaq_run_effect === 'function' && typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect && ewd_ufaq_php_data.reveal_effect != 'none' ) { ewd_ufaq_run_effect( 'show', faq_element ); }
    250118        else { faq_element.find( '.ewd-ufaq-faq-body' ).removeClass( 'ewd-ufaq-hidden' ); }
    251119                       
    252120        if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.faq_accordion ) {
    253121
    254                 jQuery( '.ewd-ufaq-faq-div' ).each( function() {
     122                jQuery( faq_element[0].ownerDocument ).find( '.ewd-ufaq-faq-div' ).each( function() {
    255123
    256124                        if ( jQuery( this ).prop( 'id' ) != faq_element.prop( 'id' ) ) {
    … …  
    271139
    272140function EWD_UFAQ_Hide_FAQ( faq_element ) {
     141        if ( ! faq_element || ! faq_element.length ) { return; }
    273142
    274143        var post_id = faq_element.data( 'post_id' );
    … …  
    276145        faq_element.find( '.ewd-ufaq-faq-excerpt' ).removeClass( 'ewd-ufaq-hidden' );
    277146
    278         if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect != 'none' && ! faq_element.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) { ewd_ufaq_run_effect( 'hide', faq_element ); }
     147        if ( typeof ewd_ufaq_run_effect === 'function' && typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.reveal_effect && ewd_ufaq_php_data.reveal_effect != 'none' && ! faq_element.find( '.ewd-ufaq-faq-body' ).hasClass( 'ewd-ufaq-hidden' ) ) { ewd_ufaq_run_effect( 'hide', faq_element ); }
    279148        else { faq_element.find( '.ewd-ufaq-faq-body' ).addClass( 'ewd-ufaq-hidden' ); }
    280149
    281150        faq_element.removeClass( 'ewd-ufaq-post-active' );
    282         faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html( faq_element.find( '.ewd-ufaq-post-margin-symbol' ).html().toLowerCase() );
     151        faq_element.find( '.ewd-ufaq-post-margin-symbol' ).each( function() { jQuery( this ).text( jQuery( this ).text().toLowerCase() ); } );
    283152}
    284153
    285154jQuery(document).ready(function() {
    286 
    287         if( 0 < jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).eq(0).length ) {
    288                 ajax_ctrlr.schdl_to_run_hndl = setInterval(ajax_ctrlr.schedule_to_run, ajax_ctrlr.schdl_to_run_delay);
    289         }
    290 
    291         jQuery( '#ewd-ufaq-ajax-search-submit' ).click( function() {
    292                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', 1 );
    293                 let elm = jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).eq(0);
    294                 ajax_ctrlr.run_search_ajax( elm[0] );
    295         });
    296 
    297         jQuery( '#ewd-ufaq-jquery-ajax-search' ).on( 'keyup', '.ewd-ufaq-text-input', function() {
    298                 ajax_ctrlr.run_search_ajax( this );
    299         });
    300 
    301         // clear search field
    302         jQuery( '#ewd-ufaq-jquery-ajax-search' ).on( 'click', '.clear-field', function() {
    303                 let elm = jQuery( '#ewd-ufaq-jquery-ajax-search .ewd-ufaq-text-input' ).eq(0);
    304                 jQuery(elm).val('');
    305                 ajax_ctrlr.run_search_ajax( elm[0] );
    306         });
    307 
    308         jQuery( '.ewd-ufaq-text-input ' ).on( 'search', function() {
    309                 ajax_ctrlr.run_search_ajax( this );
    310         });
    311 
    312155        if ( typeof ewd_ufaq_php_data != 'undefined' && ewd_ufaq_php_data.display_faq > 0 ) {
    313156               
    … …  
    322165});
    323166
    324 var request_count = 0;
    325 function ewd_ufaq_ajax_reload( pagination, append_results, search_string ) {
    326 
    327         filtering_running = true;
    328 
    329         var search_string = search_string ? search_string : jQuery( '.ewd-ufaq-text-input' ).val();
    330         var include_cat = jQuery( '#ewd-ufaq-include-category' ).val();
    331         var exclude_cat = jQuery( '#ewd-ufaq-exclude-category' ).val();
    332         var orderby = jQuery( '#ewd-ufaq-orderby' ).val();
    333         var order = jQuery( '#ewd-ufaq-order' ).val();
    334         var post_count = jQuery( '#ewd-ufaq-post-count' ).val();
    335         var current_url = jQuery( '#ewd-ufaq-current-url' ).val();
    336         var show_on_load = jQuery( '#ewd-ufaq-show-on-load' ).val();
    337 
    338         if ( search_string == undefined ) { search_string = ''; }
    339 
    340         if ( pagination == 'Yes' ) {
    341 
    342                 var faqs_only = 'Yes';
    343                 var faq_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    344         }
    345         else {
    346 
    347                 var retrieving_results = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.retrieving_results : 'Retrieving Results';
    348 
    349                 jQuery( '.ewd-ufaq-search .ewd-ufaq-faqs' ).html( '<h3>' + retrieving_results + '</h3>' );
    350 
    351                 var faqs_only = 'No';
    352                 var faq_page = 0;
    353                 jQuery( '.ewd-ufaq-bottom' ).remove();
    354         }
    355 
    356         request_count = request_count + 1;
    357 
    358     if ( jQuery( '.ewd-ufaq-text-input' ).length && 'yes' != show_on_load.toLocaleLowerCase() && search_string.length == 0 ) {
    359         jQuery( '.ewd-ufaq-search .ewd-ufaq-faqs' ).html('');
    360         return;
    361     }
    362 
    363         var params = {};
    364 
    365         params.search_string    = search_string;
    366         params.include_category = include_cat;
    367         params.exclude_category = exclude_cat;
    368         params.orderby = orderby;
    369         params.order   = order;
    370         params.post_count    = post_count;
    371         params.request_count = request_count;
    372         params.current_url   = current_url;
    373         params.faqs_only = faqs_only;
    374         params.faq_page  = faq_page;
    375         params.show_on_load = show_on_load;
    376         params.action = 'ewd_ufaq_search';
    377         params.nonce  = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.nonce : '';
    378 
    379         var data = jQuery.param( params );
    380 
    381         jQuery.post( ajaxurl, data, function( response ) {
    382 
    383                 if ( ! response || ! response.success || ! response.data ) { return; }
    384                 if ( response.data.analytics && response.data.analytics.endpoint && response.data.analytics.token ) {
    385                         try {
    386                                 var analyticsKey = 'ewdUfaqAnalytics:' + response.data.analytics.storage_key;
    387                                 if ( ! window.sessionStorage.getItem( analyticsKey ) ) {
    388                                         window.sessionStorage.setItem( analyticsKey, '1' );
    389                                         window.fetch( response.data.analytics.endpoint, { method: 'POST', credentials: 'omit', keepalive: true, headers: { 'Content-Type': 'application/json' }, body: JSON.stringify( { event: response.data.analytics.event, token: response.data.analytics.token } ) } ).catch( function() {} );
    390                                 }
    391                         } catch ( analyticsError ) {}
    392                 }
    393                
    394                 if ( response.data.request_count == request_count ) {
    395 
    396                         var data_output_selector = search_string || jQuery( '.ewd-ufaq-faq-list' ).prev().is( '#ewd-ufaq-jquery-ajax-search' ) ? '#ewd-ufaq-jquery-ajax-search + .ewd-ufaq-faq-list .ewd-ufaq-faqs' : '.ewd-ufaq-faqs:not(#ewd-ufaq-jquery-ajax-search + .ewd-ufaq-faq-list .ewd-ufaq-faqs)';
    397 
    398                         if ( ! jQuery( data_output_selector ).length ) { data_output_selector = '.ewd-ufaq-faqs'; }
    399 
    400                         if ( append_results == 'Yes' ) {
    401                                 jQuery( data_output_selector ).append( response.data.output );
    402                         }
    403                         else {
    404                                 jQuery( data_output_selector ).html( response.data.output );
    405                                 if( '' != response.data.pagination ) {
    406                                         jQuery('.ewd-ufaq-faq-list .ewd-ufaq-bottom').remove();
    407                                         jQuery('.ewd-ufaq-faq-list').append(response.data.pagination);
    408                                 }
    409                         }
    410 
    411                         jQuery( '.ewd-ufaq-bottom' ).data( 'max_page', response.data.max_page );
    412 
    413                         jQuery( '.ewd-ufaq-expand-all' ).removeClass( 'ewd-ufaq-hidden' );
    414                         jQuery( '.ewd-ufaq-collapse-all' ).addClass( 'ewd-ufaq-hidden' );
    415 
    416                         ufaqSetClickHandlers();
    417                         UFAQSetRatingHandlers();
    418                         UFAQSetPaginationHandlers();
    419                         UFAQUpdatePaginationButtons();
    420                         UFAQSetExpandCollapseHandlers();
    421 
    422                         filtering_running = false;
    423                 }
    424         });
    425 }
    426 
    427 function UFAQSetRatingHandlers() {
    428 
    429         jQuery( '.ewd-ufaq-rating-button' ).off( 'click' ).on( 'click', function() {
    430                
    431                 var faq_id = jQuery( this ).data( 'faq_id' );
    432                 jQuery( '*[data-faq_id="' + faq_id + '"]' ).off( 'click' );
    433 
    434                 var current_count = jQuery( this ).find( 'span' ).html();
    435                 current_count++;
    436                 jQuery( this ).find( 'span' ).html( current_count );
    437 
    438                 if ( jQuery( this ).hasClass( 'ewd-ufaq-up-vote' ) ) { vote_type = 'up'; }
    439                 else { vote_type = 'down'; }
    440 
    441                 var params = {};
    442 
    443                 params.action = 'ewd_ufaq_update_rating';
    444                 params.nonce  = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.nonce : '';
    445                 params.faq_id = faq_id;
    446                 params.vote_type = vote_type;
    447 
    448                 var data = jQuery.param( params );
    449                 jQuery.post( ajaxurl, data );
    450         });
    451 }
    452 
    453 function UFAQSetExpandCollapseHandlers() {
    454 
    455         jQuery('.ewd-ufaq-expand-all').off('click').on('click', function() {
     167
     168
     169
     170
     171function UFAQSetExpandCollapseHandlers( context ) {
     172        var interaction_scope = context ? jQuery( context ) : jQuery( document );
     173
     174        interaction_scope.find('.ewd-ufaq-expand-all').off('click').on('click', function() {
     175                var context_document = jQuery( this.ownerDocument );
    456176               
    457177                var accordion_setting = typeof ewd_ufaq_php_data != 'undefined' ? ewd_ufaq_php_data.faq_accordion : false;
    458                 ewd_ufaq_php_data.faq_accordion = false; // turn FAQ accordion off while expanding all
    459 
    460                 jQuery( '.ewd-ufaq-faq-toggle' ).each( function() {
     178                if ( typeof ewd_ufaq_php_data != 'undefined' ) { ewd_ufaq_php_data.faq_accordion = false; } // turn FAQ accordion off while expanding all
     179
     180                context_document.find( '.ewd-ufaq-faq-toggle' ).each( function() {
    461181
    462182                        var faq = jQuery(this).parent();
    … …  
    469189                if ( typeof ewd_ufaq_php_data != 'undefined' ) { ewd_ufaq_php_data.faq_accordion = accordion_setting; } //reset FAQ accordion setting
    470190
    471                 jQuery('.ewd-ufaq-faq-category-inner').removeClass('ewd-ufaq-faq-category-body-hidden');
    472                 jQuery('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
    473                 jQuery('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
    474 
    475                 jQuery( '.ewd-ufaq-faq-category-title-toggle' ).addClass( 'ewd-ufaq-category-tab-selected' );
    476                 jQuery( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
    477                         jQuery( this ).html().toUpperCase();
    478                 });
    479         });
    480 
    481         jQuery('.ewd-ufaq-collapse-all').off('click').on('click', function() {
    482 
    483                 jQuery('.ewd-ufaq-faq-toggle').each(function() {
     191                context_document.find('.ewd-ufaq-faq-category-inner').removeClass('ewd-ufaq-faq-category-body-hidden');
     192                context_document.find('.ewd-ufaq-collapse-all').removeClass('ewd-ufaq-hidden');
     193                context_document.find('.ewd-ufaq-expand-all').addClass('ewd-ufaq-hidden');
     194
     195                context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).addClass( 'ewd-ufaq-category-tab-selected' );
     196                context_document.find( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
     197                        jQuery( this ).text( jQuery( this ).text().toUpperCase() );
     198                });
     199        });
     200
     201        interaction_scope.find('.ewd-ufaq-collapse-all').off('click').on('click', function() {
     202                var context_document = jQuery( this.ownerDocument );
     203
     204                context_document.find('.ewd-ufaq-faq-toggle').each(function() {
    484205
    485206                        var faq = jQuery(this).parent();
    … …  
    490211                });
    491212
    492                 jQuery( '.ewd-ufaq-faq-category-inner' ).addClass( 'ewd-ufaq-faq-category-body-hidden' );
    493                 jQuery( '.ewd-ufaq-faq-category-title-toggle' ).removeClass( 'ewd-ufaq-category-tab-selected' );
    494 
    495                 jQuery( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
    496                         jQuery( this ).html().toLowerCase();
    497                 });
    498 
    499                 jQuery('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
    500                 jQuery('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
    501         });
    502 }
    503 
    504 function UFAQSetPaginationHandlers() {
    505 
    506         jQuery('.ewd-ufaq-previous-faqs').off( 'click' ).on('click', function() {
    507 
    508                 var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    509 
    510                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', Math.max( current_page - 1, 0 ) );
    511                 jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
    512 
    513                 ewd_ufaq_ajax_reload( 'Yes', 'No' );
    514         });
    515 
    516         jQuery('.ewd-ufaq-next-faqs').off( 'click' ).on('click', function() {
    517 
    518                 var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    519 
    520                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', current_page + 1 );
    521                 jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
    522 
    523                 ewd_ufaq_ajax_reload( 'Yes', 'No' );
    524         });
    525 
    526         jQuery( '.ewd-ufaq-load-more' ).off( 'click' ).on( 'click', function() {
    527 
    528                 var current_page = jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' );
    529 
    530                 jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', current_page + 1 );
    531                 jQuery( '.ewd-ufaq-max-faqs-not-reached' ).remove();
    532 
    533                 ewd_ufaq_ajax_reload( 'Yes', 'Yes' );
    534         });
    535 
    536         if ( jQuery( '.ewd-ufaq-pagination-infinite_scroll' ).length ) {
    537 
    538                 jQuery( window ).scroll( function() {
    539 
    540                         var infinite_pos = jQuery( '.ewd-ufaq-pagination-infinite_scroll').position();
    541 
    542                         if ( infinite_pos != undefined && jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) != jQuery( '.ewd-ufaq-bottom' ).data( 'max_page' ) ) {
    543 
    544                                 if  ( ( jQuery( window ).height() + jQuery( window ).scrollTop() > infinite_pos.top ) && filtering_running == false ) {
    545 
    546                                         jQuery( '.ewd-ufaq-bottom' ).data( 'current_page', jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) + 1 );
    547 
    548                                         ewd_ufaq_ajax_reload( 'Yes', 'Yes' );
    549                                 }
    550                         }
    551                 });
    552         }
    553 }
    554 
    555 function UFAQUpdatePaginationButtons() {
    556 
    557         jQuery('.ewd-ufaq-bottom').first().appendTo('.ewd-ufaq-faq-list');
    558 
    559         if ( jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) < jQuery( '.ewd-ufaq-bottom' ).data( 'max_page' ) ) {
    560 
    561                 jQuery( '.ewd-ufaq-load-more, .ewd-ufaq-next-faqs' ).removeClass( 'ewd-ufaq-hidden' );
    562         }
    563         else { jQuery( '.ewd-ufaq-load-more, .ewd-ufaq-next-faqs' ).addClass( 'ewd-ufaq-hidden' ); }
    564 
    565         if ( jQuery( '.ewd-ufaq-bottom' ).data( 'current_page' ) <= 1 ) {
    566 
    567                 jQuery( '.ewd-ufaq-previous-faqs' ).addClass( 'ewd-ufaq-hidden' );
    568         }
    569         else { jQuery( '.ewd-ufaq-previous-faqs' ).removeClass( 'ewd-ufaq-hidden' ); }
    570 }
    571 
    572 function UFAQWPFormsHandler() {
    573        
    574         if ( typeof wpforms_integration === 'undefined' || wpforms_integration === null ) { return; }
    575 
    576         if ( wpforms_integration.ufaq_enabled == 'disabled' ) { return; }
    577 
    578         var target_field = wpforms_integration.ufaq_selected_field;
    579 
    580         jQuery( '#wpforms-' + wpforms_integration.form_id + '-field_' + wpforms_integration.ufaq_selected_field ).on( 'keyup', function() {
    581 
    582                 var search_string = jQuery( this ).val();
    583 
    584                 if ( search_string.length >= wpforms_integration.ufaq_minimum_characters ) {
    585 
    586                         jQuery( '.ewd-ufaq-wpforms-faq-results' ).removeClass( 'ewd-ufaq-hidden' );
    587                         jQuery( '.ewd-ufaq-wpforms-label' ).removeClass( 'ewd-ufaq-hidden' );
    588 
    589                         ewd_ufaq_ajax_reload( 'No', 'No', search_string );
    590                 }
    591                 else if ( ! filtering_running ) {
    592 
    593                         jQuery( '.ewd-ufaq-faqs' ).html( ' ' );
    594                         jQuery( '.ewd-ufaq-wpforms-faq-results' ).addClass( 'ewd-ufaq-hidden' );
    595                         jQuery( '.ewd-ufaq-wpforms-label' ).addClass( 'ewd-ufaq-hidden' );
    596                 }
    597 
    598         });
    599 }
     213                context_document.find( '.ewd-ufaq-faq-category-inner' ).addClass( 'ewd-ufaq-faq-category-body-hidden' );
     214                context_document.find( '.ewd-ufaq-faq-category-title-toggle' ).removeClass( 'ewd-ufaq-category-tab-selected' );
     215
     216                context_document.find( '.ewd-ufaq-category-post-margin-symbol span' ).each( function() {
     217                        jQuery( this ).text( jQuery( this ).text().toLowerCase() );
     218                });
     219
     220                context_document.find('.ewd-ufaq-expand-all').removeClass('ewd-ufaq-hidden');
     221                context_document.find('.ewd-ufaq-collapse-all').addClass('ewd-ufaq-hidden');
     222        });
     223}
     224
     225
     226
     227
     228
     229
    600230
    601231/*jQuery(document).ready(function() {
    … …  
    626256});*/
    627257
    628 jQuery( document ).ready( function() {
    629        
    630         jQuery( '.ewd-ufaq-compact-faq-meta .ewd-ufaq-permalink a' ).html( '<span class="dashicons dashicons-admin-links"></span>' );
    631         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-facebook a' ).html( '<span class="dashicons dashicons-facebook-alt"></span>' );
    632         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-twitter a' ).html( '<span class="dashicons dashicons-twitter-alt"></span>' );
    633         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-linkedin a' ).html( '<span class="dashicons dashicons-linkedin"></span>' );
    634         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-pinterest a' ).html( '<span class="dashicons dashicons-pinterest"></span>' );
    635         jQuery( '.ewd-ufaq-compact-faq-meta .rrssb-buttons li.rrssb-email a' ).html( '<span class="dashicons dashicons-email-alt"></span>' );
    636         jQuery( '.ewd-ufaq-compact-faq-meta .ewd-ufaq-up-vote' ).prepend( '<span class="dashicons dashicons-thumbs-up"></span>' );
    637         jQuery( '.ewd-ufaq-compact-faq-meta .ewd-ufaq-down-vote' ).prepend( '<span class="dashicons dashicons-thumbs-down"></span>' );
    638 } );
  • ultimate-faqs/trunk/ewd-ufaq-templates/faq.php

    r3352283 r3821169  
    77        <?php $this->maybe_print_faq_preview(); ?>
    88
    9         <div class='ewd-ufaq-faq-body<?php echo ( ! $this->display_all_answers ? ' ewd-ufaq-hidden' : '' ); ?><?php echo ( $ewd_ufaq_controller->settings->get_setting( 'compact-faq-meta' ) ? ' ewd-ufaq-compact-faq-meta' : '' ); ?>' >
     9        <div <?php echo ewd_format_classes( $this->get_body_classes() ); ?>>
    1010
    1111                <?php foreach ( $this->get_order_elements() as $element => $label ) { ?>
  • ultimate-faqs/trunk/ewd-ufaq-templates/faqs-search-submit.php

    r2643489 r3821169  
    1 <label for='ewd-ufaq-search-submit'></label>
    2 
    3 <input type='button' id='ewd-ufaq-ajax-search-submit' name='Search' value='<?php echo esc_html( $this->get_label( 'label-search' ) ); ?>'>
     1<?php
     2// Compatibility template identity; Helper supplies advanced-search controls.
     3echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'advanced_search_submit', $this );
  • ultimate-faqs/trunk/ewd-ufaq-templates/faqs-search.php

    r2830708 r3821169  
    1 <div id='ewd-ufaq-jquery-ajax-search'>
    2 
    3         <label class='ewd-ufaq-field-label' for='ewd-ufaq-text-search'>
    4                 <?php echo esc_html( $this->get_label( 'label-enter-question' ) ); ?>:
    5         </label>
    6 
    7         <?php $this->maybe_print_shortcode_args(); ?>
    8 
    9         <div class="search-field">
    10                 <input
    11                         id='ewd-ufaq-text-search'
    12                         type='search'
    13                         class='ewd-ufaq-text-input <?php echo ( $this->get_option( 'auto-complete-titles' ) ? 'ewd-ufaq-text-auto-complete' : '' ); ?>'
    14                         placeholder='<?php echo esc_attr( $this->get_label( 'label-search-placeholder' ) ); ?>'
    15                         value='<?php echo ( isset( $_GET['faq_search_term'] ) ? esc_attr( $_GET['faq_search_term'] ) : '' ); ?>' />
    16                 <button type="button" class="clear-field" data-state="hidden">x</button>
    17         </div>
    18 
    19         <?php $this->maybe_print_search_submit(); ?>
    20 
    21 </div>
     1<?php
     2// Compatibility template identity. Free's ordinary GET form is owned by BasicSearch.
     3echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'advanced_search_form', $this );
  • ultimate-faqs/trunk/includes/AIAssist.class.php

    r3704732 r3821169  
    99if ( !class_exists( 'ewdufaqAIAssist' ) ) {
    1010class ewdufaqAIAssist {
     11        public static function limits( $operation ) {
     12                $defaults = array( 'sources' => 1, 'faqs' => 1 );
     13                $limits = apply_filters( 'ewd_ufaq_legacy_ai_limits', $defaults, $operation );
     14                foreach ( $defaults as $key => $value ) { if ( ! is_array( $limits ) || ! isset( $limits[ $key ] ) || ! is_int( $limits[ $key ] ) || $limits[ $key ] < 1 ) { return $defaults; } }
     15                return array_intersect_key( $limits, $defaults );
     16        }
    1117
    1218        public function __construct() {
    … …  
    4147
    4248                if ( ! isset( $post_type ) or $post_type != EWD_UFAQ_FAQ_POST_TYPE ) { return; }
     49                $limits = self::limits( 'render' );
    4350
    4451                $args = array(
    … …  
    96103                                                <select id='ewd-ufaq-ai-faqs-count'>
    97104
    98                                                         <?php for ( $i = 1; $i <= ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ? 1 : 20 ) ; $i++ ) { ?>
     105                                                        <?php for ( $i = 1; $i <= $limits['faqs']; $i++ ) { ?>
    99106
    100107                                                                <option value='<?php echo $i; ?>'>
    … …  
    106113                                                </select>
    107114
    108                                                 <?php if ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ) { ?>
     115                                                <?php if ( 1 === $limits['faqs'] ) { ?>
    109116
    110117                                                        <div class='ewd-ufaq-ai-no-premium-explanation'>
    … …  
    122129                                                </label>
    123130
    124                                                 <select id='ewd-ufaq-ai-faqs-content' <?php echo ( $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ? 'multiple=\'multiple\'' : '' ); ?>>
     131                                                <select id='ewd-ufaq-ai-faqs-content' <?php echo $limits['sources'] > 1 ? 'multiple="multiple"' : ''; ?>>
    125132
    126133                                                        <?php foreach ( $content_options as $post_type => $posts ){ ?>
    … …  
    232239                }
    233240
    234                 $is_premium = $ewd_ufaq_controller->permissions->check_permission( 'premium' );
     241                $limits = self::limits( 'retrieve' );
    235242                $selected_posts = array_values( array_unique( array_filter( array_map( 'absint', $selected_raw ) ) ) );
    236                 $selected_posts = array_slice( $selected_posts, 0, $is_premium ? 20 : 1 );
    237                 $faq_count = min( max( 1, isset( $_POST['faq_count'] ) ? absint( $_POST['faq_count'] ) : 1 ), $is_premium ? 20 : 1 );
     243                $selected_posts = array_slice( $selected_posts, 0, $limits['sources'] );
     244                $faq_count = min( max( 1, isset( $_POST['faq_count'] ) ? absint( $_POST['faq_count'] ) : 1 ), $limits['faqs'] );
    238245                $set_categories = isset( $_POST['set_categories'] ) && 'yes' === sanitize_text_field( wp_unslash( $_POST['set_categories'] ) );
    239246
    … …  
    399406                }
    400407
    401                 $limit = $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ? 20 : 1;
     408                $limits = self::limits( 'publish' );
     409                $limit = $limits['faqs'];
    402410                $faqs = array_slice( $this->sanitize_faqs( $faqs_raw ), 0, $limit );
    403411                foreach ( $faqs as $faq ) {
  • ultimate-faqs/trunk/includes/Ajax.class.php

    r3744649 r3821169  
    1010        class ewdufaqAJAX {
    1111
    12                 public function __construct() {
     12                public function __construct( $register = true ) {
     13                        if ( ! $register ) { return; }
    1314
    14                         add_action( 'wp_ajax_ewd_ufaq_search', array( $this, 'return_search_results' ) );
    15                         add_action( 'wp_ajax_nopriv_ewd_ufaq_search', array( $this, 'return_search_results' ) );
    16 
    17                         add_action( 'wp_ajax_ewd_ufaq_record_search_term', array( $this, 'save_search_term' ) );
    18                         add_action( 'wp_ajax_nopriv_ewd_ufaq_record_search_term', array( $this, 'save_search_term' ) );
    1915
    2016                        add_action( 'wp_ajax_ewd_ufaq_reset_saved_search_terms', array( $this, 'reset_saved_search_term' ) );
    … …  
    2319                        add_action( 'wp_ajax_nopriv_ewd_ufaq_record_view', array( $this, 'record_view' ) );
    2420
    25                         add_action( 'wp_ajax_ewd_ufaq_update_rating', array( $this, 'update_rating' ) );
    26                         add_action( 'wp_ajax_nopriv_ewd_ufaq_update_rating', array( $this, 'update_rating' ) );
    2721
    28                         add_action( 'wp_ajax_ewd_ufaq_update_faq_order', array( $this, 'update_faq_order' ) );
    29 
    30                         add_action( 'wp_ajax_ewd_ufaq_update_category_order', array( $this, 'update_category_order' ) );
    3122                }
    3223
    … …  
    3627                 */
    3728                public function return_search_results() {
    38                         global $ewd_ufaq_controller;
    39                         if ( !check_ajax_referer( 'ewd-ufaq-js', 'nonce' ) ) {
    40                                 ewdufaqHelper::bad_nonce_ajax();
    41                         }
    42 
    43                         if ( $ewd_ufaq_controller->helper_compatibility->get_state() !== 'compatible'
    44                                 || ! $ewd_ufaq_controller->permissions->check_permission( 'search' ) ) {
    45 
    46                                 wp_send_json_error( array( 'code' => 'advanced_search_unavailable' ), 403 );
    47                         }
    48                         $faq_atts = array(
    49                                 'is_search'                                     => 1,
    50                                 'search_string'                         => '',
    51                                 'post__in'                                      => '',
    52                                 'post__in_string'                       => '',
    53                                 'include_tag'                           => '',
    54                                 'include_category'                      => isset( $_POST['include_category'] ) ? sanitize_text_field( $_POST['include_category'] ) : '', //so that only the matching category is displayed
    55                                 'exclude_category'                      => '',
    56                                 'include_category_ids'          => '',
    57                                 'exclude_category_ids'          => '',
    58                                 'include_category_children'     => '',
    59                                 'no_comments'                           => '',
    60                                 'orderby'                                       => '',
    61                                 'order'                                         => '',
    62                                 'display_all_answers'           => '',
    63                                 'faq_page'                                      => 1,
    64                                 'post_count'                            => -1
    65                         );
    66 
    67                         $query = new ewdufaqQuery( $faq_atts );
    68 
    69                         $query->parse_request_args();
    70                         $query->prepare_args();
    71 
    72                         $faq_atts['search_string'] = isset( $_REQUEST['search_string'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['search_string'] ) ) : '';
    73                         $faqs = new ewdufaqViewFAQs( $faq_atts );
    74 
    75                         $faqs->set_request_parameters();
    76 
    77                         $faqs->set_faqs( $query->get_faqs() );
    78 
    79                         $faqs->set_faqs_options();
    80 
    81                         $faqs->create_faq_data();
    82 
    83                         $faqs->set_faq_properties();
    84 
    85                         ob_start();
    86 
    87                         $ewd_ufaq_controller->shortcode_printing = true;
    88 
    89                         $faqs->print_faqs();
    90 
    91                         $ewd_ufaq_controller->shortcode_printing = false;
    92 
    93                         $output = ob_get_clean();
    94 
    95                         $pagination = '';
    96                         if('yes' != $faqs->show_on_load && 2 > $faqs->faq_page) {
    97                                 ob_start();
    98                                 $faqs->maybe_print_pagination();
    99                                 $pagination = ob_get_clean();
    100                         }
    101 
    102                         $output = $output ? $output : '<div class="ewd-ufaq-no-results-found">' . sprintf( $ewd_ufaq_controller->settings->get_setting( 'label-no-results-found' ), $query->args['search_string'] ) . '</div>';
    103 
    104                         do_action( 'ewd_ufaq_advanced_search_completed', $query->args['search_string'], count( $faqs->displayed_faqs ), $faq_atts );
    105                         $analytics = apply_filters( 'ewd_ufaq_advanced_search_analytics', array(), $query->args['search_string'], count( $faqs->displayed_faqs ), $faq_atts );
    106                         wp_send_json_success(
    107                                 array(
    108                                         'output'                => $output,
    109                                         'pagination'    => $pagination,
    110                                         'faq_count'     => $faqs->faq_count,
    111                                         'max_page'              => $faqs->max_page,
    112                                         'request_count' => intval( $_POST['request_count'] ),
    113                                         'analytics'             => $analytics,
    114                                 )
    115                         );
    116 
    117                     die();
     29                        if ( class_exists( 'ewdufaqEWDPHSearch', false ) ) { return ( new ewdufaqEWDPHSearch( false ) )->return_search_results(); }
     30                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    11831                }
    11932
    … …  
    14457                 */
    14558                public function update_rating() {
    146                         global $ewd_ufaq_controller;
    147                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'premium' ) ) {
    148                                 wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    149                         }
    150 
    151                         if ( !check_ajax_referer( 'ewd-ufaq-js', 'nonce' ) ) {
    152                                 ewdufaqHelper::bad_nonce_ajax();
    153                         }
    154 
    155                         $faq_id = isset( $_POST['faq_id'] ) ? absint( $_POST['faq_id'] ) : 0;
    156                         $vote_type = isset( $_POST['vote_type'] ) ? sanitize_key( wp_unslash( $_POST['vote_type'] ) ) : '';
    157 
    158                         if ( ! $this->is_public_faq( $faq_id ) || ! in_array( $vote_type, array( 'up', 'down' ), true ) ) {
    159 
    160                                 wp_send_json_error( array( 'code' => 'invalid_rating' ), 400 );
    161                         }
    162 
    163                         if ( ! $this->allow_public_event( 'rating', $faq_id, DAY_IN_SECONDS ) ) { wp_send_json_success( array( 'duplicate' => true ) ); }
    164 
    165                         if ( 'up' === $vote_type ) {
    166 
    167                                 $this->increment_post_meta( $faq_id, 'FAQ_Up_Votes', 1 );
    168                                 $this->increment_post_meta( $faq_id, 'FAQ_Total_Score', 1 );
    169                         }
    170                         else {
    171 
    172                                 $this->increment_post_meta( $faq_id, 'FAQ_Down_Votes', 1 );
    173                                 $this->increment_post_meta( $faq_id, 'FAQ_Total_Score', -1 );
    174                         }
    175 
    176                         do_action( 'ewd_ufaq_public_faq_helpfulness', $faq_id, $vote_type );
    177 
    178                         wp_send_json_success();
     59                        if ( class_exists( 'ewdufaqEWDPHPaidAjax', false ) ) { return ewdufaqEWDPHPaidAjax::update_rating( $this ); }
     60                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    17961                }
    18062
    … …  
    18466                 */
    18567                public function update_faq_order() {
    186                         global $ewd_ufaq_controller;
    187 
    188                         if (
    189                                 ! check_ajax_referer( 'ewd-ufaq-admin-js', 'nonce' )
    190                                 ||
    191                                 ! current_user_can( $ewd_ufaq_controller->settings->get_setting( 'access-role' ) )
    192                         ) {
    193                                 ewdufaqHelper::admin_nopriv_ajax();
    194                         }
    195 
    196                         if ( ! is_array( $_POST['ewd-ufaq-item'] ) or ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) { return; }
    197 
    198                 foreach ( $_POST['ewd-ufaq-item'] as $key => $id ) {
    199 
    200                     update_post_meta( intval( $id ), 'ufaq_order', intval( $key ) + 1 );
    201                 }
    202 
    203                         die();
     68                        if ( class_exists( 'ewdufaqEWDPHOrdering', false ) ) { return ewdufaqEWDPHOrdering::save_faq(); }
     69                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    20470                }
    20571
    … …  
    20975                 */
    21076                public function update_category_order() {
    211                         global $ewd_ufaq_controller;
    212                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) {
    213                                 wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    214                         }
    215 
    216                         // Authenticate request
    217                         if (
    218                                 ! check_ajax_referer( 'ewd-ufaq-admin-js', 'nonce' )
    219                                 ||
    220                                 ! current_user_can( $ewd_ufaq_controller->settings->get_setting( 'access-role' ) )
    221                         ) {
    222                                 ewdufaqHelper::admin_nopriv_ajax();
    223                         }
    224 
    225                         $ids = is_array( $_POST['tag'] ) ? array_map( 'intval', $_POST['tag'] ) : array();
    226                
    227                         foreach ( $ids as $order => $term_id ) {
    228 
    229                                 update_term_meta( $term_id, 'ufaq_category_order', $order );
    230                         }
     77                        if ( class_exists( 'ewdufaqEWDPHOrdering', false ) ) { return ewdufaqEWDPHOrdering::save_category(); }
     78                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    23179                }
    23280
    … …  
    23684                 */
    23785                public function save_search_term() {
    238                         global $ewd_ufaq_controller;
    239                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'search' ) ) {
    240                                 wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    241                         }
    242 
    243                         if ( !check_ajax_referer( 'ewd-ufaq-js', 'nonce' ) ) {
    244                                 ewdufaqHelper::bad_nonce_ajax();
    245                         }
    246 
    247                         if ( empty( $ewd_ufaq_controller->settings->get_setting( 'save-search-terms' ) ) ) { return; }
    248 
    249                         $search_term = isset( $_POST['search_term'] ) ? sanitize_text_field( wp_unslash( $_POST['search_term'] ) ) : '';
    250                         $search_term = function_exists( 'mb_substr' ) ? mb_substr( $search_term, 0, 200 ) : substr( $search_term, 0, 200 );
    251                         if ( empty( $search_term ) or strlen( $search_term ) < 2 ) { die(); }
    252 
    253                         $search_terms = get_option( 'ewd-ufaq-search-data', array() );
    254 
    255                         if ( isset( $search_terms[ $search_term ] ) ) {
    256 
    257                                 $search_terms[ $search_term ]++;
    258                         }
    259                         elseif ( count( $search_terms ) < 1000 ) {
    260 
    261                                 $search_terms[ $search_term ] = 1;
    262                         }
    263                         update_option( 'ewd-ufaq-search-data', $search_terms );
    264 
    265                         die();
     86                        if ( class_exists( 'ewdufaqEWDPHSearch', false ) ) { return ( new ewdufaqEWDPHSearch( false ) )->save_search_term(); }
     87                        wp_send_json_error( array( 'code' => 'premium_unavailable' ), 403 );
    26688                }
    26789
  • ultimate-faqs/trunk/includes/AnalyticsBridge.class.php

    r3704732 r3821169  
    11<?php
    2 /**
    3  * Common analytics event bridge. Free registers no analytics storage or public route.
    4  */
    5 
    6 if ( ! defined( 'ABSPATH' ) ) {
    7         exit;
    8 }
    9 
    10 if ( ! class_exists( 'ewdufaqAnalyticsBridge' ) ) {
    11         class ewdufaqAnalyticsBridge {
    12 
    13                 private $contexts        = array();
    14                 private $assets_enqueued = false;
    15 
    16                 public function __construct() {
    17 
    18                         add_action( 'ewd_ufaq_basic_search_rendered', array( $this, 'register_search' ), 10, 5 );
    19                         add_action( 'ewd_ufaq_faq_rendered', array( $this, 'register_faq' ), 10, 2 );
    20                         add_filter( 'ewd_ufaq_advanced_search_analytics', array( $this, 'advanced_search_context' ), 10, 4 );
    21                         add_action( 'wp_footer', array( $this, 'print_contexts' ), 5 );
    22                 }
    23 
    24                 public function advanced_search_context( $context, $term, $result_count, $args ) {
    25 
    26                         $term = trim( sanitize_text_field( $term ) );
    27                         if ( '' === $term ) {
    28                                 return $context; }
    29                         $payload  = array(
    30                                 'event'        => 'search',
    31                                 'display_hash' => hash( 'sha256', 'advanced|' . wp_json_encode( $args ) ),
    32                                 'locale'       => determine_locale(),
    33                                 'search_text'  => $term,
    34                                 'query_hash'   => hash( 'sha256', determine_locale() . '|' . $term ),
    35                                 'result_count' => absint( $result_count ),
    36                         );
    37                         $token    = apply_filters( 'ewd_ufaq_analytics_sign_event_context', '', $payload );
    38                         $endpoint = apply_filters( 'ewd_ufaq_analytics_endpoint', '' );
    39                         if ( ! is_string( $token ) || '' === $token || ! is_string( $endpoint ) || '' === $endpoint ) {
    40                                 return $context; }
    41                         return array(
    42                                 'event'       => 'search',
    43                                 'endpoint'    => $endpoint,
    44                                 'token'       => $token,
    45                                 'storage_key' => substr( hash( 'sha256', $payload['query_hash'] . '|' . $payload['display_hash'] . '|' . absint( $result_count ) ), 0, 32 ),
    46                         );
    47                 }
    48 
    49                 public function register_search( $identity, $term, $result_count, $args, $faq_ids = array() ) {
    50 
    51                         $display_hash = hash( 'sha256', $identity . '|' . wp_json_encode( $args ) );
    52                         $this->register_context(
    53                                 array(
    54                                         'event'        => 'search',
    55                                         'display_hash' => $display_hash,
    56                                         'locale'       => determine_locale(),
    57                                         'search_text'  => $term,
    58                                         'query_hash'   => hash( 'sha256', determine_locale() . '|' . $term ),
    59                                         'result_count' => absint( $result_count ),
    60                                         'faq_ids'      => array_slice( array_values( array_unique( array_map( 'absint', $faq_ids ) ) ), 0, 20 ),
    61                                 )
    62                         );
    63                 }
    64 
    65                 public function register_faq( $faq_id, $view ) {
    66 
    67                         $faq_id = absint( $faq_id );
    68 
    69                         if ( ! $faq_id ) {
    70                                 return; }
    71 
    72                         $display_hash = hash( 'sha256', get_queried_object_id() . '|faq|' . $faq_id );
    73 
    74                         foreach ( array( 'open', 'helpful_yes', 'helpful_no' ) as $event ) {
    75 
    76                                 $this->register_context(
    77                                         array(
    78                                                 'event'        => $event,
    79                                                 'display_hash' => $display_hash,
    80                                                 'locale'       => determine_locale(),
    81                                                 'faq_id'       => $faq_id,
    82                                                 'search_text'  => ! empty( $view->search_string ) ? $view->search_string : '',
    83                                                 'query_hash'   => ! empty( $view->search_string ) ? hash( 'sha256', determine_locale() . '|' . $view->search_string ) : '',
    84                                         )
    85                                 );
    86                         }
    87                 }
    88 
    89                 private function register_context( $payload ) {
    90 
    91                         if ( count( $this->contexts ) >= 100 ) {
    92                                 return; }
    93 
    94                         $token    = apply_filters( 'ewd_ufaq_analytics_sign_event_context', '', $payload );
    95                         $endpoint = apply_filters( 'ewd_ufaq_analytics_endpoint', '' );
    96 
    97                         if ( ! is_string( $token ) || '' === $token || ! is_string( $endpoint ) || '' === $endpoint ) {
    98                                 return; }
    99 
    100                         $storage_key = substr( hash( 'sha256', $payload['event'] . '|' . ( isset( $payload['faq_id'] ) ? absint( $payload['faq_id'] ) : 0 ) . '|' . ( isset( $payload['query_hash'] ) ? $payload['query_hash'] : '' ) . '|' . $payload['display_hash'] ), 0, 32 );
    101                         foreach ( $this->contexts as $existing ) {
    102                                 if ( $existing['storage_key'] === $storage_key ) {
    103                                         return; }
    104                         }
    105 
    106                         $this->contexts[] = array(
    107                                 'event'       => $payload['event'],
    108                                 'faq_id'      => isset( $payload['faq_id'] ) ? absint( $payload['faq_id'] ) : 0,
    109                                 'token'       => $token,
    110                                 'storage_key' => $storage_key,
    111                         );
    112 
    113                         if ( ! $this->assets_enqueued ) {
    114 
    115                                 wp_enqueue_script( 'ewd-ufaq-analytics', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-analytics.js', array(), EWD_UFAQ_VERSION, true );
    116                                 $this->assets_enqueued = true;
    117                         }
    118                 }
    119 
    120                 public function print_contexts() {
    121 
    122                         if ( empty( $this->contexts ) ) {
    123                                 return; }
    124 
    125                         wp_add_inline_script(
    126                                 'ewd-ufaq-analytics',
    127                                 'window.ewdUfaqAnalytics=' . wp_json_encode(
    128                                         array(
    129                                                 'endpoint' => apply_filters( 'ewd_ufaq_analytics_endpoint', '' ),
    130                                                 'contexts' => $this->contexts,
    131                                         )
    132                                 ) . ';',
    133                                 'before'
    134                         );
    135                 }
     2/** Compatibility facade. Core render/search events do not collect analytics in Free. */
     3if ( ! defined( 'ABSPATH' ) ) { exit; }
     4class ewdufaqAnalyticsBridge {
     5        public function __construct() {}
     6        public function advanced_search_context( $context, $term, $count, $args ) {
     7                return class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ? ewdufaqEWDPHAnalyticsBridge::instance()->advanced_search_context( $context, $term, $count, $args ) : $context;
     8        }
     9        public function register_search( $identity, $term, $count, $args, $ids = array() ) {
     10                if ( class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ) { ewdufaqEWDPHAnalyticsBridge::instance()->register_search( $identity, $term, $count, $args, $ids ); }
     11        }
     12        public function register_faq( $id, $view ) {
     13                if ( class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ) { ewdufaqEWDPHAnalyticsBridge::instance()->register_faq( $id, $view ); }
     14        }
     15        public function print_contexts() {
     16                if ( class_exists( 'ewdufaqEWDPHAnalyticsBridge', false ) ) { ewdufaqEWDPHAnalyticsBridge::instance()->print_contexts(); }
    13617        }
    13718}
  • ultimate-faqs/trunk/includes/Blocks.class.php

    r3744649 r3821169  
    131131                        wp_enqueue_style( 'ewd-ufaq-css' );
    132132                        wp_enqueue_style( 'ewd-ufaq-blocks-css' );
    133                         wp_enqueue_style( 'ewd-ufaq-rrssb' );
    134                         wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
    135                         if ( 'minimalist' === $ewd_ufaq_controller->settings->get_setting( 'display-style' ) ) {
    136                                 wp_enqueue_style( 'ewd-ufaq-minimalist' );
     133                        $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : null;
     134                        if ( $screen && ( $screen->is_block_editor() || 'widgets' === $screen->id ) ) {
     135                                wp_enqueue_script( 'ewd-ufaq-js' );
     136                                $args = array( 'nonce' => wp_create_nonce( 'ewd-ufaq-js' ), 'faq_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ), 'category_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ), 'faq_scroll' => false );
     137                                wp_add_inline_script( 'ewd-ufaq-js', 'window.ajaxurl=' . wp_json_encode( admin_url( 'admin-ajax.php' ) ) . ';window.ewd_ufaq_php_data=' . wp_json_encode( apply_filters( 'ewd_ufaq_js_localize_data', $args, null ) ) . ';', 'before' );
    137138                        }
    138139                }
  • ultimate-faqs/trunk/includes/CustomPostTypes.class.php

    r3704732 r3821169  
    3737
    3838                // Possibly notify FAQ submitted if user-submitted
    39                 add_action( 'pre_post_update',  array( $this, 'maybe_notify_author_on_update' ), 10, 2 );
    4039
    4140                // Sort taxonomy tables by custom ordering, if no other ordering set
    … …  
    215214                $faq_author = $faq_author ? $faq_author : $user->display_name;
    216215
    217 
    218                 $up_votes = get_post_meta( $post->ID, 'FAQ_Up_Votes', true );
    219                 $down_votes = get_post_meta( $post->ID, 'FAQ_Down_Votes', true );
    220 
    221216                ?>
    222217       
    … …  
    230225                </div>
    231226
    232                 <?php if ( $ewd_ufaq_controller->settings->get_setting( 'faq-ratings' ) ) { ?>
    233 
    234                         <div class='ewd-ufaq-meta-field'>
    235                                 <label class='ewd-ufaq-meta-label' for='review_karma'>
    236                                         <?php _e( 'Up Votes:', 'ultimate-faqs' ); ?>
    237                                 </label>
    238                                 <input type='text' id='ewd-ufaq-review-karma' name='up_votes' value='<?php echo esc_attr( $up_votes ); ?>' size='25' />
    239                                 <label class='ewd-ufaq-meta-label' for='review_karma'>
    240                                         <?php _e( 'Down Votes:', 'ultimate-faqs' ); ?>
    241                                 </label>
    242                                 <input type='text' id='ewd-ufaq-review-karma' name='down_votes' value='<?php echo esc_attr( $down_votes ); ?>' size='25' />
    243                         </div>
    244 
    245                 <?php } ?>
    246 
    247                 <?php $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) ); ?>
    248 
    249                 <?php foreach ( $custom_fields as $faq_field ) { ?>
    250 
    251                         <?php $field_value = get_post_meta( $post->ID, "Custom_Field_" . $faq_field->id, true ); ?>
    252 
    253                         <div class='ewd-ufaq-meta-field'>
    254                                 <label class='ewd-ufaq-score-label' for='<?php echo esc_attr( $faq_field->name ); ?>'>
    255                                         <?php echo esc_html( $faq_field->name ) ?>
    256                                 </label>
    257 
    258                                         <?php $options = explode( ',', $faq_field->options ); ?>
    259 
    260                                         <?php if ( $faq_field->type == 'textarea' ) { ?>
    261        
    262                                                         <textarea id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>'>
    263                                                                 <?php echo esc_html( $field_value ); ?>
    264                                                         </textarea>
    265        
    266                                         <?php } elseif ( $faq_field->type == 'select' ) { ?>
    267                                                 <?php if ( ! empty( $options ) ) { ?>
    268        
    269                                                         <select name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>'>
    270                                                                 <?php foreach ( $options as $option ) { ?>
    271        
    272                                                                         <option value='<?php echo esc_attr( $option ); ?>' <?php echo ( $option == $field_value ? 'selected' : '' ); ?> >
    273                                                                                 <?php echo esc_html( $option ); ?>
    274                                                                         </option>
    275                                                                 <?php } ?>
    276                                                         </select>
    277        
    278                                                 <?php } ?>
    279                                         <?php } elseif ( $faq_field->type == 'checkbox' ) { ?>
    280                                                 <?php $field_value = is_array( $field_value ) ? $field_value : array(); ?>
    281                                                 <?php if ( ! empty( $options ) ) { ?>
    282        
    283                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-container'>
    284                                                                 <?php foreach ( $options as $option ) { ?>
    285        
    286                                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-each'>
    287                                                                                 <input type='checkbox' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>[]' value='<?php echo esc_attr( $option ); ?>' <?php echo ( in_array( $option, $field_value ) ? 'checked' : '' ); ?> />
    288                                                                                 <?php echo esc_html( $option ); ?>
    289                                                                         </div>
    290                                                                 <?php } ?>
    291                                                         </div>
    292        
    293                                                 <?php } ?>
    294                                         <?php } elseif ( $faq_field->type == 'radio' ) { ?>
    295                                                 <?php if ( ! empty( $options ) ) { ?>
    296        
    297                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-container'>
    298                                                                 <?php foreach ( $options as $option ) { ?>
    299        
    300                                                                         <div class='ewd-ufaq-fields-page-radio-checkbox-each'>
    301                                                                                 <input type='radio' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $option ); ?>' <?php echo ( $option == $field_value ? 'checked' : '' ); ?> />
    302                                                                                 <?php echo esc_html( $option ); ?>
    303                                                                         </div>
    304                                                                 <?php } ?>
    305                                                         </div>
    306        
    307                                                 <?php } ?>
    308                                         <?php } elseif ( $faq_field->type == 'date' ) { ?>
    309        
    310                                                 <input type='date' class='ewd-ufaq-jquery-datepicker' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' />
    311        
    312                                         <?php } elseif ( $faq_field->type == 'datetime' ) { ?>
    313        
    314                                                 <input type='datetime-local' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' />
    315                                        
    316                                         <?php } elseif ( $faq_field->type == 'file' ) { ?>
    317 
    318                                                 <div class='ewd-ufaq-fields-page-file-preview'>
    319 
    320                                                         <span>
    321                                                                 <?php _e( 'Current File:',  'ultimate-faqs' ); ?> <?php echo ! empty( $field_value ) ? esc_html( basename( $field_value ) ) : ''; ?>
    322                                                         </span>
    323 
    324                                                 </div>
    325 
    326                                                 <input type='file' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' />
    327 
    328                                         <?php } else { ?>
    329        
    330                                                 <input type='text' id='ewd-ufaq-<?php echo esc_attr( $faq_field->name ); ?>' name='EWD_UFAQ_Custom_Field_<?php echo esc_attr( $faq_field->id ); ?>' value='<?php echo esc_attr( $field_value ); ?>' size='25' />
    331        
    332                                         <?php } ?>
    333 
    334                                 </div>
    335 
    336                         <?php
    337                         }
    338                 }
     227                <?php do_action( 'ewd_ufaq_admin_meta_fields', $post );
     228        }
    339229
    340230        /**
    … …  
    357247        public function save_meta( $post_id ) {
    358248                global $ewd_ufaq_controller;
     249                if ( EWD_UFAQ_FAQ_POST_TYPE !== get_post_type( $post_id ) ) { return $post_id; }
    359250
    360251                // Verify nonce
    … …  
    376267                        return $post_id;
    377268                }
    378 
    379                 if ( ! get_post_meta( $post_id, 'ufaq_order', true ) ) { update_post_meta( $post_id, 'ufaq_order', 9999 ); }
    380 
    381                 if ( isset( $_POST['faq_author'] ) )    { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
    382                 if ( isset( $_POST['up_votes'] ) )              { update_post_meta( $post_id, 'FAQ_Up_Votes', sanitize_text_field( $_POST['up_votes'] ) ); }
    383                 if ( isset( $_POST['down_votes'] ) )    { update_post_meta( $post_id, 'FAQ_Down_Votes', sanitize_text_field( $_POST['down_votes'] ) ); }
    384 
    385                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    386 
    387                 foreach ( $custom_fields as $faq_field ) {
    388                        
    389                         $input_name = 'EWD_UFAQ_Custom_Field_' . $faq_field->id;
    390 
    391                         if ( $faq_field->type == 'file' ) {
    392 
    393                                 if ( empty( $_FILES[ $input_name ]['name'] ) ) { continue; }
    394 
    395                                 $uploaded_file = wp_handle_upload( $_FILES[ $input_name ], array( 'test_form' => false ) );
    396                                 $field_value = $uploaded_file['url'];
    397                         }
    398                         elseif ( $faq_field->type == 'checkbox' ) {
    399 
    400                                 $field_value = ( isset( $_POST[ $input_name ] ) and is_array( $_POST[ $input_name ] ) ) ? array_map( 'sanitize_text_field', $_POST[ $input_name ] ) : array();
    401                         }
    402                         else {
    403                                
    404                                 $field_value = sanitize_text_field( $_POST[ $input_name ] );
    405                         }
    406 
    407                         update_post_meta( $post_id, 'Custom_Field_' . $faq_field->id, $field_value );
    408                 }
     269if ( isset( $_POST['faq_author'] ) )    { update_post_meta( $post_id, 'EWD_UFAQ_Post_Author', sanitize_text_field( $_POST['faq_author'] ) ); }
     270                do_action( 'ewd_ufaq_save_admin_fields', $post_id );
    409271        }
    410272
    … …  
    613475         */
    614476        public function sort_categories_by_order( $clauses, $taxonomies ) {
    615                 global $wpdb;
    616 
    617                 if ( ! in_array( EWD_UFAQ_FAQ_CATEGORY_TAXONOMY, $taxonomies ) ) { return $clauses; }
    618                 if ( ! empty( $clauses['orderby'] ) and $clauses['orderby'] != 'ORDER BY t.name' ) { return $clauses; }
    619 
    620                 $clauses['join'] .= ' INNER JOIN ' . $wpdb->prefix . 'termmeta AS tm ON t.term_id = tm.term_id';
    621 
    622                 $clauses['where'] .= ' AND tm.meta_key = "ufaq_category_order"';
    623 
    624                 $clauses['orderby'] = 'ORDER BY tm.meta_value+0';
    625 
    626                 return $clauses;
     477                return class_exists( 'ewdufaqEWDPHOrdering', false ) ? ewdufaqEWDPHOrdering::sort_categories_by_order( $clauses, $taxonomies ) : $clauses;
    627478        }
    628479
    … …  
    632483         */
    633484        public function maybe_notify_author_on_update( $post_id, $data ) {
    634                 global $ewd_ufaq_controller;
    635 
    636                 if ( get_post_type( $post_id ) != EWD_UFAQ_FAQ_POST_TYPE ) { return; }
    637 
    638                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'submit-faq-updates' ) ) ) { return; }
    639 
    640                 remove_action( 'pre_post_update',       array( $this, 'maybe_notify_author_on_update' ) );
    641 
    642                 $post = get_post( $post_id );
    643 
    644                 if ( $ewd_ufaq_controller->settings->get_setting( 'submit-faq-updates' ) == 'first_answer' and ! empty( $post->post_content ) ) { return; }
    645                
    646                 $faq = new ewdufaqFAQ();
    647 
    648                 $faq->load_post( $post );
    649 
    650                 $ewd_ufaq_controller->notifications->user_question_updated( $faq );
     485                if ( class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ) { return ewdufaqEWDPHSubmissionNotifications::maybe_notify_author_on_update( $post_id, $data ); }
    651486        }
    652487}
  • ultimate-faqs/trunk/includes/EditorFAQWorkflow.class.php

    r3744649 r3821169  
    212212
    213213                                $this->send_error( 'create_failed', __( 'WordPress did not publish the new FAQ.', 'ultimate-faqs' ), 500 );
    214                         }
    215 
    216                         if ( false === update_post_meta( $post_id, 'ufaq_order', 9999 ) ) {
    217 
    218                                 wp_delete_post( $post_id, true );
    219                                 $this->send_error( 'create_failed', __( 'The new FAQ could not be initialized for display.', 'ultimate-faqs' ), 500 );
    220214                        }
    221215
  • ultimate-faqs/trunk/includes/FAQ.class.php

    r3744649 r3821169  
    6767                }
    6868
    69                 if ( get_class( $post ) == 'WP_Post' && $post->post_type == EWD_UFAQ_FAQ_POST_TYPE ) {
     69                if ( $post instanceof WP_Post && $post->post_type == EWD_UFAQ_FAQ_POST_TYPE ) {
    7070                        $this->load_wp_post( $post );
    7171                        return true;
    … …  
    148148         * @since 2.0.0
    149149         */
    150         public function insert_faq() {
    151                         global $ewd_ufaq_controller;
    152                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'submit-faq' ) ) {
    153                                 return false;
    154                         }
    155 
    156                 // Check if this request has already been processed. If multiple forms
    157                 // exist on the same page, this prevents a single submission from
    158                 // being added twice.
    159                 if ( $this->faq_processed === true ) {
    160                         return true;
    161                 }
    162 
    163                 $this->faq_processed = true;
    164 
    165                 if ( empty( $this->ID ) ) {
    166                         $action = 'insert';
    167                 } else {
    168                         $action = 'update';
    169                 }
    170 
    171                 $this->validate_submission();
    172                 if ( $this->is_valid_submission() === false ) {
    173                         return false;
    174                 }
    175 
    176                 if ( $this->insert_post_data() === false ) {
    177                         return false;
    178                 } else {
    179                         $this->faq_inserted = true;
    180                 }
    181 
    182                 do_action( 'ewd_ufaq_' . $action . '_faq', $this );
    183 
    184                 return true;
     150        public function insert_faq()  {
     151                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_faq( $this ) : false;
    185152        }
    186153
    … …  
    189156         * @since 2.0.0
    190157         */
    191         public function validate_submission() {
    192                 global $ewd_ufaq_controller;
    193 
    194                 $this->validation_errors = array();
    195 
    196                 // NONCE Validation
    197                 if ( ! isset( $_POST['ewd_ufaq_nonce'] ) || ! wp_verify_nonce( $_POST['ewd_ufaq_nonce'], 'ewd_ufaq_nonce_value' ) ) {
    198 
    199                         $this->validation_errors[] = array(
    200                                 'field'         => 'nonce',
    201                                 'error_msg'     => 'Invalid Nonce',
    202                                 'message'       => __( 'Please refresh the page and try submitting again.', 'ultimate-faqs' ),
    203                         );
    204 
    205                         return false; // End early if nonce validation fails
    206                 }
    207 
    208                 // USER-SUBMITTED FLAG
    209                 if ( isset( $_POST['user_submitted'] ) and ! empty( $_POST['user_submitted'] ) ) {
    210 
    211                         $this->user_submitted = true;
    212                 }
    213 
    214                 // CAPTCHA
    215                 if ( $ewd_ufaq_controller->settings->get_setting( 'submit-question-captcha' ) ) {
    216                        
    217                         $modified_code = intval( $_POST['ewd_ufaq_modified_captcha'] );
    218                         $user_code = intval( $_POST['ewd_ufaq_captcha'] );
    219 
    220                         if ( empty( $user_code ) ) {
    221 
    222                                 $this->validation_errors[] = array(
    223                                         'field'         => 'captcha',
    224                                         'error_msg'     => 'Captcha incorrect',
    225                                         'message'       => $ewd_ufaq_controller->settings->get_setting( 'label-captcha-empty' ),
    226                                 );
    227                         }
    228                         elseif ( $user_code != $this->decrypt_modified_code( $modified_code ) ) {
    229 
    230                                 $this->validation_errors[] = array(
    231                                         'field'         => 'captcha',
    232                                         'error_msg'     => 'Captcha incorrect',
    233                                         'message'       => $ewd_ufaq_controller->settings->get_setting( 'label-captcha-incorrect' ),
    234                                 );
    235                         }
    236                 }
    237 
    238                 // QUESTION
    239                 $this->question = empty( $_POST['faq_question'] ) ? false : sanitize_text_field( $_POST['faq_question'] );
    240                
    241                 if ( ! $this->question ) {
    242 
    243                         $this->validation_errors[] = array(
    244                                 'field'         => 'faq_question',
    245                                 'error_msg'     => 'Question is blank',
    246                                 'message'       => $ewd_ufaq_controller->settings->get_setting( 'label-no-question-title-entered' ),
    247                         );
    248                 }
    249 
    250                 // AUTHOR
    251                 $this->faq_author = empty( $_POST['post_author'] ) ? false : sanitize_text_field( $_POST['post_author'] );
    252 
    253                 // AUTHOR EMAIL
    254                 $this->faq_author_email = empty( $_POST['post_author_email'] ) ? false : sanitize_email( $_POST['post_author_email'] );
    255 
    256                 // ANSWER
    257                 if ( $ewd_ufaq_controller->settings->get_setting( 'allow-proposed-answer' ) ) {
    258 
    259                         $this->answer = empty( $_POST['faq_answer'] ) ? false : sanitize_textarea_field( $_POST['faq_answer'] );
    260                 }
    261 
    262                 // CATEGORY
    263                 if ( $ewd_ufaq_controller->settings->get_setting( 'submitted-default-category' ) ) {
    264 
    265                         $args = array(
    266                                 'taxonomy'              => EWD_UFAQ_FAQ_CATEGORY_TAXONOMY,
    267                                 'hide_empty'    => false,
    268                                 'slug'                  => $ewd_ufaq_controller->settings->get_setting( 'submitted-default-category' )
    269                         );
    270 
    271                         $this->categories = get_terms( $args );
    272                 }
    273 
    274                 // CUSTOM FIELDS
    275                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    276 
    277                 foreach ( $custom_fields as $custom_field ) {
    278 
    279                         if ( ! $custom_field->id ) { continue; }
    280 
    281                         $input_name = 'ewd_ufaq_custom_field_' . $custom_field->id;
    282 
    283                         if ( $custom_field->type == 'checkbox' ) {
    284 
    285                                 $checkbox_values = ( empty( $_POST[ $input_name ] ) or ! is_array( $_POST[ $input_name ] ) ) ? array() : $_POST[ $input_name ];
    286 
    287                                 $this->custom_fields[ $custom_field->id ] =  array_map( 'sanitize_text_field', $checkbox_values );
    288                         }
    289                         else { $this->custom_fields[ $custom_field->id ] = empty( $_POST[ $input_name ] ) ? false : sanitize_text_field( $_POST[ $input_name ] ); }
    290                 }
    291                
    292                 $this->post_status = 'draft';
    293 
    294                 do_action( 'ewd_ufaq_validate_faq_submission', $this );
     158        public function validate_submission()  {
     159                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::validate_submission( $this ) : false;
    295160        }
    296161
    … …  
    299164         * @since 2.0.0
    300165         */
    301         public function decrypt_modified_code( $user_code ) {
    302 
    303                 $decrypted_code = ($user_code / 3) - 5;
    304 
    305                 return $decrypted_code;
     166        public function decrypt_modified_code( $user_code )  {
     167                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::decrypt_modified_code( $this, $user_code ) : false;
    306168        }
    307169
    … …  
    311173         * @since 2.0.0
    312174         */
    313         public function is_valid_submission() {
    314 
    315                 if ( !count( $this->validation_errors ) ) {
    316                         return true;
    317                 }
    318 
    319                 return false;
     175        public function is_valid_submission()  {
     176                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::is_valid_submission( $this ) : false;
    320177        }
    321178
    … …  
    324181         * @since 2.0.0
    325182         */
    326         public function insert_post_data() {
    327                         global $ewd_ufaq_controller;
    328                         if ( ! $ewd_ufaq_controller->permissions->check_permission( 'submit-faq' ) ) {
    329                                 return false;
    330                         }
    331 
    332                 $args = array(
    333                         'post_type'             => EWD_UFAQ_FAQ_POST_TYPE,
    334                         'post_title'    => $this->question,
    335                         'post_content'  => ! empty( $this->answer ) ? $this->answer : '',
    336                         'post_status'   => $this->post_status,
    337                 );
    338 
    339                 if ( ! empty( $this->ID ) ) {
    340                         $args['ID'] = $this->ID;
    341                 }
    342 
    343                 $args = apply_filters( 'ewd_ufaq_insert_faq_data', $args, $this );
    344 
    345                 // When updating a FAQ, we need to update the metadata first, so that
    346                 // notifications hooked to the status changes go out with the new metadata.
    347                 // If we're inserting a new FAQ, we have to insert it before we can
    348                 // add metadata, and the default notifications don't fire until it's all done.
    349                 if ( ! empty( $this->ID ) ) {
    350 
    351                         $this->insert_post_meta();
    352                         $this->insert_post_categories();
    353                         $id = wp_insert_post( $args );
    354                 } else {
    355 
    356                         $id = wp_insert_post( $args );
    357                         if ( $id && ! is_wp_error( $id ) ) {
    358                                 $this->ID = $id;
    359                                 $this->insert_post_meta();
    360                                 $this->insert_post_categories();
    361 
    362                                 $this->clear_post_submission();
    363                         }
    364                 }
    365 
    366                 return ! is_wp_error( $id ) && $id !== false;
     183        public function insert_post_data()  {
     184                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_post_data( $this ) : false;
    367185        }
    368186
    … …  
    371189         * @since 2.0.0
    372190         */
    373         public function insert_post_meta() {
    374                 global $ewd_ufaq_controller;
    375 
    376                 $meta = array();
    377 
    378                 if ( ! empty( $this->faq_author ) ) {
    379 
    380                         update_post_meta( $this->ID, 'EWD_UFAQ_Post_Author', $this->faq_author );
    381                 }
    382 
    383                 if ( ! empty( $this->faq_author_email ) ) {
    384                        
    385                         update_post_meta( $this->ID, 'EWD_UFAQ_Post_Author_Email', $this->faq_author_email );
    386                 }
    387 
    388                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    389 
    390                 foreach ( $custom_fields as $custom_field ) {
    391 
    392                         if ( ! empty( $this->custom_fields[ $custom_field->id ] ) ) {
    393 
    394                                 update_post_meta( $this->ID, 'Custom_Field_' . $custom_field->id, $this->custom_fields[ $custom_field->id ] );
    395                         }
    396                 }
     191        public function insert_post_meta()  {
     192                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_post_meta( $this ) : false;
    397193        }
    398194
    … …  
    401197         * @since 2.0.0
    402198         */
    403         public function insert_post_categories() {
    404 
    405                 if ( empty( $this->categories ) or ! is_array( $this->categories ) ) { return; }
    406 
    407                 $submit_categories = array();
    408                 foreach ( $this->categories as $category ) { $submit_categories[] = $category->term_id; }
    409 
    410                 wp_set_object_terms( $this->ID, $submit_categories, EWD_UFAQ_FAQ_CATEGORY_TAXONOMY );
     199        public function insert_post_categories()  {
     200                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::insert_post_categories( $this ) : false;
    411201        }
    412202
    … …  
    415205         * @since 2.0.0
    416206         */
    417         public function clear_post_submission() {
    418                 global $ewd_ufaq_controller;
    419 
    420                 unset( $_POST['faq_question'] );
    421                 unset( $_POST['faq_answer'] );
    422                 unset( $_POST['post_author'] );
    423                 unset( $_POST['post_author_email'] );
    424 
    425                 $custom_fields = ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    426 
    427                 foreach ( $custom_fields as $custom_field ) {
    428 
    429                         unset( $_POST[ 'ewd_ufaq_custom_field_' . $custom_field->id ] );
    430                 }
     207        public function clear_post_submission()  {
     208                return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::clear_post_submission( $this ) : null;
    431209        }
    432210
  • ultimate-faqs/trunk/includes/HelperCompatibility.class.php

    r3744649 r3821169  
    1818                        add_action( 'plugins_loaded', array( $this, 'refresh' ), 100 );
    1919                        add_action( 'admin_notices', array( $this, 'display_admin_notice' ) );
     20                        add_action( 'admin_notices', array( $this, 'display_obsolete_package_notice' ) );
    2021
    2122                        $this->refresh();
     23                }
     24                /** Detect known remnants only; never execute or automatically delete customer files. */
     25                public function display_obsolete_package_notice() {
     26                        if ( ! current_user_can( 'manage_options' ) || ! function_exists( 'get_current_screen' ) ) { return; }
     27                        $screen = get_current_screen();
     28                        if ( ! $screen || ( 'plugins' !== $screen->id && EWD_UFAQ_FAQ_POST_TYPE !== $screen->post_type && false === strpos( $screen->id, 'ewd-ufaq' ) ) ) { return; }
     29                        foreach ( array( 'includes/WooCommerce.class.php', 'includes/WPForms.class.php', 'includes/OrderingTable.class.php', 'views/View.SubmitFAQ.class.php', 'lib/PHPSpreadsheet/vendor/autoload.php', 'lib/FPDF/fpdf.php', 'assets/js/ewd-ufaq-analytics.js', 'assets/js/ewd-ufaq-wc-admin.js', 'assets/css/ewd-ufaq-minimalist.css', 'assets/css/jquery-ui.min.css', 'ewd-ufaq-templates/faq-ratings.php', 'ewd-ufaq-templates/submit-faq.php' ) as $file ) {
     30                                if ( is_file( EWD_UFAQ_PLUGIN_DIR . '/' . $file ) ) {
     31                                        echo '<div class="notice notice-warning"><p>' . esc_html__( 'Ultimate FAQs contains obsolete files from an earlier version. Back up the site, then replace the complete ultimate-faqs plugin directory with the approved release ZIP instead of merging files. Keep uploads and theme overrides. Ask your host to reset its PHP opcode cache if necessary. No files have been deleted automatically.', 'ultimate-faqs' ) . '</p></div>';
     32                                        return;
     33                                }
     34                        }
    2235                }
    2336
    … …  
    8699                                return array( 'state' => 'active_legacy_no_descriptor' );
    87100                        }
     101                        foreach ( array( 'api_version', 'supported_free_api_min', 'supported_free_api_max', 'entitlement_contract_version' ) as $field ) {
     102                                if ( ! isset( $helper_descriptor[ $field ] ) || ! is_int( $helper_descriptor[ $field ] ) || $helper_descriptor[ $field ] < 1 ) {
     103                                        return array( 'state' => 'unsupported_entitlement_contract' );
     104                                }
     105                        }
     106                        if ( ! isset( $helper_descriptor['plugin_version'] ) || ! is_string( $helper_descriptor['plugin_version'] )
     107                                || ! preg_match( '/^[0-9]+\.[0-9]+\.[0-9]+(?:[-+][A-Za-z0-9.-]+)?$/', $helper_descriptor['plugin_version'] )
     108                                || $helper_descriptor['supported_free_api_min'] > $helper_descriptor['supported_free_api_max'] ) {
     109                                return array( 'state' => 'unsupported_entitlement_contract' );
     110                        }
    88111
    89112                        $helper_version = isset( $helper_descriptor['plugin_version'] ) ? $helper_descriptor['plugin_version'] : '0';
  • ultimate-faqs/trunk/includes/Notifications.class.php

    r3744649 r3821169  
    1313        public function __construct() {
    1414               
    15                 add_action( 'ewd_ufaq_insert_faq', array( $this, 'admin_notification_email' ) );
    16                 add_action( 'ewd_ufaq_insert_faq', array( $this, 'user_submission_email' ) );
     15                // Public compatibility facade; Helper owns paid mail hooks and implementation.
    1716        }
    1817
    … …  
    2221         * @since 2.0.0
    2322         */
    24         public function admin_notification_email( $faq ) {
    25                 global $ewd_ufaq_controller;
    26 
    27                 if ( ! $ewd_ufaq_controller->settings->get_setting( 'admin-question-notification' ) ) { return; }
    28 
    29                 $admin_emails = $ewd_ufaq_controller->settings->get_setting( 'admin-notification-email' ) ? explode( ',', $ewd_ufaq_controller->settings->get_setting( 'admin-notification-email' ) ) : (array) get_option( 'admin_email' );
    30        
    31                 $faq_link = site_url() . '/wp-admin/post.php?post=' . $faq->ID . '&action=edit';
    32        
    33                 $subject_line = __( 'New Question Received', 'ultimate-faqs' );
    34        
    35                 $message_body = __( 'Hello Admin,', 'ultimate-faqs' ) . '<br/><br/>';
    36                 $message_body .= __( 'You\'ve received a new question titled ', 'ultimate-faqs' ) . $faq->question . '.<br/><br/>';
    37                
    38                 if ( ! empty( $faq->answer ) ) {
    39 
    40                         $message_body .= __( 'The answer reads:<br>', 'ultimate-faqs' );
    41                         $message_body .= esc_html( $faq->answer ) . '<br><br><br>';
    42                 }
    43                
    44                 $message_body .= __( 'You can view the question in the admin area by going to the following link:<br>', 'ultimate-faqs' );
    45                 $message_body .= '<a href=\'' . $faq_link . '\'>' . __( 'See the FAQ', 'ultimate-faqs' ) . '</a><br/><br/>';
    46                 $message_body .= __( 'Have a great day,', 'ultimate-faqs' ) . '<br/><br/>';
    47                 $message_body .= __( 'Ultimate FAQs Team', 'ultimate-faqs' );
    48        
    49                 $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    50 
    51                         $success = false;
    52                 foreach ( $admin_emails as $admin_email ) {
    53 
    54                         $success = wp_mail( $admin_email, $subject_line, $message_body, $headers );
    55                 }
    56 
    57                 return $success;
     23        public function admin_notification_email( $faq )  {
     24                return class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ? ewdufaqEWDPHSubmissionNotifications::admin_notification_email( $this, $faq ) : false;
    5825        }
    5926
    … …  
    6330         * @since 2.0.0
    6431         */
    65         public function user_submission_email( $faq ) {
    66                 global $ewd_ufaq_controller;
    67 
    68                 if ( ! $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ) ) { return; }
    69 
    70                 $params = array(
    71                         'email_id' => $ewd_ufaq_controller->settings->get_setting( 'submit-faq-email' ),
    72                         'email_address' => $faq->faq_author_email,
    73                         'post_id' => $faq->ID
    74                 );
    75                
    76                 if ( function_exists( 'ewd_uwpm_send_email' ) ) {
    77                          
    78                         ewd_uwpm_send_email( $params );
    79                 }
    80                 else {
    81 
    82                         $author_emails = $faq->faq_author_email ? explode( ',', $faq->faq_author_email ) : array();
    83        
    84                         $subject_line = apply_filters( 'ewd_ufaq_user_question_submitted_subject_line', __( 'New Question', 'ultimate-faqs' ) );
    85 
    86                         $message_body = __( 'Hello,', 'ultimate-faqs' ) . '<br/><br/>';
    87                         $message_body .= sprintf( __( 'Thank you for submitting your FAQ, %s. ', 'ultimate-faqs' ), $faq->question ) . '<br/><br/>';
    88                         $message_body .= get_bloginfo( 'name' );
    89 
    90                         $message_body = apply_filters( 'ewd_ufaq_user_question_submitted_message_body', $message_body );
    91 
    92                         $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    93 
    94                                 $success = false;
    95                         foreach ( $author_emails as $author_email ) {
    96 
    97                                 if ( ! filter_var( $author_email, FILTER_VALIDATE_EMAIL ) ) { continue;}
    98 
    99                                 $success = wp_mail( $author_email, $subject_line, $message_body, $headers );
    100                         }
    101 
    102                         return $success;
    103                 }
     32        public function user_submission_email( $faq )  {
     33                return class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ? ewdufaqEWDPHSubmissionNotifications::user_submission_email( $this, $faq ) : false;
    10434        }
    10535
    … …  
    10939         * @since 2.4.0
    11040         */
    111         public function user_question_updated( $faq ) {
    112 
    113                 $author_emails = $faq->faq_author_email ? explode( ',', $faq->faq_author_email ) : array();
    114        
    115                 $subject_line = apply_filters( 'ewd_ufaq_user_question_answered_subject_line', __( 'New Question Answer', 'ultimate-faqs' ) );
    116        
    117                 $message_body = __( 'Hello,', 'ultimate-faqs' ) . '<br/><br/>';
    118                 $message_body .= sprintf( __( 'Your FAQ, %s, has received a new question answer: ', 'ultimate-faqs' ), $faq->question ) . '<br/><br/>' . $faq->answer . '<br/><br/>';
    119                 $message_body .= __( 'Thank You,', 'ultimate-faqs' ) . '<br/><br/>';
    120 
    121                 $message_body = apply_filters( 'ewd_ufaq_user_question_answered_message_body', $message_body, $faq );
    122 
    123                 $headers = array( 'Content-Type: text/html; charset=UTF-8' );
    124 
    125                         $success = false;
    126                 foreach ( $author_emails as $author_email ) {
    127 
    128                         if ( ! filter_var( $author_email, FILTER_VALIDATE_EMAIL ) ) { continue;}
    129 
    130                         $success = wp_mail( $author_email, $subject_line, $message_body, $headers );
    131                 }
    132 
    133                 return $success;
     41        public function user_question_updated( $faq )  {
     42                return class_exists( 'ewdufaqEWDPHSubmissionNotifications', false ) ? ewdufaqEWDPHSubmissionNotifications::user_question_updated( $this, $faq ) : false;
    13443        }
    13544}
  • ultimate-faqs/trunk/includes/Permissions.class.php

    r3744649 r3821169  
    125125                        if ( 'faq-order-by' === $setting && 'set_order' === $value ) {
    126126                                $capability = 'ordering'; }
     127                        if ( 'category-order-by' === $setting && 'manual' === $value ) {
     128                                $capability = 'ordering'; }
    127129                        return '' !== $capability && ! $this->check_permission( $capability ) ? $fallback : $value;
    128130                }
  • ultimate-faqs/trunk/includes/Query.class.php

    r3744649 r3821169  
    5656        // Max number of pages of faqs matching the query
    5757        public $max_page;
     58        private $prepared = false;
    5859
    5960        /**
    … …  
    102103
    103104                $args = $this->args;
    104                         if ( isset( $args['orderby'] ) && 'set_order' === $args['orderby']
    105                         && ! $ewd_ufaq_controller->permissions->check_permission( 'ordering' ) ) {
    106                                 $args['orderby'] = 'title';
    107                         }
    108105
    109106                $args['include_children'] = ( ! empty( $args['include_children'] ) and strtolower( $args['include_children'] ) != 'yes' ) ? false : true;
    … …  
    115112                if ( ! empty( $args['faq_page'] ) ) { $args['paged'] = $args['faq_page']; }
    116113
    117                 if ( ! empty( $args['post__in'] ) ) { $args['post__in'] = is_array( $args['post__in'] ) ? $args['post__in'] : json_decode( str_replace( array( '&lsqb;', '&rsqb;' ), array( '[', ']' ) ) ); }
     114                if ( ! empty( $args['post__in'] ) && ! is_array( $args['post__in'] ) ) {
     115                        $decoded_ids = is_string( $args['post__in'] ) ? json_decode( str_replace( array( '&lsqb;', '&rsqb;' ), array( '[', ']' ), $args['post__in'] ), true ) : null;
     116                        $args['post__in'] = is_array( $decoded_ids ) ? array_values( array_filter( array_map( 'absint', array_filter( $decoded_ids, 'is_scalar' ) ) ) ) : array();
     117                }
    118118
    119119                $explicit_post_ids = ! empty( $args['post__in_string'] )
    … …  
    225225                if ( empty( $explicit_post_ids ) && ! empty( $args['orderby'] ) ) {
    226226
    227                         if ( $args['orderby'] == 'rating' or $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
     227                        if ( $args['orderby'] == 'popular' ) { $orderby['meta_value_num'] = $args['order']; }
    228228                        elseif ( $args['orderby'] == 'date' ) { $orderby['date'] = $args['order']; }
    229229                        elseif ( $args['orderby'] == 'title' ) { $orderby['title'] = $args['order']; }
    230                         elseif ( $args['orderby'] == 'set_order' ) { $orderby['meta_value_num'] = $args['order']; }
    231                 }
    232 
    233                 if ( empty( $explicit_post_ids ) && $args['orderby'] == 'rating' ) { $args['meta_key'] = 'FAQ_Total_Score'; }
    234                 elseif ( empty( $explicit_post_ids ) && $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
    235                         elseif ( empty( $explicit_post_ids ) && 'set_order' === $args['orderby'] ) {
    236                                 // Manual ordering must not filter out reusable FAQs which have no rank.
    237                                 $manual_order_query = array(
    238                                         'relation'          => 'OR',
    239                                         'ufaq_manual_order' => array(
    240                                                 'key'     => 'ufaq_order',
    241                                                 'compare' => 'EXISTS',
    242                                                 'type'    => 'NUMERIC',
    243                                         ),
    244                                         'ufaq_unordered'    => array(
    245                                                 'key'     => 'ufaq_order',
    246                                                 'compare' => 'NOT EXISTS',
    247                                         ),
    248                                 );
    249                                 $args['meta_query'] = empty( $args['meta_query'] )
    250                                         ? $manual_order_query
    251                                         : array(
    252                                                 'relation' => 'AND',
    253                                                 $args['meta_query'],
    254                                                 $manual_order_query,
    255                                         );
    256                                 unset( $args['meta_key'], $orderby['meta_value_num'] );
    257                                 $orderby['ufaq_manual_order'] = $args['order'];
    258                                 $orderby['ID']                = $args['order'];
    259                         }
     230                }
     231
     232                if ( empty( $explicit_post_ids ) && isset( $args['orderby'] ) && $args['orderby'] == 'popular' ) { $args['meta_key'] = 'ufaq_view_count'; }
    260233               
    261234                if ( empty( $explicit_post_ids ) && ! empty( $orderby ) ) { $args['orderby'] = $orderby; }
    262235
     236                $args = apply_filters( 'ewd_ufaq_query_args', $args, $this->context, $this );
     237                if ( isset( $args['orderby'] ) && in_array( $args['orderby'], array( 'set_order', 'rating' ), true ) ) { $args['orderby'] = array( 'title' => $args['order'] ); }
    263238                $this->args = $args;
     239                $this->prepared = true;
    264240
    265241                return $this->args;
    … …  
    275251                $args = array();
    276252
    277                 if ( isset( $_REQUEST['faq_page'] ) ) {
     253                if ( isset( $_REQUEST['faq_page'] ) && is_scalar( $_REQUEST['faq_page'] ) ) {
    278254
    279255                        $args['faq_page'] = intval( $_REQUEST['faq_page'] );
    280256                }
    281257
    282                 if ( isset( $_REQUEST['search_string'] ) ) {
    283 
    284                         $args['search_string'] = sanitize_text_field( stripslashes( $_REQUEST['search_string'] ) );
    285                 }
    286 
    287                 if ( isset( $_REQUEST['post_count'] ) ) {
     258                if ( isset( $_REQUEST['search_string'] ) && is_scalar( $_REQUEST['search_string'] ) ) {
     259
     260                        $args['search_string'] = sanitize_text_field( stripslashes( (string) $_REQUEST['search_string'] ) );
     261                }
     262
     263                if ( isset( $_REQUEST['post_count'] ) && is_scalar( $_REQUEST['post_count'] ) ) {
    288264
    289265                        $args['post_count'] = sanitize_text_field( $_REQUEST['post_count'] );
    290266                }
    291267
    292                 if ( isset( $_REQUEST['orderby'] ) ) {
     268                if ( isset( $_REQUEST['orderby'] ) && is_scalar( $_REQUEST['orderby'] ) ) {
    293269
    294270                        $args['orderby'] = sanitize_text_field( $_REQUEST['orderby'] );
    295271                }
    296272
    297                 if ( isset( $_REQUEST['order'] ) ) {
     273                if ( isset( $_REQUEST['order'] ) && is_scalar( $_REQUEST['order'] ) ) {
    298274
    299275                        $args['order'] = sanitize_text_field( $_REQUEST['order'] );
    300276                }
    301277
    302                 if ( isset( $_REQUEST['include_category'] ) ) {
     278                if ( isset( $_REQUEST['include_category'] ) && is_scalar( $_REQUEST['include_category'] ) ) {
    303279
    304280                        $args['include_category'] = sanitize_text_field( $_REQUEST['include_category'] );
    305281                }
    306282
    307                 if ( isset( $_REQUEST['exclude_category'] ) ) {
     283                if ( isset( $_REQUEST['exclude_category'] ) && is_scalar( $_REQUEST['exclude_category'] ) ) {
    308284
    309285                        $args['exclude_category'] = sanitize_text_field( $_REQUEST['exclude_category'] );
    … …  
    315291                }
    316292
    317                 if ( isset( $_REQUEST['include_tag'] ) ) {
     293                if ( isset( $_REQUEST['include_tag'] ) && is_scalar( $_REQUEST['include_tag'] ) ) {
    318294
    319295                        $args['include_tag'] = sanitize_text_field( $_REQUEST['include_tag'] );
    … …  
    326302
    327303                $this->args = array_merge( $this->args, $args );
     304                $this->prepared = false;
    328305        }
    329306
    … …  
    337314                $faqs = array();
    338315
    339                 $args = apply_filters( 'ewd_ufaq_query_args', $this->args, $this->context );
     316                $args = $this->prepared ? $this->args : $this->prepare_args();
    340317               
    341318                $query = new WP_Query( $args );
  • ultimate-faqs/trunk/includes/Settings.class.php

    r3744649 r3821169  
    9696                        $raw      = ! empty( $this->settings ) ? $this->settings : get_option( 'ewd-ufaq-settings', array() );
    9797                        if ( 'faq-order-by' === $setting && isset( $raw[ $setting ] ) && 'set_order' === $raw[ $setting ] ) {
     98                                $required = 'ordering';
     99                        }
     100                        if ( 'category-order-by' === $setting && isset( $raw[ $setting ] ) && 'manual' === $raw[ $setting ] ) {
    98101                                $required = 'ordering';
    99102                        }
  • ultimate-faqs/trunk/includes/template-functions.php

    r3704732 r3821169  
    121121                return ewdufaqBasicSearch::render( $args );
    122122        }
    123 
    124         $query = new ewdufaqQuery( $args );
    125         $query->parse_request_args();
    126         $query->prepare_args();
    127 
    128         // Render faqs
    129         ewd_ufaq_load_view_files();
    130 
    131         $faqs = new ewdufaqViewFAQSearch( $args );
    132 
    133         $faqs->set_faqs( $query->get_faqs() );
    134        
    135         $ewd_ufaq_controller->shortcode_printing = true;
    136 
    137         $output = $faqs->render();
    138 
    139         $ewd_ufaq_controller->shortcode_printing = false;
    140 
    141         return $output;
     123        return class_exists( 'ewdufaqEWDPHSearch', false ) ? ewdufaqEWDPHSearch::shortcode( $args ) : ewdufaqBasicSearch::render( $args );
    142124}
    143125add_shortcode( 'ultimate-faq-search', 'ewd_ufaq_search_faqs_shortcode' );
    … …  
    166148        $args = shortcode_atts( $submit_faq_atts, $atts );
    167149
    168         // Handle FAQ submission
    169         if ( isset( $_POST['submit_question'] ) ) {
    170 
    171                 $args['faq_submitted'] = true;
    172 
    173                 $faq = new ewdufaqFAQ();
    174                 $success = $faq->insert_faq();
    175 
    176                 if ( $success ) {
    177 
    178                         $args['update_message'] = ! empty( $args['success_message'] ) ? $args['success_message'] : $ewd_ufaq_controller->settings->get_setting( 'label-thank-you-submit' );
    179                 }
    180                 else {
    181 
    182                         $args['update_message'] = '';
    183 
    184                         foreach ( $faq->validation_errors as $validation_error ) {
    185 
    186                                 $args['update_message'] .= '<br />' . $validation_error['message'];
    187                         }
    188                 }
    189         }
    190 
    191         // Render faq
    192         ewd_ufaq_load_view_files();
    193 
    194         $submit_faq = new ewdufaqViewSubmitFAQ( $args );
    195 
    196         $ewd_ufaq_controller->shortcode_printing = true;
    197 
    198         $output = $submit_faq->render();
    199 
    200         $ewd_ufaq_controller->shortcode_printing = false;
    201 
    202         return $output;
     150        return apply_filters( 'ewd_ufaq_submit_output', '', $args );
    203151}
    204152add_shortcode( 'submit-question', 'ewd_ufaq_submit_faq_shortcode' );
    … …  
    339287function ewd_ufaq_validate_captcha() {
    340288
    341         $modifiedcode = intval( $_POST['ewd_ufaq_modified_captcha'] );
    342         $usercode = intval( $_POST['ewd_ufaq_captcha'] );
    343 
    344         $code = ewd_ufaq_decrypt_catpcha_code( $modifiedcode );
    345 
    346         $validate_captcha = $code == $usercode ? 'Yes' : 'No';
    347 
    348         return $validate_captcha;
     289        return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::validate_captcha() : 'No';
    349290}
    350291}
    … …  
    353294function ewd_ufaq_encrypt_captcha_code( $code ) {
    354295       
    355         $modifiedcode = ($code + 5) * 3;
    356 
    357         return $modifiedcode;
    358 }
    359 }
    360 
    361 if ( ! function_exists( 'ewd_ufaq_encrypt_captcha_code' ) ) {
     296        return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::encrypt_captcha( $code ) : false;
     297}
     298}
     299
     300if ( ! function_exists( 'ewd_ufaq_decrypt_catpcha_code' ) ) {
    362301function ewd_ufaq_decrypt_catpcha_code( $modifiedcode ) {
    363302       
    364         $code = ($modifiedcode / 3) - 5;
    365 
    366         return $code;
     303        return class_exists( 'ewdufaqEWDPHSubmission', false ) ? ewdufaqEWDPHSubmission::decrypt_captcha( $modifiedcode ) : false;
    367304}
    368305}
  • ultimate-faqs/trunk/readme.txt

    r3744649 r3821169  
    44Requires at least: 6.0
    55Tested up to: 7.1
    6 Stable tag: 2.6.0
     6Stable tag: 2.7.0
    77Requires PHP: 7.4
    88License: GPLv3
    … …  
    240240== Changelog ==
    241241
    242 = 2.6.0 (2026-10-12) =
    243 - Added the ability to assign FAQ categories when creating FAQs directly in the Display FAQs block.
    244 - Added a separate "Move FAQ to Trash" action in the block editor, distinct from removing an FAQ from a page.
    245 - Improved FAQ library management and selection for sites with larger numbers of FAQs.
    246 - Improved validation, reliability, and error handling for FAQ import/export operations.
    247 - Updated Premium license validation and entitlement handling, including improved license status, recovery, and compatibility checks.
    248 - Improved preservation of existing FAQ content and settings when Premium access is unavailable.
    249 
    250 = 2.5.0 (2026-09-20) =
    251 - <strong>This is a major update with many changes, including some big changes. We suggest testing this update in a staging environment before updating your live environment. Or wait a few days before updating in the event that an issue is identified that requires a fix/new update.</strong>
    252 - Added the ability to create and manage FAQs directly in the Display FAQs block.
    253 - Added new local analytics functionality that can identify content gaps and use AI to suggest or automatically generate new FAQs to fill the gaps. You need to specify an AI provider in WP Settings > Connectors for this to work.
    254 - Updated the search functionality available in the free version.
    255 - Hardened public counters and AI Assist privacy, validation, and error handling.
    256 - Updated the bundled PhpSpreadsheet runtime to the PHP 7.4-compatible 1.30.6 security release and hardened CSV/XLS/XLSX imports.
     242= 2.7.0 (2026-11-24) =
     243- **If you are using the premium version, please make sure to also update the EWD Premium Helper plugin to version 0.3.1 at the same time.**
     244- Several updates have been made to separate and streamline the functionality of the premium version via the EWD Premium Helper plugin.
     245- The FAQ order table has been revamped to allow for setting an order number and to allow ordering of categories.
     246- WooCommerce FAQ selection: Added paged search and category browsing for large libraries.
     247- TranslatePress compatibility: Prevent language prefixes from incorrectly changing the licensed site identity.
    257248
    258249[See changelog for all versions](https://www.etoilewebdesign.com/changelogs/ultimate-faqs.txt).
    … …  
    260251== Upgrade Notice ==
    261252
    262 = 2.6.0 =
    263 This update includes changes to the functionality that lets you create FAQs directly in the block, as well as to the interaction between this plugin and the Premium Helper. If you make use of this functionality in the block or your site uses the Premium Helper, we recommend testing the update on a staging site before updating your production site.
     253= 2.7.0 =
     254Several updates have been made to separate and streamline the functionality of the premium version via the EWD Premium Helper plugin. If you are using the premium version, please make sure to also update the EWD Premium Helper plugin to version 0.3.1 at the same time.
  • ultimate-faqs/trunk/ultimate-faqs.php

    r3744649 r3821169  
    44 * Plugin URI: https://www.etoilewebdesign.com/plugins/ultimate-faq/
    55 * Description: Full-featured FAQ and accordion plugin with advanced search, simple UI and easy-to-use Gutenberg blocks and shortcodes.
    6  * Version: 2.6.0
     6 * Version: 2.7.0
    77 * Author: Etoile Web Design
    88 * Author URI: https://www.etoilewebdesign.com/
    … …  
    1414 * Requires PHP: 7.4
    1515 * WC requires at least: 7.1
    16  * WC tested up to: 11.2
     16 * WC tested up to: 11.3
    1717 */
    1818
    … …  
    6767                define( 'EWD_UFAQ_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
    6868                define( 'EWD_UFAQ_TEMPLATE_DIR', 'ewd-ufaq-templates' );
    69                         define( 'EWD_UFAQ_VERSION', '2.6.0' );
    70                         define( 'EWD_UFAQ_HELPER_API_VERSION', 2 );
    71                         define( 'EWD_UFAQ_MIN_HELPER_VERSION', '0.2.0' );
    72                         define( 'EWD_UFAQ_MAX_HELPER_API_VERSION', 2 );
     69                        define( 'EWD_UFAQ_VERSION', '2.7.0' );
     70                        define( 'EWD_UFAQ_HELPER_API_VERSION', 3 );
     71                        define( 'EWD_UFAQ_MIN_HELPER_VERSION', '0.3.0' );
     72                        define( 'EWD_UFAQ_MAX_HELPER_API_VERSION', 3 );
    7373                        define( 'EWD_UFAQ_ENTITLEMENT_CONTRACT_VERSION', 1 );
    7474                define( 'EWD_UFAQ_FAQ_POST_TYPE', 'ufaq' );
    … …  
    102102                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
    103103                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Notifications.class.php' );
    104                 require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/OrderingTable.class.php' );
    105104                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Permissions.class.php' );
    106105                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Query.class.php' );
     106                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/RetainedData.class.php' );
    107107                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/ReviewAsk.class.php' );
    108108                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Settings.class.php' );
    … …  
    111111                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Upgrades.class.php' );
    112112                require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/Widgets.class.php' );
    113                 require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/WooCommerce.class.php' );
    114                 require_once( EWD_UFAQ_PLUGIN_DIR . '/includes/WPForms.class.php' );
    115113        }
    116114
    … …  
    133131                $this->permissions       = new ewdufaqPermissions();
    134132                $this->settings          = new ewdufaqSettings();
     133                ewdufaqRetainedData::instance();
    135134                $this->helper_compatibility = new ewdufaqHelperCompatibility();
    136135                        // Register adapters regardless of initial entitlement; check at execution time.
    137                         $this->woocommerce = new ewdufaqWooCommerce();
    138                         $this->wpforms     = new ewdufaqWPForms();
    139136
    140137                new ewdufaqAJAX();
    … …  
    144141                new ewdufaqEditorFAQWorkflow();
    145142                if ( function_exists( 'register_block_pattern' ) ) { new ewdufaqPatterns(); }
    146                 new ewdufaqOrderingTable();
    147143                new ewdufaqUltimateWPMail();
    148144                new ewdufaqUpgrades();
    … …  
    353349                wp_enqueue_script( 'jquery-ui-sortable' );
    354350
    355                 wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery', 'jquery-ui-sortable' ), EWD_UFAQ_VERSION, true );
     351                wp_register_script( 'ewd-ufaq-admin-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq-admin.js', array( 'jquery' ), EWD_UFAQ_VERSION, true );
    356352
    357353                $args = array(
    … …  
    371367        public function register_assets() {
    372368
    373                 wp_register_style( 'ewd-ufaq-rrssb', EWD_UFAQ_PLUGIN_URL . '/assets/css/rrssb-min.css', array(), EWD_UFAQ_VERSION );
    374                 wp_register_style( 'ewd-ufaq-jquery-ui', EWD_UFAQ_PLUGIN_URL . '/assets/css/jquery-ui.min.css', array(), EWD_UFAQ_VERSION );
    375                
    376369                wp_register_style( 'ewd-ufaq-css', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq.css', array(), EWD_UFAQ_VERSION );
    377                 wp_register_style( 'ewd-ufaq-minimalist', EWD_UFAQ_PLUGIN_URL . '/assets/css/ewd-ufaq-minimalist.css', array(), EWD_UFAQ_VERSION );
    378370
    379371                wp_register_script( 'ewd-ufaq-js', EWD_UFAQ_PLUGIN_URL . '/assets/js/ewd-ufaq.js', array( 'jquery', 'jquery-ui-core' ), EWD_UFAQ_VERSION, true );
  • ultimate-faqs/trunk/views/Base.class.php

    r2510277 r3821169  
    1212require_once( EWD_UFAQ_PLUGIN_DIR . '/views/View.FAQs.class.php' );
    1313require_once( EWD_UFAQ_PLUGIN_DIR . '/views/View.FAQSearch.class.php' );
    14 require_once( EWD_UFAQ_PLUGIN_DIR . '/views/View.SubmitFAQ.class.php' );
    1514
    1615class ewdufaqBase {
  • ultimate-faqs/trunk/views/View.FAQ.class.php

    r3704732 r3821169  
    218218         * @since 2.0.0
    219219         */
    220         public function maybe_print_custom_fields() {
    221                 global $ewd_ufaq_controller;
    222                
    223                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) ) ) { return; }
    224                
    225                 $template = $this->find_template( 'faq-custom-fields' );
    226                
    227                 if ( $template ) {
    228                         include( $template );
    229                 }
     220        public function maybe_print_custom_fields()  {
     221                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_custom_fields', $this );
    230222        }
    231223
    … …  
    269261         * @since 2.0.0
    270262         */
    271         public function maybe_print_ratings() {
    272                 global $ewd_ufaq_controller;
    273                
    274                 if ( ! $ewd_ufaq_controller->settings->get_setting( 'faq-ratings' ) ) { return; }
    275                
    276                 $template = $this->find_template( 'faq-ratings' );
    277                
    278                 if ( $template ) {
    279                         include( $template );
    280                 }
     263        public function maybe_print_ratings()  {
     264                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_ratings', $this );
    281265        }
    282266
    … …  
    289273         * @since 2.0.0
    290274         */
    291         public function maybe_print_social_media() {
    292                 global $ewd_ufaq_controller;
    293                
    294                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
    295 
    296                 if ( ! is_array( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
    297 
    298                 if ( sizeof( $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) == 1 and in_array( '', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { return; }
    299                
    300                 $template = $this->find_template( 'faq-social-media' );
    301                
    302                 if ( $template ) {
    303                         include( $template );
    304                 }
     275        public function maybe_print_social_media()  {
     276                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_social_media', $this );
    305277        }
    306278
    … …  
    361333         * @since 2.0.0
    362334         */
    363         public function print_social_media_buttons() {
    364                 global $ewd_ufaq_controller;
    365                
    366                 if ( in_array( 'facebook', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_facebook_button(); }
    367                 if ( in_array( 'twitter', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_twitter_button(); }
    368                 if ( in_array( 'linkedin', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_linkedin_button(); }
    369                 if ( in_array( 'pinterest', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_pinterest_button(); }
    370                 if ( in_array( 'email', $ewd_ufaq_controller->settings->get_setting( 'social-media' ) ) ) { $this->print_email_button(); }
     335        public function print_social_media_buttons()  {
     336                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_social_media_buttons', $this );
    371337        }
    372338
    … …  
    376342         * @since 2.0.0
    377343         */
    378         public function print_facebook_button() {
    379                
    380                 $template = $this->find_template( 'faq-social-media-facebook' );
    381                
    382                 if ( $template ) {
    383                         include( $template );
    384                 }
     344        public function print_facebook_button()  {
     345                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_facebook_button', $this );
    385346        }
    386347
    … …  
    390351         * @since 2.0.0
    391352         */
    392         public function print_twitter_button() {
    393                
    394                 $template = $this->find_template( 'faq-social-media-twitter' );
    395                
    396                 if ( $template ) {
    397                         include( $template );
    398                 }
     353        public function print_twitter_button()  {
     354                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_twitter_button', $this );
    399355        }
    400356
    … …  
    404360         * @since 2.0.0
    405361         */
    406         public function print_linkedin_button() {
    407                
    408                 $template = $this->find_template( 'faq-social-media-linkedin' );
    409                
    410                 if ( $template ) {
    411                         include( $template );
    412                 }
     362        public function print_linkedin_button()  {
     363                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_linkedin_button', $this );
    413364        }
    414365
    … …  
    418369         * @since 2.0.0
    419370         */
    420         public function print_pinterest_button() {
    421                
    422                 $template = $this->find_template( 'faq-social-media-pinterest' );
    423                
    424                 if ( $template ) {
    425                         include( $template );
    426                 }
     371        public function print_pinterest_button()  {
     372                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_pinterest_button', $this );
    427373        }
    428374
    … …  
    432378         * @since 2.0.0
    433379         */
    434         public function print_email_button() {
    435                
    436                 $template = $this->find_template( 'faq-social-media-email' );
    437                
    438                 if ( $template ) {
    439                         include( $template );
    440                 }
     380        public function print_email_button()  {
     381                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'print_email_button', $this );
    441382        }
    442383
    … …  
    459400                global $ewd_ufaq_controller;
    460401
    461                 return is_array( $ewd_ufaq_controller->settings->get_setting( 'faq-elements-order' ) ) ? $ewd_ufaq_controller->settings->get_setting( 'faq-elements-order' ) : json_decode( $ewd_ufaq_controller->settings->get_setting( 'faq-elements-order' ) );
     402                $elements = array( 'categories' => 'Categories', 'body' => 'Body', 'author_date' => 'Author/Date', 'tags' => 'Tags', 'permalink' => 'Permalink', 'comments' => 'Comments', 'back_to_top' => 'Back to Top' );
     403                return apply_filters( 'ewd_ufaq_faq_elements_order', $elements, $this );
    462404        }
    463405
    … …  
    467409         * @since 2.0.0
    468410         */
    469         public function get_color_block_shape() {
    470                 global $ewd_ufaq_controller;
    471 
    472                 return 'ewd-ufaq-' . $ewd_ufaq_controller->settings->get_setting( 'color-block-shape' );
    473         }
     411        public function get_color_block_shape()  {
     412                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_color_block_shape( $this ) : '';
     413        }
    474414
    475415        /**
    … …  
    500440         * @since 2.0.0
    501441         */
    502         public function get_custom_fields() {
    503                 global $ewd_ufaq_controller;
    504 
    505                 return ewd_ufaq_decode_infinite_table_setting( $ewd_ufaq_controller->settings->get_setting( 'faq-fields' ) );
    506         }
     442        public function get_custom_fields()  {
     443                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_custom_fields( $this ) : array();
     444        }
    507445
    508446        /**
    … …  
    511449         * @since 2.0.0
    512450         */
    513         public function get_custom_field_value( $custom_field ) {
    514 
    515                 $value = get_post_meta( $this->faq->post->ID, 'Custom_Field_' . $custom_field->id, true );
    516 
    517                 if ( $custom_field->type == 'file' ) {
    518 
    519                         return ! empty( $value ) ? '<a href="' . esc_attr( $value ) . '">' . strrpos( $value, '/' ) ? esc_html( substr( $value, strrpos( $value, '/' ) + 1 ) ) : esc_html( $value ) . '</a>' : '';
    520                 }
    521                 elseif ( $custom_field->type == 'link' ) {
    522 
    523                         return ! empty( $value ) ? '<a href="' . esc_attr( $value ) . '" target="_blank">' . esc_attr( $value ) . '</a>' : '';
    524                 }
    525                 else { return $value; }
     451        public function get_custom_field_value( $custom_field )  {
     452                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_custom_field_value( $this, $custom_field ) : '';
    526453        }
    527454
    … …  
    534461                global $ewd_ufaq_controller;
    535462
    536                 return $ewd_ufaq_controller->settings->get_setting( 'label-categories' ) ? $ewd_ufaq_controller->settings->get_setting( 'label-categories' ) : ( sizeOf( $this->faq->categories ) == 1 ? __( 'Category:', 'ultimate-faqs' ) : __( 'Categories:', 'ultimate-faqs' ) );
     463                return apply_filters( 'ewd_ufaq_custom_label', count( $this->faq->categories ) === 1 ? __( 'Category:', 'ultimate-faqs' ) : __( 'Categories:', 'ultimate-faqs' ), 'label-categories', $this );
    537464        }
    538465
    … …  
    558485                global $ewd_ufaq_controller;
    559486
    560                 return $ewd_ufaq_controller->settings->get_setting( 'label-tags' ) ? $ewd_ufaq_controller->settings->get_setting( 'label-tags' ) : ( sizeOf( $this->faq->tags ) == 1 ? __( 'Tag:', 'ultimate-faqs' ) : __( 'Tags:', 'ultimate-faqs' ) );
     487                return apply_filters( 'ewd_ufaq_custom_label', count( $this->faq->tags ) === 1 ? __( 'Tag:', 'ultimate-faqs' ) : __( 'Tags:', 'ultimate-faqs' ), 'label-tags', $this );
    561488        }
    562489
    … …  
    579506         * @since 2.0.0
    580507         */
    581         public function get_thumbs_up_image() {
    582                 global $ewd_ufaq_controller;
    583 
    584                 $img_url = ( $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) and $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) != 'http://' ) ? $ewd_ufaq_controller->settings->get_setting( 'thumbs-up-image' ) : EWD_UFAQ_PLUGIN_URL . '/assets/img/Thumbs-up-icon.png';
    585 
    586                 return '<img src="' . esc_url( $img_url ) . '" alt="' . __( "Thumbs Up Icon", "ultimate-faqs" ) . '">';
    587         }
     508        public function get_thumbs_up_image()  {
     509                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_thumbs_up_image( $this ) : '';
     510        }
    588511
    589512        /**
    … …  
    592515         * @since 2.0.0
    593516         */
    594         public function get_up_votes() {
    595 
    596                 return get_post_meta( $this->faq->post->ID, "FAQ_Up_Votes", true ) ? get_post_meta( $this->faq->post->ID, "FAQ_Up_Votes", true ) : 0;
    597         }
     517        public function get_up_votes()  {
     518                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_up_votes( $this ) : 0;
     519        }
    598520
    599521        /**
    … …  
    602524         * @since 2.0.0
    603525         */
    604         public function get_thumbs_down_image() {
    605                 global $ewd_ufaq_controller;
    606 
    607                 $img_url = ( $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) and $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) != 'http://' ) ? $ewd_ufaq_controller->settings->get_setting( 'thumbs-down-image' ) : EWD_UFAQ_PLUGIN_URL . '/assets/img/Thumbs-down-icon.png';
    608 
    609                 return '<img src="' . esc_url( $img_url ) . '" alt="' . __( "Thumbs Down Icon", "ultimate-faqs" ) . '">';
    610         }
     526        public function get_thumbs_down_image()  {
     527                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_thumbs_down_image( $this ) : '';
     528        }
    611529
    612530        /**
    … …  
    615533         * @since 2.0.0
    616534         */
    617         public function get_down_votes() {
    618 
    619                 return get_post_meta( $this->faq->post->ID, "FAQ_Down_Votes", true ) ? get_post_meta( $this->faq->post->ID, "FAQ_Down_Votes", true ) : 0;
    620         }
     535        public function get_down_votes()  {
     536                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_down_votes( $this ) : 0;
     537        }
    621538
    622539        /**
    … …  
    625542         * @since 2.0.0
    626543         */
    627         public function get_social_twitter_link() {
    628 
    629                 $text = __( 'Check out this helpful FAQ', 'ultimate-faqs' ) . ': ';
    630 
    631                 return 'https://twitter.com/intent/tweet?text=' . urlencode( $text ) . urlencode( $this->faq->post->post_title ) . urlencode( ' | ' ) . urlencode( $this->permalink );
    632         }
     544        public function get_social_twitter_link()  {
     545                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_twitter_link( $this ) : '';
     546        }
    633547
    634548        /**
    … …  
    637551         * @since 2.0.0
    638552         */
    639         public function get_social_linkedin_link() {
    640 
    641                 $text = __( 'Check out this helpful FAQ', 'ultimate-faqs' );
    642 
    643                 return 'http://www.linkedin.com/shareArticle?mini=true&amp;url=' . $this->permalink . "&amp;title=" . urlencode( $text ) . "&amp;summary=" . urlencode( $this->faq->post->post_title );
    644         }
     553        public function get_social_linkedin_link()  {
     554                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_linkedin_link( $this ) : '';
     555        }
    645556
    646557        /**
    … …  
    649560         * @since 2.0.0
    650561         */
    651         public function get_social_pinterest_link() {
    652 
    653                 $text = __( 'Check out this helpful FAQ', 'ultimate-faqs' ) . ': ';
    654 
    655                 return 'http://pinterest.com/pin/create/button/?url=' . $this->permalink . "&amp;description=" . urlencode( $text ) . urlencode( $this->faq->post->post_title );
    656         }
     562        public function get_social_pinterest_link()  {
     563                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_pinterest_link( $this ) : '';
     564        }
    657565
    658566        /**
    … …  
    661569         * @since 2.0.0
    662570         */
    663         public function get_social_email_mailto_link() {
    664 
    665                 $subject = __( 'Check out this helpful FAQ', 'ultimate-faqs' );
    666 
    667                 return 'mailto:?subject=' . urlencode( $subject ) . "&amp;body=" . urlencode( $this->faq->post->post_title ) . urlencode( ' | ' ) . urlencode( $this->permalink );
    668         }
     571        public function get_social_email_mailto_link()  {
     572                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_social_email_mailto_link( $this ) : '';
     573        }
    669574
    670575        /**
    … …  
    679584                        array(
    680585                                'ewd-ufaq-faq-div',
    681                                 'ewd-ufaq-faq-column-count-' . $ewd_ufaq_controller->settings->get_setting( 'number-of-columns' ),
    682                                 'ewd-ufaq-faq-responsive-columns-' . $ewd_ufaq_controller->settings->get_setting( 'responsive-columns' ),
    683                                 'ewd-ufaq-faq-display-style-' . $ewd_ufaq_controller->settings->get_setting( 'display-style' ),
     586                                'ewd-ufaq-faq-column-count-one',
     587                                'ewd-ufaq-faq-responsive-columns-',
     588                                'ewd-ufaq-faq-display-style-default',
    684589                        )
    685590                );
    … …  
    729634                $this->date = get_the_date( '', $this->faq->post->ID );
    730635               
    731                 if ( ! empty( $this->search_string ) and $ewd_ufaq_controller->settings->get_setting( 'highlight-search-term' ) ) {
    732 
    733                         $this->faq_title  = $this->highlight_across_tags( $this->faq_title,  $this->search_string );
    734                         $this->faq_answer = $this->highlight_across_tags( $this->faq_answer, $this->search_string );
    735                 }
     636                do_action( 'ewd_ufaq_faq_display_variables', $this );
    736637               
    737638                remove_filter( 'siteorigin_panels_filter_content_enabled', array( $this, 'disable_site_origin_page_builder' ) );
    … …  
    746647         * @since 2.0.0
    747648         */
    748         public function highlight_across_tags( $html, $term, $class = 'ewd-ufaq-highlight-search-term' ) {
    749 
    750                 $term = trim( $term );
    751                 if ( $term === '' ) { return $html; }
    752 
    753                 $pattern = '/' . preg_quote( $term, '/' ) . '/iu';
    754 
    755                 // Parse HTML
    756                 $dom = new DOMDocument( '1.0', 'UTF-8' );
    757                 libxml_use_internal_errors( true );
    758                 $dom->loadHTML( '<?xml encoding="utf-8" ?>' . $html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
    759                 libxml_clear_errors();
    760 
    761                 $xpath = new DOMXPath( $dom );
    762 
    763                 // Collect all text nodes in document order and build a flat text map
    764                 $nodes  = array();
    765                 $full   = '';
    766                 $offset = 0;
    767 
    768                 // Include empty text nodes too (a match might begin/end at their edges)
    769                 foreach ( $xpath->query( '//text()' ) as $t ) {
    770                         $text    = isset( $t->nodeValue ) ? $t->nodeValue : '';
    771                         $len     = mb_strlen( $text, 'UTF-8' );
    772                         $nodes[] = array( 'node' => $t, 'start' => $offset, 'end' => $offset + $len );
    773                         $full   .= $text;
    774                         $offset += $len;
    775                 }
    776 
    777                 if ( $full === '' || empty( $nodes ) ) {
    778                         // Nothing to do
    779                         $result = $dom->saveHTML();
    780                         return preg_replace( '/^<\?xml.*?\?>/u', '', $result ) ? preg_replace( '/^<\?xml.*?\?>/u', '', $result ) : $html;
    781                 }
    782 
    783                 // Find matches in the flattened text
    784                 if ( ! preg_match_all( $pattern, $full, $m, PREG_OFFSET_CAPTURE ) ) {
    785                         $result = $dom->saveHTML();
    786                         return preg_replace( '/^<\?xml.*?\?>/u', '', $result ) ? preg_replace( '/^<\?xml.*?\?>/u', '', $result ) : $html;
    787                 }
    788 
    789                 // Build match list (convert byte offsets to Unicode codepoint offsets)
    790                 $matches = array();
    791                 foreach ( $m[0] as $mm ) {
    792                         $match_text = $mm[0];
    793                         $start_byte = $mm[1];
    794 
    795                         $pre    = mb_substr( $full, 0, $start_byte, 'UTF-8' );
    796                         $start  = mb_strlen( $pre, 'UTF-8' );
    797                         $length = mb_strlen( $match_text, 'UTF-8' );
    798 
    799                         $matches[] = array( 'start' => $start, 'length' => $length );
    800                 }
    801 
    802                 if ( empty( $matches ) ) {
    803                         $result = $dom->saveHTML();
    804                         return preg_replace( '/^<\?xml.*?\?>/u', '', $result ) ? preg_replace( '/^<\?xml.*?\?>/u', '', $result ) : $html;
    805                 }
    806 
    807                 // Process matches from right to left so earlier offsets aren't invalidated
    808                 usort(
    809                         $matches,
    810                         function( $a, $b ) {
    811                                 if ( $a['start'] === $b['start'] ) { return 0; }
    812                                 return ( $a['start'] < $b['start'] ) ? 1 : -1;
    813                         }
    814                 );
    815 
    816                 foreach ( $matches as $match ) {
    817                         $m_start = $match['start'];
    818                         $m_end   = $match['start'] + $match['length'];
    819 
    820                         // Walk text nodes and wrap overlapping slices
    821                         foreach ( $nodes as $entry ) {
    822 
    823                                 /** @var DOMText $text_node */
    824                                 $text_node = $entry['node'];
    825                                 $n_start   = $entry['start'];
    826                                 $n_end     = $entry['end'];
    827 
    828                                 // No overlap?
    829                                 if ( $m_end <= $n_start || $m_start >= $n_end ) { continue; }
    830 
    831                                 // Local offsets in this node
    832                                 $local_start = max( 0, $m_start - $n_start );
    833                                 $local_end   = min( $n_end, $m_end ) - $n_start;
    834 
    835                                 // Split into [before][target][after]
    836                                 // Note: DOMText::splitText uses UTF-16 offsets internally but PHP maps by characters.
    837                                 // Using mb_* derived offsets aligns with DOM for BMP; for safety we keep to mb_strlen logic.
    838                                 if ( $local_end < mb_strlen( $text_node->data, 'UTF-8' ) ) {
    839                                         $after_node = $text_node->splitText( $local_end );
    840                                 } else {
    841                                         $after_node = null;
    842                                 }
    843 
    844                                 $target_node = $text_node;
    845                                 if ( $local_start > 0 ) {
    846                                         $target_node = $text_node->splitText( $local_start );
    847                                 }
    848 
    849                                 // Wrap the target slice
    850                                 $span = $dom->createElement( 'span' );
    851                                 $span->setAttribute( 'class', $class );
    852                                 $target_node->parentNode->replaceChild( $span, $target_node );
    853                                 $span->appendChild( $target_node );
    854                         }
    855                 }
    856 
    857                 // Return HTML without the XML declaration we prepended
    858                 $result = $dom->saveHTML();
    859                 $result = preg_replace( '/^<\?xml.*?\?>/u', '', $result );
    860 
    861                 return $result ? $result : $html;
     649        public function highlight_across_tags( $html, $term, $class = 'ewd-ufaq-highlight-search-term' )  {
     650                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::highlight_across_tags( $this, $html, $term, $class ) : $html;
    862651        }
    863652
    … …  
    1082871         */
    1083872        public function enqueue_assets() {
    1084                
    1085                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    1086                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
     873                global $ewd_ufaq_controller;
     874                if ( ! $ewd_ufaq_controller->get_front_end_php_data( 'ewd-ufaq-js', 'ewd_ufaq_php_data' ) ) {
     875                        $args = array( 'nonce' => wp_create_nonce( 'ewd-ufaq-js' ), 'faq_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ), 'category_accordion' => $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ), 'faq_scroll' => $ewd_ufaq_controller->settings->get_setting( 'scroll-to-top' ) );
     876                        $ewd_ufaq_controller->add_front_end_php_data( 'ewd-ufaq-js', 'ewd_ufaq_php_data', apply_filters( 'ewd_ufaq_js_localize_data', $args, $this ) );
     877                }
     878               
    1087879                wp_enqueue_style( 'ewd-ufaq-css' );
    1088880
    1089                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    1090                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
    1091 
    1092881                wp_enqueue_script( 'ewd-ufaq-js' );
    1093 
     882                do_action( 'ewd_ufaq_view_assets', $this );
     883
     884        }
     885        public function get_body_classes() {
     886                $classes = array( 'ewd-ufaq-faq-body' );
     887                if ( ! $this->display_all_answers ) { $classes[] = 'ewd-ufaq-hidden'; }
     888                return apply_filters( 'ewd_ufaq_faq_body_classes', $classes, $this );
    1094889        }
    1095890}
  • ultimate-faqs/trunk/views/View.FAQSearch.class.php

    r3704732 r3821169  
    2626         */
    2727        public function render() {
    28                 global $ewd_ufaq_controller;
    29 
    30                 // Add any dependent stylesheets or javascript
    31                 $this->enqueue_assets();
    32 
    33                 if ( empty( $this->show_on_load ) ) {
    34                         $this->faqs = array();
    35                 }
    36                 else {
    37                         $this->add_schema_data();
    38                 }
    39 
    40                 $this->set_faqs_options();
    41 
    42                 $this->create_faq_data();
    43 
    44                 // Add css classes to the slider
    45                 $this->classes = $this->get_classes();
    46 
    47                 ob_start();
    48 
    49                 $this->add_custom_styling();
    50 
    51                 $template = $this->find_template( 'faqs-search' );
    52                 if ( $template ) {
    53                         include( $template );
    54                 }
    55 
    56                 $template = $this->find_template( 'faqs' );
    57                 if ( $template ) {
    58                         include( $template );
    59                 }
    60 
    61                 $output = ob_get_clean();
    62 
    63                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) == 'list' ){
    64 
    65                         $output = $this->replace_list_header( $output );
    66                 }
    67 
    68                 return apply_filters( 'ewd_ufaq_search_faqs_output', $output, $this );
     28                return class_exists( 'ewdufaqEWDPHSearch', false ) ? ewdufaqEWDPHSearch::render( $this ) : ewdufaqBasicSearch::render( get_object_vars( $this ) );
    6929        }
    7030
    … …  
    8848         */
    8949        public function maybe_print_search_submit() {
    90                 global $ewd_ufaq_controller;
    91 
    92                 if ( $ewd_ufaq_controller->settings->get_setting( 'auto-complete-titles' ) ) { return; }
    93 
    94                 $template = $this->find_template( 'faqs-search-submit' );
    95                 if ( $template ) {
    96                         include( $template );
    97                 }
     50                if ( class_exists( 'ewdufaqEWDPHSearch', false ) ) { ewdufaqEWDPHSearch::maybe_print_search_submit( $this ); }
    9851        }
    9952
    … …  
    10962                        array(
    11063                                'ewd-ufaq-faq-list',
    111                                 'ewd-ufaq-page-type-' . $ewd_ufaq_controller->settings->get_setting( 'page-type' ),
    112                                 'ewd-ufaq-category-tabs-' . $ewd_ufaq_controller->settings->get_setting( 'category-tabs' ),
     64                                'ewd-ufaq-page-type-distinct',
     65                                'ewd-ufaq-category-tabs-',
    11366                                'ewd-ufaq-search'
    11467                        )
    11568                );
    11669
    117                 if ( $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ) or $ewd_ufaq_controller->settings->get_setting( 'category-tabs' ) ) {
     70                if ( $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ) ) {
    11871                        $classes[] = 'ewd-ufaq-faq-category-title-accordion';
    11972                }
  • ultimate-faqs/trunk/views/View.FAQs.class.php

    r3704732 r3821169  
    134134                $output = ob_get_clean();
    135135
    136                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) == 'list' ){
    137 
    138                         $output = $this->replace_list_header( $output );
    139                 }
     136                $output = apply_filters( 'ewd_ufaq_rendered_list_output', $output, $this );
    140137
    141138                return apply_filters( 'ewd_ufaq_faqs_output', $output, $this );
    … …  
    180177         * @since 2.0.0
    181178         */
    182         public function maybe_print_header() {
    183                 global $ewd_ufaq_controller;
    184                
    185                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) != 'list' ) { return; }
    186                
    187                 echo '%list_header_placeholder%';
     179        public function maybe_print_header()  {
     180                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_header', $this );
    188181        }
    189182
    … …  
    218211                        $args[ 'orderby' ] = $this->category_orderby;
    219212                }
    220                 elseif ( ! empty( $this->category_orderby ) ) {
    221 
    222                         $args[ 'meta_key' ] = 'ufaq_category_order';
    223                         $args[ 'orderby' ] = 'meta_value_num';
    224 
    225                 }
     213                $args = apply_filters( 'ewd_ufaq_category_query_args', $args, $this );
    226214
    227215                $categories = get_terms( $args );
    … …  
    418406         * @since 2.0.0
    419407         */
    420         public function maybe_print_pagination() {
    421 
    422                 if ( $this->max_page <= 1 ) { return; }
    423 
    424                 $template = $this->find_template( 'faqs-pagination' );
    425                
    426                 if ( $template ) {
    427                         include( $template );
    428                 }
     408        public function maybe_print_pagination()  {
     409                echo apply_filters( 'ewd_ufaq_render_paid_element', '', 'maybe_print_pagination', $this );
    429410        }
    430411
    … …  
    434415         * @since 2.0.0
    435416         */
    436         public function replace_list_header( $output ) {
    437 
    438                 if ( $this->group_by_category ) { $template = $this->find_template( 'faqs-category-list-header' ); }
    439                 else { $template = $this->find_template( 'faqs-list-header' ); }
    440                
    441                 ob_start();
    442 
    443                 if ( $template ) {
    444                         include( $template );
    445                 }
    446 
    447                 $list_header = ob_get_clean();
    448 
    449                 return str_replace( '%list_header_placeholder%', $list_header, $output );
     417        public function replace_list_header( $output )  {
     418                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::replace_list_header( $this, $output ) : $output;
    450419        }
    451420
    … …  
    503472                        array(
    504473                                'ewd-ufaq-faq-list',
    505                                 'ewd-ufaq-page-type-' . $ewd_ufaq_controller->settings->get_setting( 'page-type' ),
    506                                 'ewd-ufaq-category-tabs-' . $ewd_ufaq_controller->settings->get_setting( 'category-tabs' )
     474                                'ewd-ufaq-page-type-distinct',
     475                                'ewd-ufaq-category-tabs-'
    507476                        )
    508477                );
    … …  
    564533                $this->max_page = ceil( $this->faq_count / $this->faqs_per_page );
    565534
    566                 if ( ! $this->group_by_category and $ewd_ufaq_controller->settings->get_setting( 'display-style' ) != 'list' ) { return; }
     535                if ( ! apply_filters( 'ewd_ufaq_needs_category_data', (bool) $this->group_by_category, $this ) ) { return; }
    567536
    568537                $args = array(
    … …  
    576545                        $args[ 'orderby' ] = $this->category_orderby;
    577546                }
    578                 elseif ( ! empty( $this->category_orderby ) ) {
    579 
    580                         $args[ 'meta_key' ] = 'ufaq_category_order';
    581                         $args[ 'orderby' ] = 'meta_value_num';
    582 
    583                 }
     547                $args = apply_filters( 'ewd_ufaq_category_query_args', $args, $this );
    584548
    585549                $categories = get_terms( $args );
    … …  
    717681                global $ewd_ufaq_controller;
    718682
    719                 if ( empty( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol' ) ) ) { return false; }
     683                if ( ! $this->get_category_toggle_symbol() ) { return false; }
    720684
    721685                if ( empty( $ewd_ufaq_controller->settings->get_setting( 'faq-category-toggle' ) ) ) { return false; }
    … …  
    732696                global $ewd_ufaq_controller;
    733697
    734                 return 'ewd-ufaq-' . $ewd_ufaq_controller->settings->get_setting( 'color-block-shape' );
     698                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_color_block_shape( $this ) : '';
    735699        }
    736700
    … …  
    740704         * @since 2.4.3
    741705         */
    742         public function get_category_toggle_symbol() {
    743                 global $ewd_ufaq_controller;
    744 
    745                 return strtolower( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol' ) );
    746         }
     706        public function get_category_toggle_symbol()  {
     707                return class_exists( 'ewdufaqEWDPHPresentation', false ) ? ewdufaqEWDPHPresentation::get_category_toggle_symbol( $this ) : '';
     708        }
    747709
    748710        /**
    … …  
    790752         */
    791753        public function enqueue_assets() {
    792                 global $ewd_ufaq_controller, $wp_scripts;
    793 
    794                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    795                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
     754                global $ewd_ufaq_controller;
    796755                wp_enqueue_style( 'ewd-ufaq-css' );
    797                 if ( $ewd_ufaq_controller->settings->get_setting( 'display-style' ) == 'minimalist' ) {
    798                         wp_enqueue_style( 'ewd-ufaq-minimalist' );
    799                 }
    800 
    801                 wp_enqueue_style( 'ewd-ufaq-rrssb' );
    802                 wp_enqueue_style( 'ewd-ufaq-jquery-ui' );
    803 
    804                 $handle = 'ewd-ufaq-js';
     756                wp_enqueue_script( 'ewd-ufaq-js' );
    805757                $args = array(
    806                         'faq_accordion'         => isset( $this->faq_accordion ) ? $this->faq_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ),
    807                         'category_accordion'    => isset( $this->category_accordion ) ? $this->category_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ),
    808                         'faq_scroll'            => $ewd_ufaq_controller->settings->get_setting( 'scroll-to-top' ),
    809                         'reveal_effect'         => $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ),
    810                         'retrieving_results'    => $ewd_ufaq_controller->settings->get_setting( 'label-retrieving-results' ),
    811                         'highlight_search_term' => $ewd_ufaq_controller->settings->get_setting( 'highlight-search-term' ),
    812                         'save_search_terms'     => $ewd_ufaq_controller->settings->get_setting( 'save-search-terms' ),
    813                         'autocomplete_question' => $ewd_ufaq_controller->settings->get_setting( 'auto-complete-titles' ),
    814                         'question_titles'       => $this->get_faq_titles(),
    815                         'display_faq'           => 0,
    816                         'nonce'                 => wp_create_nonce( $handle ),
     758                        'faq_accordion' => isset( $this->faq_accordion ) ? $this->faq_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-accordion' ),
     759                        'category_accordion' => isset( $this->category_accordion ) ? $this->category_accordion : $ewd_ufaq_controller->settings->get_setting( 'faq-category-accordion' ),
     760                        'faq_scroll' => $ewd_ufaq_controller->settings->get_setting( 'scroll-to-top' ),
     761                        'display_faq' => 0,
     762                        'nonce' => wp_create_nonce( 'ewd-ufaq-js' ),
    817763                );
    818 
    819                 if ( ! empty( get_query_var( 'single_faq' ) ) ) {
    820 
     764                if ( get_query_var( 'single_faq' ) ) {
    821765                        $faq = get_page_by_path( get_query_var( 'single_faq' ), OBJECT, EWD_UFAQ_FAQ_POST_TYPE );
    822                         $args['display_faq'] = $faq->ID;
    823                 }
    824                 elseif ( isset( $_GET['Display_FAQ'] ) ) {
    825                         $args['display_faq'] = intval( $_GET['Display_FAQ'] );
    826                 }
    827 
    828                 // Fetch any existing script data
    829                 $prev_question_titles = $ewd_ufaq_controller->get_front_end_php_data( $handle, 'question_titles' );
    830 
    831                 if ( ! empty( $prev_question_titles ) ) {
    832                         $args['question_titles'] = array_merge( $prev_question_titles, $args['question_titles'] );
    833                         $args['question_titles'] = array_unique( $args['question_titles'] );
    834                 }
    835 
    836                 $ewd_ufaq_controller->add_front_end_php_data( $handle, 'question_titles', $args['question_titles'] );
    837 
    838                 wp_enqueue_script( $handle );
    839                
    840                 $ewd_ufaq_controller->add_front_end_php_data( $handle, 'ewd_ufaq_php_data', apply_filters( 'ewd_ufaq_js_localize_data', $args ) );
    841 
    842                 wp_enqueue_script( 'jquery-ui-core' );
    843 
    844                 if ( $ewd_ufaq_controller->settings->get_setting( 'auto-complete-titles' ) ) {
    845 
    846                         wp_enqueue_script( 'jquery-ui-autocomplete' );
    847                 }
    848 
    849                 if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) != 'none' ) {
    850 
    851                         wp_enqueue_script( 'jquery-effects-core' );
    852                         wp_enqueue_script( 'jquery-ui-autocomplete' );
    853 
    854                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'blind' ) { wp_enqueue_script( 'jquery-effects-blind' ); }
    855                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'bounce' ) { wp_enqueue_script( 'jquery-effects-bounce' ); }
    856                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'clip' ) { wp_enqueue_script( 'jquery-effects-clip' ); }
    857                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'drop' ) { wp_enqueue_script( 'jquery-effects-drop' ); }
    858                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'explode' ) { wp_enqueue_script( 'jquery-effects-explode' ); }
    859                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'fade' ) { wp_enqueue_script( 'jquery-effects-fade' ); }
    860                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'fold' ) { wp_enqueue_script( 'jquery-effects-fold' ); }
    861                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'highlight' ) { wp_enqueue_script( 'jquery-effects-highlight' ); }
    862                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'pulsate' ) { wp_enqueue_script( 'jquery-effects-pulsate' ); }
    863                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'shake' ) { wp_enqueue_script( 'jquery-effects-shake' ); }
    864                         if ( $ewd_ufaq_controller->settings->get_setting( 'reveal-effect' ) == 'slide' ) { wp_enqueue_script( 'jquery-effects-slide' ); }
    865                 }
    866 
     766                        $args['display_faq'] = $faq instanceof WP_Post ? $faq->ID : 0;
     767                } elseif ( isset( $_GET['Display_FAQ'] ) && is_scalar( $_GET['Display_FAQ'] ) ) {
     768                        $args['display_faq'] = absint( $_GET['Display_FAQ'] );
     769                }
     770                $ewd_ufaq_controller->add_front_end_php_data( 'ewd-ufaq-js', 'ewd_ufaq_php_data', apply_filters( 'ewd_ufaq_js_localize_data', $args, $this ) );
     771                do_action( 'ewd_ufaq_view_assets', $this );
    867772        }
    868773}
  • ultimate-faqs/trunk/views/View.class.php

    r3744649 r3821169  
    7171         */
    7272        function find_template( $template ) {
     73                global $ewd_ufaq_controller;
     74                $paid = array(
     75                        'faq-custom-fields' => 'fields',
     76                        'faq-ratings' => 'premium',
     77                        'faq-social-media' => 'premium',
     78                        'faq-social-media-email' => 'premium',
     79                        'faq-social-media-facebook' => 'premium',
     80                        'faq-social-media-linkedin' => 'premium',
     81                        'faq-social-media-pinterest' => 'premium',
     82                        'faq-social-media-twitter' => 'premium',
     83                        'faqs-pagination' => 'premium',
     84                        'faqs-list-header' => 'premium',
     85                        'faqs-category-list-header' => 'premium',
     86                        'faqs-search' => 'search',
     87                        'faqs-search-submit' => 'search',
     88                        'submit-faq' => 'submit-faq',
     89                        'submit-faq-captcha' => 'submit-faq',
     90                        'submit-faq-custom-field-checkbox' => 'submit-faq',
     91                        'submit-faq-custom-field-date' => 'submit-faq',
     92                        'submit-faq-custom-field-datetime' => 'submit-faq',
     93                        'submit-faq-custom-field-radio' => 'submit-faq',
     94                        'submit-faq-custom-field-select' => 'submit-faq',
     95                        'submit-faq-custom-field-text' => 'submit-faq',
     96                        'submit-faq-custom-field-textarea' => 'submit-faq',
     97                        'submit-faq-field-author-email' => 'submit-faq',
     98                        'submit-faq-field-author' => 'submit-faq',
     99                        'submit-faq-field-faq-answer' => 'submit-faq',
     100                        'submit-faq-field-faq-question' => 'submit-faq',
     101                        'submit-faq-submitted-faq-message' => 'submit-faq',
     102                );
     103                if ( ! is_string( $template ) || ( 0 === strpos( $template, 'submit-faq' ) && ! isset( $paid[ $template ] ) ) ) { return false; }
     104                $capability = isset( $paid[ $template ] ) ? $paid[ $template ] : '';
     105                if ( $capability && ( ! isset( $ewd_ufaq_controller->permissions ) || ! $ewd_ufaq_controller->permissions->check_permission( $capability ) ) ) {
     106                        return false;
     107                }
    73108
    74109                $this->template_dirs = array(
    … …  
    78113                );
    79114               
    80                 $this->template_dirs = apply_filters( 'ewd_ufaq_template_directories', $this->template_dirs );
     115                $this->template_dirs = apply_filters( 'ewd_ufaq_template_directories', $this->template_dirs, $template, $this );
    81116
    82117                foreach ( $this->template_dirs as $dir ) {
     118                        // Never execute an obsolete paid default left by a merge-style update.
     119                        // Child/parent and explicitly supplied integration directories still work.
     120                        if ( $capability && rtrim( wp_normalize_path( $dir ), '/' ) === wp_normalize_path( EWD_UFAQ_PLUGIN_DIR . '/' . EWD_UFAQ_TEMPLATE_DIR ) ) { continue; }
    83121                        if ( file_exists( $dir . $template . '.php' ) ) {
    84122                                return $dir . $template . '.php';
    … …  
    86124                }
    87125
     126                if ( $capability ) { do_action( 'ewd_ufaq_missing_paid_template', $template ); }
    88127                return false;
    89128        }
    … …  
    110149                if ( empty( $this->label_defaults ) ) { $this->set_label_defaults(); }
    111150
    112                 return ! empty( $ewd_ufaq_controller->settings->get_setting( $label_name ) ) ? $ewd_ufaq_controller->settings->get_setting( $label_name ) : $this->label_defaults[ $label_name ];
     151                $default = isset( $this->label_defaults[ $label_name ] ) ? $this->label_defaults[ $label_name ] : '';
     152                return apply_filters( 'ewd_ufaq_custom_label', $default, $label_name, $this );
    113153        }
    114154
    … …  
    150190
    151191        public function add_custom_styling() {
    152                 global $ewd_ufaq_controller;
    153 
    154                 $heading_type = $ewd_ufaq_controller->settings->get_setting( 'styling-faq-heading-type' );
    155                 $category_heading_type = $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-type' );
    156 
    157                 $css = '';
    158 
    159                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-background-color' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { background-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-background-color' ) . ' !important; }'; }
    160                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-font-color' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-font-color' ) . ' !important; }'; }
    161                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-size' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { border-width: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-size' ) . ' !important; }'; }
    162                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-color' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { border-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-color' ) . ' !important; }'; }
    163                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-radius' ) != '' ) { $css .= '.ewd-ufaq-post-margin-symbol { border-radius: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-border-radius' ) . ' !important; }'; }
    164                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol-size' ) != '' ) { $css .= '.ewd-ufaq-faq-title .ewd-ufaq-post-margin-symbol span { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-toggle-symbol-size' ) . ' !important; }'; }
    165                        
    166                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-background-color' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { background-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-background-color' ) . ' !important; }'; }
    167                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-font-color' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-font-color' ) . ' !important; }'; }
    168                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-size' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { border-width: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-size' ) . ' !important; }'; }
    169                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-color' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { border-color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-color' ) . ' !important; }'; }
    170                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-radius' ) != '' ) { $css .= '.ewd-ufaq-category-post-margin-symbol { border-radius: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-border-radius' ) . ' !important; }'; }
    171                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol-size' ) != '' ) { $css .= '.ewd-ufaq-faq-category-title .ewd-ufaq-category-post-margin-symbol span { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-toggle-symbol-size' ) . ' !important; }'; }
    172                        
    173                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) != '' ) {
    174 
    175                                 $css .= ".ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-block.ewd-ufaq-post-active a,.ewd-ufaq-faq-display-style-block:hover, .ewd-ufaq-faq-display-style-block:hover a, .ewd-ufaq-faq-display-style-block:hover $heading_type { background-color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) . ' !important; }';
    176                                 $css .= ".ewd-ufaq-faq-display-style-border_block.ewd-ufaq-post-active, .ewd-ufaq-faq-display-style-border_block:hover, .ewd-ufaq-faq-display-style-border_block:hover $heading_type { background-color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) . ' !important; }';
    177                                 $css .= ".ewd-ufaq-faq-display-style-border_block .ewd-ufaq-faq-body { border-color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-background-color' ) . ' !important; }';
    178                                 $css .= ".ewd-ufaq-faq-display-style-border_block .comment-reply-title, .ewd-ufaq-faq-display-style-border_block:hover .comment-reply-title { background-color: transparent !important; }";
    179                         }
    180 
    181                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-block-font-color' ) != '' ) {
    182 
    183                                 $css .= ".ewd-ufaq-faq-display-style-block:hover .ewd-ufaq-post-margin-symbol, .ewd-ufaq-category-post-margin-symbol, .ewd-ufaq-faq-display-style-block:hover $heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-font-color' ) . ' !important; }';
    184                                 $css .= ".ewd-ufaq-faq-display-style-border_block:hover .ewd-ufaq-post-margin-symbol, .ewd-ufaq-category-post-margin-symbol, .ewd-ufaq-faq-display-style-border_block:hover $heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-block-font-color' ) . ' !important; }';
    185                         }
    186 
    187                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-font' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-font' ) . ' !important; }'; }
    188                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-size' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-size' ) . ' !important; }'; }
    189                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-color' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-font-color' ) . ' !important; }'; }
    190                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-margin' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-margin' ) . ' !important; }'; }
    191                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-list-padding' ) != '' ) { $css .= '.ewd-ufaq-faq-header-title a { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-list-padding' ) . ' !important; }'; }
    192 
    193                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-font' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { font-family: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-font' ) . ' !important; }'; }
    194                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-size' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { font-size: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-size' ) . ' !important; }'; }
    195                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-color' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-font-color' ) . ' !important; }'; }
    196                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-margin' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { margin: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-margin' ) . ' !important; }'; }
    197                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-padding' ) != '' ) { $css .= "div.ewd-ufaq-faq-title $heading_type { padding: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-padding' ) . ' !important; }'; }
    198                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-question-icon-top-margin' ) != '' ) { $css .= ".ewd-ufaq-post-margin-symbol { margin-top: " . $ewd_ufaq_controller->settings->get_setting( 'styling-question-icon-top-margin' ) . ' !important; }'; }
    199                        
    200                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font' ) . ' !important; }'; }
    201                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-size' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-size' ) . ' !important; }'; }
    202                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-color' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-font-color' ) . ' !important; }'; }
    203                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-margin' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-margin' ) . ' !important; }'; }
    204                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-answer-padding' ) != '' ) { $css .= 'div.ewd-ufaq-faq-post p { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-answer-padding' ) . ' !important; }'; }
    205 
    206                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font' ) . ' !important; }'; }
    207                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-size' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-size' ) . ' !important; }'; }
    208                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-color' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-font-color' ) . ' !important; }'; }
    209                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-margin' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-margin' ) . ' !important; }'; }
    210                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-padding' ) != '' ) { $css .= 'div.ewd-ufaq-author-date { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-postdate-padding' ) . ' !important; }'; }
    211 
    212                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font' ) != '' ) { $css .= "div.ewd-ufaq-faq-category-title $category_heading_type { font-family: " . $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font' ) . ' !important; }'; }
    213                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-size' ) != '' ) { $css .= "div.ewd-ufaq-faq-category-title $category_heading_type { font-size: " . $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-size' ) . ' !important; }'; }
    214                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-color' ) != '' ) { $css .= "div.ewd-ufaq-faq-category-title $category_heading_type { color: " . $ewd_ufaq_controller->settings->get_setting( 'styling-category-heading-font-color' ) . ' !important; }'; }
    215                        
    216                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-font' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { font-family: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-font' ) . ' !important; }'; }
    217                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-size' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { font-size: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-size' ) . ' !important; }'; }
    218                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-color' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { color: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-font-color' ) . ' !important; }'; }
    219                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-margin' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { margin: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-margin' ) . ' !important; }'; }
    220                         if ( $ewd_ufaq_controller->settings->get_setting( 'styling-category-padding' ) != '' ) { $css .= 'div.ewd-ufaq-faq-categories, div.ewd-ufaq-faq-tags { padding: ' . $ewd_ufaq_controller->settings->get_setting( 'styling-category-padding' ) . ' !important; }'; }
    221 
    222                         $css .= $ewd_ufaq_controller->settings->get_setting( 'custom-css' );
    223 
    224                 if( ! empty( $css ) ) {
    225                         echo '<style>';
    226                                 echo $css;
    227                         echo '</style>';
     192                // The Basic settings Custom CSS box is a Free feature, distinct from paid
     193                // per-element styling controls. Keep it effective without Helper or rights.
     194                $css = $this->get_option( 'custom-css' );
     195                $css = apply_filters( 'ewd_ufaq_custom_styles', is_string( $css ) ? $css : '', $this );
     196                if ( is_string( $css ) && '' !== $css ) {
     197                        echo '<style>' . str_ireplace( '</style', '', $css ) . '</style>';
    228198                }
    229199        }
Note: See TracChangeset for help on using the changeset viewer.