Changeset 3463226
- Timestamp:
- 02/17/2026 08:47:16 AM (6 weeks ago)
- Location:
- display-post-types
- Files:
-
- 84 added
- 6 edited
-
tags/3.2.6 (added)
-
tags/3.2.6/backend (added)
-
tags/3.2.6/backend/admin (added)
-
tags/3.2.6/backend/admin/class-options.php (added)
-
tags/3.2.6/backend/admin/class-shortcodegen.php (added)
-
tags/3.2.6/backend/admin/templates (added)
-
tags/3.2.6/backend/admin/templates/faq.php (added)
-
tags/3.2.6/backend/admin/templates/home.php (added)
-
tags/3.2.6/backend/admin/templates/main.php (added)
-
tags/3.2.6/backend/admin/templates/shortcode.php (added)
-
tags/3.2.6/backend/admin/templates/sidebar.php (added)
-
tags/3.2.6/backend/class-register.php (added)
-
tags/3.2.6/backend/css (added)
-
tags/3.2.6/backend/css/admin-options-rtl.css (added)
-
tags/3.2.6/backend/css/admin-options.css (added)
-
tags/3.2.6/backend/css/blocks-rtl.css (added)
-
tags/3.2.6/backend/css/blocks.css (added)
-
tags/3.2.6/backend/css/widgets-rtl.css (added)
-
tags/3.2.6/backend/css/widgets.css (added)
-
tags/3.2.6/backend/inc (added)
-
tags/3.2.6/backend/inc/class-block.php (added)
-
tags/3.2.6/backend/inc/class-misc.php (added)
-
tags/3.2.6/backend/inc/class-shortcode.php (added)
-
tags/3.2.6/backend/inc/class-widget.php (added)
-
tags/3.2.6/backend/inc/notifications.php (added)
-
tags/3.2.6/backend/js (added)
-
tags/3.2.6/backend/js/admin.build.js (added)
-
tags/3.2.6/backend/js/admin.js (added)
-
tags/3.2.6/backend/js/blocks.build.js (added)
-
tags/3.2.6/backend/js/blocks.js (added)
-
tags/3.2.6/backend/js/partials (added)
-
tags/3.2.6/backend/js/partials/admin (added)
-
tags/3.2.6/backend/js/partials/admin/changedetect.js (added)
-
tags/3.2.6/backend/js/partials/admin/colorpicker.js (added)
-
tags/3.2.6/backend/js/partials/admin/variables.js (added)
-
tags/3.2.6/backend/js/partials/blocks (added)
-
tags/3.2.6/backend/js/partials/blocks/components (added)
-
tags/3.2.6/backend/js/partials/blocks/components/dpt-accordion.js (added)
-
tags/3.2.6/backend/js/partials/blocks/components/dpt-foursides.js (added)
-
tags/3.2.6/backend/js/partials/blocks/components/dpt-tabs.js (added)
-
tags/3.2.6/backend/js/partials/blocks/edit.js (added)
-
tags/3.2.6/backend/js/partials/blocks/index.js (added)
-
tags/3.2.6/backend/js/partials/blocks/mcc.js (added)
-
tags/3.2.6/backend/js/partials/widgets (added)
-
tags/3.2.6/backend/js/partials/widgets/changedetect.js (added)
-
tags/3.2.6/backend/js/partials/widgets/colorpicker.js (added)
-
tags/3.2.6/backend/js/partials/widgets/variables.js (added)
-
tags/3.2.6/backend/js/widgets.build.js (added)
-
tags/3.2.6/backend/js/widgets.js (added)
-
tags/3.2.6/backend/js/wp-color-picker-alpha.min.js (added)
-
tags/3.2.6/display-post-types.php (added)
-
tags/3.2.6/frontend (added)
-
tags/3.2.6/frontend/class-register.php (added)
-
tags/3.2.6/frontend/css (added)
-
tags/3.2.6/frontend/css/style-rtl.css (added)
-
tags/3.2.6/frontend/css/style.css (added)
-
tags/3.2.6/frontend/inc (added)
-
tags/3.2.6/frontend/inc/class-display.php (added)
-
tags/3.2.6/frontend/inc/class-instance-counter.php (added)
-
tags/3.2.6/frontend/inc/class-loader.php (added)
-
tags/3.2.6/frontend/inc/class-misc.php (added)
-
tags/3.2.6/frontend/js (added)
-
tags/3.2.6/frontend/js/bricklayer.build.js (added)
-
tags/3.2.6/frontend/js/flickity.pkgd.js (added)
-
tags/3.2.6/frontend/js/flickity.pkgd.min.js (added)
-
tags/3.2.6/frontend/js/partials (added)
-
tags/3.2.6/frontend/js/partials/dpt.js (added)
-
tags/3.2.6/frontend/js/partials/index.js (added)
-
tags/3.2.6/frontend/js/scripts.build.js (added)
-
tags/3.2.6/frontend/js/scripts.js (added)
-
tags/3.2.6/helper (added)
-
tags/3.2.6/helper/class-getters.php (added)
-
tags/3.2.6/helper/class-icon-loader.php (added)
-
tags/3.2.6/helper/class-markup.php (added)
-
tags/3.2.6/helper/class-security.php (added)
-
tags/3.2.6/helper/class-singleton.php (added)
-
tags/3.2.6/helper/class-utility.php (added)
-
tags/3.2.6/helper/class-validation.php (added)
-
tags/3.2.6/info (added)
-
tags/3.2.6/info/credits.txt (added)
-
tags/3.2.6/info/license.txt (added)
-
tags/3.2.6/lang (added)
-
tags/3.2.6/lang/display-post-types.pot (added)
-
tags/3.2.6/readme.txt (added)
-
trunk/backend/class-register.php (modified) (14 diffs)
-
trunk/backend/js/admin.build.js (modified) (1 diff)
-
trunk/backend/js/partials/admin/changedetect.js (modified) (7 diffs)
-
trunk/display-post-types.php (modified) (2 diffs)
-
trunk/frontend/class-register.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
display-post-types/trunk/backend/class-register.php
r3437759 r3463226 93 93 94 94 /** 95 * Ensure the current user has sufficient capabilities to perform admin actions. 96 */ 97 private function require_capabilities() { 98 if ( current_user_can( 'manage_options' ) ) { 99 return; 100 } 101 102 wp_send_json_error( 103 array( 104 'error' => __( 'You are not allowed to perform this action.', 'display-post-types' ), 105 ), 106 403 107 ); 108 } 109 110 /** 95 111 * Register the custom Widget. 96 112 * … … 203 219 } 204 220 205 if ( defined( 'DPT_PRO_VERSION' ) && version_compare( DPT_PRO_VERSION, ' 1.4.6', '<' ) ) {221 if ( defined( 'DPT_PRO_VERSION' ) && version_compare( DPT_PRO_VERSION, '7', '<' ) ) { 206 222 ?> 207 223 <div class="notice-warning notice is-dismissible pp-welcome-notice"> 208 <p><?php esc_html_e( 'There is an update available to Display Post Types Pro. Please update to Display Post Types Pro v1.4. 6.', 'display-post-types' ); ?></p>224 <p><?php esc_html_e( 'There is an update available to Display Post Types Pro. Please update to Display Post Types Pro v1.4.7.', 'display-post-types' ); ?></p> 209 225 </div> 210 226 <?php … … 230 246 public function get_dpt_preview() { 231 247 check_ajax_referer( 'dpt-admin-ajax-nonce', 'security' ); 248 $this->require_capabilities(); 232 249 $args = isset( $_POST['data'] ) ? Security::escape_all( wp_unslash( $_POST['data'] ) ) : false; 233 250 if ( false === $args || ! is_array( $args ) ) { 234 echo wp_json_encode( array( 235 'error' => __( 'Invalid data provided', 'display-post-types' ), 236 ) ); 237 wp_die(); 251 wp_send_json_error( 252 array( 253 'message' => __( 'Invalid data provided', 'display-post-types' ), 254 ) 255 ); 238 256 } 239 257 ob_start(); … … 241 259 $content = ob_get_clean(); 242 260 $dpt = Instance_Counter::get_instance(); 243 echo wp_json_encode( array( 244 'markup' => $content, 245 'instances' => $dpt->get_script_data(), 246 ) ); 247 wp_die(); 261 wp_send_json_success( 262 array( 263 'markup' => $content, 264 'instances' => $dpt->get_script_data(), 265 ) 266 ); 248 267 } 249 268 … … 255 274 public function get_shortcode_form() { 256 275 check_ajax_referer( 'dpt-admin-ajax-nonce', 'security' ); 276 $this->require_capabilities(); 257 277 $shcode_gen = ShortCodeGen::get_instance(); 258 278 $shortcode_list = $shcode_gen->shortcode_settings; … … 261 281 $shcode_gen->form( $instance ); 262 282 $form = ob_get_clean(); 263 echo wp_json_encode( array( 264 'form' => $form, 265 'instance' => $instance, 266 ) ); 267 wp_die(); 283 wp_send_json_success( 284 array( 285 'form' => $form, 286 'instance' => $instance, 287 ) 288 ); 268 289 } 269 290 … … 275 296 public function create_new_shortcode() { 276 297 check_ajax_referer( 'dpt-admin-ajax-nonce', 'security' ); 298 $this->require_capabilities(); 277 299 $args = isset( $_POST['data'] ) ? Security::sanitize_all( wp_unslash( $_POST['data'] ) ) : false; 278 300 $inst = isset( $_POST['instance'] ) ? absint(wp_unslash( $_POST['instance'] )) : false; 279 301 if ( false === $args || false === $inst ) { 280 echo wp_json_encode( array( 281 'error' => __( 'Shortcode data not provided correctly.', 'display-post-types' ), 282 ) ); 283 wp_die(); 302 wp_send_json_error( 303 array( 304 'message' => __( 'Shortcode data not provided correctly.', 'display-post-types' ), 305 ) 306 ); 284 307 } 285 308 $shcode_gen = ShortCodeGen::get_instance(); … … 288 311 $shcode_gen->shortcode_settings = $shortcode_list; 289 312 $shcode_gen->save(); 290 echo wp_json_encode( array( 291 'success' => __( 'Shortcode created successfully.', 'display-post-types' ), 292 ) ); 293 wp_die(); 313 wp_send_json_success( 314 array( 315 'message' => __( 'Shortcode created successfully.', 'display-post-types' ), 316 ) 317 ); 294 318 } 295 319 … … 301 325 public function load_shortcode() { 302 326 check_ajax_referer( 'dpt-admin-ajax-nonce', 'security' ); 327 $this->require_capabilities(); 303 328 $instance = isset( $_POST['instance'] ) ? absint( wp_unslash( $_POST['instance'] ) ) : false; 304 329 if ( false === $instance ) { 305 echo wp_json_encode( array( 306 'error' => __( 'Invalid data provided', 'display-post-types' ), 307 ) ); 308 wp_die(); 330 wp_send_json_error( 331 array( 332 'message' => __( 'Invalid data provided', 'display-post-types' ), 333 ) 334 ); 309 335 } 310 336 $shcode_gen = ShortCodeGen::get_instance(); … … 318 344 $form = ob_get_clean(); 319 345 $dpt = Instance_Counter::get_instance(); 320 echo wp_json_encode( array( 321 'form' => $form, 322 'preview' => $preview, 323 'instance' => $instance, 324 'instances' => $dpt->get_script_data(), 325 ) ); 326 wp_die(); 346 wp_send_json_success( 347 array( 348 'form' => $form, 349 'preview' => $preview, 350 'instance' => $instance, 351 'instances' => $dpt->get_script_data(), 352 ) 353 ); 327 354 } 328 355 … … 334 361 public function delete_shortcode() { 335 362 check_ajax_referer( 'dpt-admin-ajax-nonce', 'security' ); 363 $this->require_capabilities(); 336 364 $instance = isset( $_POST['instance'] ) ? absint( wp_unslash( $_POST['instance'] ) ) : false; 337 365 if ( false === $instance ) { 338 echo wp_json_encode( array( 339 'error' => __( 'Invalid data provided', 'display-post-types' ), 340 ) ); 341 wp_die(); 366 wp_send_json_error( 367 array( 368 'message' => __( 'Invalid data provided', 'display-post-types' ), 369 ) 370 ); 342 371 } 343 372 $shcode_gen = ShortCodeGen::get_instance(); … … 348 377 $shcode_gen->save(); 349 378 } 350 echo wp_json_encode( array( 351 'success' => true, 352 ) ); 353 wp_die(); 379 wp_send_json_success(); 354 380 } 355 381 … … 361 387 public function update_shortcode() { 362 388 check_ajax_referer( 'dpt-admin-ajax-nonce', 'security' ); 389 $this->require_capabilities(); 363 390 $args = isset( $_POST['data'] ) ? Security::sanitize_all( wp_unslash( $_POST['data'] ) ) : false; 364 391 $inst = isset( $_POST['instance'] ) ? absint(wp_unslash( $_POST['instance'] )) : false; … … 366 393 $shortcode_list = $shcode_gen->shortcode_settings; 367 394 if ( false === $args || false === $inst || ! isset( $shortcode_list[ $inst ] ) ) { 368 echo wp_json_encode( array( 369 'error' => __( 'Shortcode data not provided correctly.', 'display-post-types' ), 370 ) ); 371 wp_die(); 395 wp_send_json_error( 396 array( 397 'message' => __( 'Shortcode data not provided correctly.', 'display-post-types' ), 398 ) 399 ); 372 400 } 373 401 $shortcode_list[ $inst ] = $args; 374 402 $shcode_gen->shortcode_settings = $shortcode_list; 375 403 $shcode_gen->save(); 376 echo wp_json_encode( array( 377 'success' => __( 'Shortcode updated successfully.', 'display-post-types' ), 378 ) ); 379 wp_die(); 404 wp_send_json_success( 405 array( 406 'message' => __( 'Shortcode updated successfully.', 'display-post-types' ), 407 ) 408 ); 380 409 } 381 410 -
display-post-types/trunk/backend/js/admin.build.js
r3437759 r3463226 1 (()=>{"use strict";function t(t,e,s){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}const e=class{constructor(e){t(this,"options",null),t(this,"slides",[]),t(this,"currentIndex",0),t(this,"autoSlideTime",0),t(this,"autoSlideTimeout",null),t(this,"resizeTimeout",null),e&&e.element&&e.slides&&(this.options=e,this.autoSlideTime=this.options.autoSlideTime||0,this.sliderMarkup(),this.sliderEvents(),this.startAutoSlide())}sliderMarkup(){const t=this.getElement(this.options.element,null,!0),e=t?this.getElement(this.options.slides,t,!1):null,s='<svg class="dpt-button-icon" viewBox="0 0 100 100"><path d="M 10,50 L 60,100 L 70,90 L 30,50 L 70,10 L 60,0 Z" class="arrow"></path></svg>',i='\n <button class="dpt-slider-button dpt-slider-prev-button" type="button" aria-label="Previous slide">'.concat(s,'</button>\n <button class="dpt-slider-button dpt-slider-next-button" type="button" aria-label="Next slide">').concat(s,"</button>\n ");if(e&&e.length>0){const s=document.createElement("div"),n=e[0].offsetHeight;s.classList.add("dpt-slider-viewport"),s.style.height=n+"px",s.innerHTML='<div class="dpt-slider-container"></div>';const o=s.querySelector(".dpt-slider-container");e.forEach((t=>o.appendChild(t))),s.innerHTML+=i,t.appendChild(s)}else console.error("Invalid element or slides")}sliderEvents(){const t=this.getElement(this.options.element,null,!0),e=t?t.querySelector(".dpt-slider-viewport"):null;if(!e)return;if(this.slides=this.getElement(this.options.slides,e,!1),this.slides.length<=1)return;const s=e.parentElement.querySelector(".dpt-slider-prev-button"),i=e.parentElement.querySelector(".dpt-slider-next-button");this.slides[this.currentIndex].classList.add("is-selected"),s.addEventListener("click",(()=>{this.changeSlide(!1)})),i.addEventListener("click",(()=>{this.changeSlide(!0)}));let n=0;e.addEventListener("touchstart",(function(t){n=t.touches[0].clientX})),e.addEventListener("touchend",(t=>{const e=t.changedTouches[0].clientX,s=n-e;s>20?this.changeSlide(!1):s<-20&&this.changeSlide(!0)})),e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowLeft":this.changeSlide(!1);break;case"ArrowRight":this.changeSlide(!0)}})),window.addEventListener("resize",function(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.dptStyleUpdate.bind(this),100)}.bind(this))}dptStyleUpdate(){const t=this.slides[0]?this.slides[0].closest(".dpt-slider-viewport"):null,e=t.querySelectorAll(".dpt-thumbnail-clone img");if(!t)return;const s=this.slides[this.currentIndex].offsetHeight,i=this.slides[this.currentIndex].offsetWidth;t.style.height=s+"px",e.forEach((t=>{t.style.height=s+"px",t.style.width=i+"px"}))}changeSlide(t){const e=t?this.currentIndex+1:this.currentIndex-1,s=t?"dpt-slider-next":"dpt-slider-prev",i=this.slides[0]?this.slides[0].closest(".dpt-slider-viewport"):null;if(!i)return;i.classList.remove("dpt-slider-next","dpt-slider-prev"),i.classList.add(s),this.slides[this.currentIndex].classList.remove("is-selected"),this.currentIndex=(e+this.slides.length)%this.slides.length;const n=this.slides[this.currentIndex].offsetHeight;i.style.height=n+"px",this.slides[this.currentIndex].classList.add("is-selected"),this.startAutoSlide()}startAutoSlide(){this.autoSlideTime>0&&(clearInterval(this.autoSlideTimeout),this.autoSlideTimeout=setInterval((()=>{this.changeSlide(!0)}),this.autoSlideTime))}getElement(t,e,s=!1){if(!t)return null;const i=e?s?e.querySelector.bind(e):e.querySelectorAll.bind(e):s?document.querySelector.bind(document):document.querySelectorAll.bind(document);return t instanceof Element||t instanceof Document?t:"string"==typeof t?i(t):null}};class s{constructor(t,e=document){this.elements="string"==typeof t?this.get(t,e):[t]}static async sendAjaxRequest(t,e,s=console.error){const i=new URLSearchParams;for(const t in e)"object"==typeof e[t]?i.append(t,JSON.stringify(e[t])):i.append(t,e[t]);try{const e=await fetch(t,{method:"POST",body:i,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if(!e.ok)throw new Error("Network response was not ok");return await e.json()}catch(t){return s(t.message),null}}static template(t,e){return t.replace(/\{\{(\w+)\}\}/g,((t,s)=>e[s]||""))}static strToHTML(t){const e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}static escapeHtml(t){return t.replace(/</g,"<").replace(/>/g,">")}static get_icon(t,e=""){const s=document.querySelector("#icon-".concat(t)),i=s?s.getAttribute("viewBox"):"0 0 24 24";return s?'<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-'.concat(t," ").concat(e,'" aria-hidden="true" role="img" focusable="false" viewBox="').concat(i,'">').concat(s.innerHTML,"</svg>"):""}static addImageAttrs(t){Array.prototype.slice.call(t.querySelectorAll(".dpt-thumbnail")).forEach((t=>{const e=t.querySelector("img");if(!e)return;const s=e.getAttribute("data-dpt-src"),i=e.getAttribute("data-dpt-srcset");if(!s||!i)return;const n=t.offsetWidth;e.setAttribute("sizes","".concat(n+100,"px")),e.setAttribute("src",s),e.setAttribute("srcset",i)}))}}const i=(t,e=document)=>new s(t,e);Object.getOwnPropertyNames(s).forEach((t=>{"function"==typeof s[t]&&"prototype"!==t&&(i[t]=s[t])}));const n=class{constructor(t){this.elem=t,this.instance=this.elem.id.replace("dpt-wrapper-",""),this.data=window.dptScriptData||{},this.instanceData=this.data?.instances?.[this.instance]||{},this.posts=this.elem.querySelectorAll(".dpt-entry"),this.addTaxonomyFilters(),this.events()}events(){const t=this,e=this.elem.parentElement;let s="",i=null,n=null;const o=e.querySelector(".dpt-hsearch-btn"),r=e.querySelector(".dpt-hfilter-btn"),d=e.querySelector(".dpt-hprev-btn"),a=e.querySelector(".dpt-hnext-btn"),c=e.querySelector(".dpt-hsearch-close"),l=e.querySelector(".dpt-hfilter-close"),p=e.querySelector(".dpt-hsearch-input"),h=e.querySelector(".dpt-taxonomy-hfilter");o&&o.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.disabled=!0})),e.classList.add("dpt-hsearch-open"),p&&p.focus()}.bind(this)),c&&c.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.classList.contains("is-disabled")||(t.disabled=!1)})),e.classList.remove("dpt-hsearch-open"),p.value="",p.dispatchEvent(new Event("input"))}.bind(this)),r&&r.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.disabled=!0})),e.classList.toggle("dpt-hfilter-open")}.bind(this)),l&&l.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.classList.contains("is-disabled")||(t.disabled=!1)})),e.classList.remove("dpt-hfilter-open"),h&&(h.value="",h.dispatchEvent(new Event("change")))}.bind(this)),p&&p.addEventListener("input",(function(){if(this.value!==s){let e=[];s=this.value,clearTimeout(i),i=setTimeout(function(){const i=s.trim().toLowerCase(),n=t.elem.querySelector(".dpt-featured-wrap");n&&n.classList.remove("dpt-hidden"),i?(t.elem.querySelectorAll(".dpt-ajax-entry").forEach((function(t){t.remove()})),t.posts.forEach((function(t){if(t.getAttribute("data-title").includes(i)){const s=t.getAttribute("data-id");e.push(parseInt(s)),t.classList.remove("dpt-hidden")}else t.classList.add("dpt-hidden")}))):(t.elem.querySelectorAll(".dpt-ajax-entry").forEach((function(t){t.remove()})),t.posts.forEach((function(t){t.classList.remove("dpt-hidden")})));const o=n?n.querySelector(".dpt-entry"):null;o&&o.classList.contains("dpt-hidden")&&n.classList.add("dpt-hidden")}.bind(this),100),clearTimeout(n),n=setTimeout((function(){t.searchPosts(s,e)}),500)}else clearTimeout(i)})),h&&h.addEventListener("change",(function(e){const s=h.value;t.elem.querySelectorAll(".dpt-ajax-entry").forEach((function(t){t.remove()}));const i=t.elem.querySelector(".dpt-featured-wrap");if(i&&i.classList.remove("dpt-hidden"),s){let o=[];const r=e.target.options[e.target.selectedIndex],d=r.textContent,a=r.closest(".dpt-optgroup"),c=a?a.getAttribute("label"):null;t.posts.forEach((function(t){const e=t.getAttribute("data-"+c);if(e&&e.includes(d.toLowerCase())){const e=t.getAttribute("data-id");o.push(parseInt(e)),t.classList.remove("dpt-hidden")}else t.classList.add("dpt-hidden")}));const l=i?i.querySelector(".dpt-entry"):null;l&&l.classList.contains("dpt-hidden")&&i.classList.add("dpt-hidden"),clearTimeout(n),n=setTimeout((function(){t.filterPosts(s,c,o)}),100)}else t.posts.forEach((function(t){t.classList.remove("dpt-hidden")}))})),d&&d.addEventListener("click",(function(){t.loadPreviousPage(this)})),a&&a.addEventListener("click",(function(){t.loadNextPage(this)}))}addTaxonomyFilters(){const t=this.elem.parentElement.querySelector(".dpt-header-filter"),e=t?t.querySelector(".dpt-filter-menu"):null;if(!e)return;const s=this.instanceData.taxonomies||{},i=Object.keys(s),n='\n\t\t\t<select class="dpt-taxonomy-hfilter">\n\t\t\t\t<option value="">All</option>\n\t\t\t\t'.concat(i.map((t=>'\n\t\t\t\t\t<optgroup label="'.concat(t,'" class="dpt-optgroup">\n\t\t\t\t\t\t').concat(Object.keys(s[t]).map((e=>'<option value="'.concat(s[t][e],'">').concat(e,"</option>"))).join(""),"\n\t\t\t\t\t</optgroup>"))).join(""),"\n\t\t\t</select>\n\t\t");e.innerHTML=n}async searchPosts(t,e){const s=this.elem.querySelector(".dpt-normal-wrap")||this.elem;if(!(t=t.trim().toLowerCase()))return;const n={...this.data?.instances?.[this.instance]?.query_args}||{},o={...this.data?.instances?.[this.instance]?.args}||{};n.s=t,n.post__in=n.post__in&&Array.isArray(n.post__in)?n.post__in.filter((t=>!e.includes(t))):[];const r={action:"dpt_fetch_posts",nonce:this.data.security,query:n,args:o},d=this.elem.parentElement.querySelector(".dpt-fetch-running");d&&d.classList.add("dpt-show");let a=await i.sendAjaxRequest(this.data.ajaxurl,r);d&&d.classList.remove("dpt-show"),a&&a.data&&(a=i.strToHTML("<div>"+a.data+"</div>"),s.append(...a.children),s.querySelectorAll(".dpt-ajax-entry").forEach((function(t){i.addImageAttrs(t)})))}async filterPosts(t,e,s){const n=this.elem.querySelector(".dpt-normal-wrap")||this.elem,o={...this.data?.instances?.[this.instance]?.query_args}||{},r={...this.data?.instances?.[this.instance]?.args}||{},d={taxonomy:e,field:"term_id",terms:[t]};o.tax_query=[d],o.post__in=o.post__in&&Array.isArray(o.post__in)?o.post__in.filter((t=>!s.includes(t))):[];const a={action:"dpt_fetch_posts",nonce:this.data.security,query:o,args:r},c=this.elem.parentElement.querySelector(".dpt-fetch-running");c&&c.classList.add("dpt-show");let l=await i.sendAjaxRequest(this.data.ajaxurl,a);c&&c.classList.remove("dpt-show"),l&&l.data&&(l=i.strToHTML("<div>"+l.data+"</div>"),n.append(...l.children),n.querySelectorAll(".dpt-ajax-entry").forEach((function(t){i.addImageAttrs(t)})))}async loadPreviousPage(t){const e=this.elem.querySelector(".dpt-normal-wrap"),s=e||this.elem,n=this.instanceData.offset||0;let o=this.instanceData.lot_size||10;if(o=e?o-1:o,n<=0)return;let r=n-o;r=e?Math.max(1,r):r;const d={...this.data?.instances?.[this.instance]?.query_args}||{},a={...this.data?.instances?.[this.instance]?.args}||{};d.offset=e?Math.max(1,r):r,d.posts_per_page=e?d.posts_per_page-1:d.posts_per_page;const c={action:"dpt_fetch_posts",nonce:this.data.security,query:d,args:a},l=t.querySelector(".icon-dpt-spin"),p=t.querySelector(".icon-dpt-previous");l&&p&&(l.classList.remove("dpt-hidden"),p.classList.add("dpt-hidden"));let h=await i.sendAjaxRequest(this.data.ajaxurl,c);l&&p&&(l.classList.add("dpt-hidden"),p.classList.remove("dpt-hidden")),h&&h.data&&(h=i.strToHTML("<div>"+h.data+"</div>"),s.replaceChildren(...h.children),this.posts=this.elem.querySelectorAll(".dpt-entry"),this.posts.forEach((function(t){t.classList.contains("dpt-ajax-entry")&&(t.classList.remove("dpt-ajax-entry"),i.addImageAttrs(t))})),this.instanceData.offset=r,r<=0||e&&r<=1?(t.classList.add("is-disabled"),t.setAttribute("disabled","disabled")):(t.classList.remove("is-disabled"),t.removeAttribute("disabled")),t.nextSibling.classList.remove("is-disabled"),t.nextSibling.removeAttribute("disabled"))}async loadNextPage(t){const e=this.elem.querySelector(".dpt-normal-wrap"),s=e||this.elem;let n=this.instanceData.offset||0,o=this.instanceData.lot_size||10;n=e&&0===n?1:n,o=e?o-1:o;const r=this.instanceData.total||0;if(n+o>=r)return;const d=n+o,a={...this.data?.instances?.[this.instance]?.query_args}||{},c={...this.data?.instances?.[this.instance]?.args}||{};a.offset=d,a.posts_per_page=e?a.posts_per_page-1:a.posts_per_page;const l={action:"dpt_fetch_posts",nonce:this.data.security,query:a,args:c},p=t.querySelector(".icon-dpt-spin"),h=t.querySelector(".icon-dpt-next");p&&h&&(p.classList.remove("dpt-hidden"),h.classList.add("dpt-hidden"));let u=await i.sendAjaxRequest(this.data.ajaxurl,l);p&&h&&(p.classList.add("dpt-hidden"),h.classList.remove("dpt-hidden")),u&&u.data&&(u=i.strToHTML("<div>"+u.data+"</div>"),s.replaceChildren(...u.children),this.posts=this.elem.querySelectorAll(".dpt-entry"),this.posts.forEach((function(t){t.classList.contains("dpt-ajax-entry")&&(t.classList.remove("dpt-ajax-entry"),i.addImageAttrs(t))})),this.instanceData.offset=d,d>=r-o?(t.classList.add("is-disabled"),t.setAttribute("disabled","disabled")):(t.classList.remove("is-disabled"),t.removeAttribute("disabled")),t.previousSibling.classList.remove("is-disabled"),t.previousSibling.removeAttribute("disabled"))}},o=class{constructor(){const t=this;this.elems=Array.prototype.slice.call(document.querySelectorAll(".dpt-wrapper")),this.elems.forEach((t=>{this.initializeProFunctionality(t)})),document.addEventListener("animationstart",(function(e){if("dptAdded"!==e.animationName)return;const s=e.target;s.classList.contains("dpt-wrapper")&&(s.classList.contains("dpt-pro-added")||t.initializeProFunctionality(s))}),!1)}initializeProFunctionality(t){if(t.classList.add("dpt-pro-added"),t.classList.contains("dpt-pro-slider1"))this.sliderNavFunctionality(t);else if(t.classList.contains("dpt-custom-slider")){t.classList.contains("dpt-pro-slider3")&&this.sliceImages(t);const s=parseInt(t.getAttribute("data-autotime")),i={element:t,slides:".dpt-entry"};s&&(i.autoSlideTime=s),this.flicKity=new e(i)}else t.classList.contains("dpt-grid1")&&t.querySelectorAll(".dpt-featured-content").forEach((t=>{if(t.clientHeight){const e=Array.from(t.parentElement.querySelectorAll(":scope > .sub-entry"));e.length>0&&(e[e.length-1].style.flex=1)}}));new n(t)}sliderNavFunctionality(t){const e=t.closest(".dpt-pro-slider-wrapper"),s=e.querySelector(".dpt-slider-nav"),i=e.querySelector(".dpt-slider");s&&i&&new Flickity(s,{cellAlign:"center",contain:!0,pageDots:!1,asNavFor:i,prevNextButtons:!1})}sliceImages(t){t.querySelectorAll(".dpt-thumbnail-inner").forEach((t=>{const e=t.querySelector("img"),s=e?e.src:"",i=t.clientWidth,n=t.clientHeight;let o=250,r='<div class="dpt-thumbnail-clones">';for(let t=0;t<5;t++){const e=20*t,d=-1*t*100;r+='<div class="dpt-thumbnail-clone" style="animation-duration: '.concat(o,"ms; left: ").concat(e,'%"><img src="').concat(s,' " width="').concat(i,'" height="').concat(n,'" style="width: ').concat(i,"px; height: ").concat(n,"px; left: ").concat(d,'%"></div>'),o+=150}r+="</div>",e.insertAdjacentHTML("afterend",r),t.classList.add("dpt-slicer")}))}},r=window.dptShortgenData||{},d={stylesSupport:r.styleSupport||{},ajaxUrl:r.ajaxurl||"",security:r.security||"",isPremium:r.isPremium||!1,isStyleSupport:function(t,e){const s=this.stylesSupport[t];return void 0!==s&&s.includes(e)}},a=class{constructor(){this.muChecklistTimer=null,this.newFeedback=jQuery("#dpt-action-feedback"),this.serverTimeOut=null,this.events()}events(){const t=this,e=jQuery("#dpt-options-module-shortcode"),s=jQuery(document);e.on("change","select.dpt-post-type",(function(){t.postTypeChange(jQuery(this))})),e.on("change","select.dpt-taxonomy",(function(){t.toggleTerms(jQuery(this))})),e.on("change","select.dpt-orderby",(function(){t.toggleCustomSort(jQuery(this))})),e.on("change","select.dpt-styles",(function(){t.styleChange(jQuery(this))})),e.on("change","select.dpt-img-aspect",(function(){t.showCroppos(jQuery(this))})),e.on("change",'input[type="checkbox"].spcheckbox',(function(){t.showElemOptions(jQuery(this))})),e.on("change",'.dpt-mu-checklist input[type="checkbox"]',(function(){t.updateMuChecklist(jQuery(this))})),e.on("change",".dpt-getval",(function(){clearTimeout(t.serverTimeOut),t.serverTimeOut=setTimeout((function(){t.updatePreview(jQuery(this))}),100)})),e.on("click","#dpt-shortcode-generator-btn",(function(){t.blankShortcodeTemplate(jQuery(this))})),e.on("click","#dpt-shortcode-generator-submit-btn",(function(){t.createNewShortcode(jQuery(this))})),e.on("click","#dpt-shortcode-generator-delete-btn",(function(){const t=e.find("#dpt-shortcode-action-modal"),s=t.find(".dpt-shortcode-action-wrapper");t.removeClass("dpt-hidden"),jQuery("html, body").animate({scrollTop:s.offset().top-200},400)})),e.on("click","#dpt-shortcode-deletion-btn",(function(){t.deleteShortcode(jQuery(this))})),e.on("click","#dpt-shortcode-deletion-cancel",(function(){e.find("#dpt-shortcode-action-modal").addClass("dpt-hidden")})),e.on("click","#dpt-shortcode-generator-update-btn",(function(){t.updateShortcode(jQuery(this))})),e.on("change","select.dpt-shortcode-dropdown",(function(){t.loadShortcode(jQuery(this))})),e.on("click",".dpt-collapse-sidebar",(function(e){e.preventDefault(),t.toggleSidebar(jQuery(this))})),e.on("click",".dpt-copy-shortcode-text",(function(e){e.preventDefault(),t.copyShortcodeText(jQuery(this))})),this.newFeedback.on("click",".dpt-error-close",(t=>{this.newFeedback.removeClass("dpt-error")})),s.on("click",".dpt-settings-toggle",(function(t){const e=jQuery(this);t.preventDefault(),e.next(".dpt-settings-content").slideToggle("fast"),e.toggleClass("toggle-active")})),s.on("click",".dpt-tab-index-item",(function(){t.tabFunctionality(jQuery(this))}))}toggleCustomSort(t){const e=t.val(),s=[".sort_custom_field_key",".sort_custom_field_type"],i=t.closest(".dpt-shortcode-form");"custom"!==e?i.find(s.join(",")).each((function(){jQuery(this).val("").hide()})):i.find(s.join(",")).show()}postTypeChange(t){const e=t.val(),s=t.closest(".dpt-shortcode-form"),i=s.find(".dpt-settings-toggle"),n=s.find(".dpt-settings-content"),o=s.find("select.dpt-taxonomy"),r=s.find("select.dpt-filter-custom-field-key"),d=s.find("select.dpt-filter-custom-field-operator"),a=s.find("input.dpt-filter-custom-field-value"),c=s.find("select.dpt-filter-custom-field-type"),l=[".post_ids",".taxonomy",".offset",".orderby",".order"],p=[".pages"];e?(i.show(),"page"===e?(n.find(p.join(",")).show().closest(".dpt-wrapper-container").show(),n.find(l.join(",")).hide().closest(".dpt-settings-content").hide().closest(".dpt-wrapper-container").hide().find(".dpt-settings-toggle").removeClass("toggle-active")):(n.find(p.join(",")).hide().closest(".dpt-settings-content").hide().closest(".dpt-wrapper-container").hide().find(".dpt-settings-toggle").removeClass("toggle-active"),n.find(l.join(",")).show().closest(".dpt-wrapper-container").show(),o.find("option").hide(),o.find(".always-visible, ."+e).show(),o.val("")),n.toggleClass("not-post","post"!==e),n.find(".terms, .relation").hide(),r.find("option").hide(),r.find(".always-visible, ."+e).show(),r.val(""),d.val(""),a.val("").prop("disabled",!1),c.prop("disabled",!1)):(i.hide(),n.find(".dpt-settings-content").hide(),n.find(".dpt-settings-toggle").removeClass("toggle-active"),n.hide())}toggleTerms(t){const e=t.closest(".dpt-settings-content"),s=t.val();s?(e.find(".terms, .relation").show(),e.find(".terms").find(".terms-checklist li").hide(),e.find(".terms").find(".terms-checklist ."+s).show()):e.find(".terms, .relation").hide()}styleChange(t){const e=t.val(),s=t.closest(".dpt-shortcode-form");this.saneDefaults(e,s),d.isStyleSupport(e,"multicol")?s.find(".col_narr").show():s.find(".col_narr").hide(),d.isStyleSupport(e,"ialign")?s.find(".img_align").show():s.find(".img_align").hide(),d.isStyleSupport(e,"slider")?s.find(".autotime").show():s.find(".autotime").hide(),d.isStyleSupport(e,"pagination")?s.find(".show_pgnation").show():s.find(".show_pgnation").hide(),d.isStyleSupport(e,"overlay")?(s.find(".text_pos_hor").show(),s.find(".text_pos_ver").show(),s.find(".title_shadow").show(),s.find(".wrapper_width").show(),"content"===s.find("select.dpt-wrapper-type").val()?s.find(".wrapper_height").show():s.find(".wrapper_height").hide()):(s.find(".text_pos_hor").hide(),s.find(".text_pos_ver").hide(),s.find(".title_shadow").hide(),s.find(".wrapper_width").hide(),s.find(".wrapper_height").hide()),s.find(".spcheckbox").each((function(){const t=jQuery(this).val();d.isStyleSupport(e,t)?jQuery(this).closest(".dpt-toggle-container").show():jQuery(this).closest(".dpt-toggle-container").hide()}))}saneDefaults(t,e){const s={"dpt-list1":["thumbnail","title","meta","excerpt"],"dpt-list2":["thumbnail","title","meta"],"dpt-pro-slider2":["thumbnail","title","meta","excerpt"],"dpt-mag1":["thumbnail","title","meta"]},i=e.find(".spcheckbox");void 0!==s[t]?i.each((function(){const e=jQuery(this).val();s[t].includes(e)?jQuery(this).prop("checked",!0).trigger("change"):jQuery(this).prop("checked",!1).trigger("change")})):i.each((function(){const t=jQuery(this).val();["thumbnail","title"].includes(t)?jQuery(this).prop("checked",!0).trigger("change"):jQuery(this).prop("checked",!1).trigger("change")})),["dpt-list1","dpt-list2","dpt-slider1","dpt-mag1"].includes(t)?e.find("select.dpt-img-aspect").val("land1").trigger("change"):["dpt-pro-slider1","dpt-pro-slider3"].includes(t)?e.find("select.dpt-img-aspect").val("wdscrn").trigger("change"):["dpt-pro-slider2"].includes(t)?e.find("select.dpt-img-aspect").val("squr").trigger("change"):e.find("select.dpt-img-aspect").val("").trigger("change")}showCroppos(t){var e=t.val(),s=t.closest(".dpt-shortcode-form");""!==e?("custom"===e?s.find(".custom_aspect").show():s.find(".custom_aspect").hide(),s.find(".image_crop").show()):(s.find(".image_crop").hide(),s.find(".custom_aspect").hide())}showElemOptions(t){const e=t.closest(".dpt-style-wrapper"),s=t.closest(".dpt-widget-option");t.prop("checked")?s.parent().find(".dpt-widget-option, .dpt-tabs-container").show():s.siblings(".dpt-widget-option, .dpt-tabs-container").hide(),this.updateStyleSup(e)}updateStyleSup(t){var e=t.find("input.spcheckbox").first().attr("data-id");if(e){var s=t.find("input.spcheckbox:checked");if(s.length){var i=s.map((function(){return this.value})).get().join(",");jQuery("#"+e).val(i).trigger("change")}else jQuery("#"+e).val("").trigger("change")}}updateMuChecklist(t){clearTimeout(this.muChecklistTimer),this.muChecklistTimer=setTimeout((()=>{const e=t.closest(".dpt-mu-checklist"),s=e.find('input[type="checkbox"]:checked').map((function(){return this.value})).get().join(",");e.find(".dpt-getval").val(s).trigger("change")}),500)}getShortcodeFormValues(){const t=jQuery("#dpt-shortcode-form"),e=t.find(".dpt-getval"),s=t.data("instance"),i={};return e.each((function(){const t=this.name.replace(/^dpt_field_name_/,"");"checkbox"===this.type?i[t]=this.checked?this.value:"":i[t]=this.value})),{instance:s,values:i}} updatePreview(t){const{instance:e,values:s}=this.getShortcodeFormValues();jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_render_preview",security:d.security,data:s},type:"POST",timeout:6e4,success:t=>{const e=JSON.parse(t);jQuery.isEmptyObject(e)||(void 0!==e.error?this.newResponse(e.error,"dpt-error"):void 0!==e.markup&&(jQuery("#dpt-shortcode-preview").html(e.markup),window.dptScriptData.instances=e.instances))},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}blankShortcodeTemplate(t){t.siblings("select.dpt-shortcode-dropdown").val(""),jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_blank_shortcode_template",security:d.security},type:"POST",timeout:6e4,success:t=>{const e=JSON.parse(t);if(!jQuery.isEmptyObject(e))if(void 0!==e.error)this.newResponse(e.error,"dpt-error");else if(void 0!==e.form&&void 0!==e.instance){const t='\n\t\t\t\t\t\t<div class="dpt-shortcode-form-wrapper">'.concat(e.form,'</div>\n\t\t\t\t\t\t<div class="dpt-shortcode-form-submit">\n\t\t\t\t\t\t\t<button id="dpt-shortcode-generator-submit-btn" class="button button-secondary" style="width: 100%;">Generate Shortcode</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t'),s='\n\t\t\t\t\t\t<div style="padding: 20px; font-size: 20px; color: #aaa;">\n\t\t\t\t\t\t\t<span>Shortcode</span>\n\t\t\t\t\t\t\t<span style="color: #333;">Preview</span>\n\t\t\t\t\t\t\t<span> will be displayed here.</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t',i=jQuery("#dpt-shortcode-form"),n=jQuery("#dpt-shortcode-preview");jQuery(".dpt-shortcode-result").html(""),i.html(t).data("instance",e.instance),n.html(s),jQuery(document).trigger("custom-widget-added"),this.newResponse("Shortcode template created successfully","dpt-success")}},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}createNewShortcode(){const{instance:t,values:e}=this.getShortcodeFormValues(),s=e.title||"DPT Shortcode "+(t+1);jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_create_new_shortcode",security:d.security,data:e,instance:t},type:"POST",timeout:6e4,success:e=>{const i=JSON.parse(e);if(!jQuery.isEmptyObject(i))if(void 0!==i.error)this.newResponse(i.error,"dpt-error");else if(void 0!==i.success){const e=jQuery("#dpt-options-module-shortcode"),i=e.find(".dpt-shortcode-action");let n=e.find("select.dpt-shortcode-dropdown");0===n.length&&(i.append('\n\t\t\t\t\t\t\t\t<span class="dpt-separator">or</span>\n\t\t\t\t\t\t\t\t<select class="dpt-shortcode-dropdown">\n\t\t\t\t\t\t\t\t\t<option value="" selected="selected">Select a Shortcode to Edit</option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t'),n=e.find("select.dpt-shortcode-dropdown")),n.append('<option value="'.concat(t,'">').concat(s,"</option>")),n.val(t),n.trigger("change"),this.newResponse("New shortcode created successfully","dpt-success")}},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}loadShortcode(t){const e=t.val();if(!e)return jQuery("#dpt-shortcode-form").html(""),jQuery("#dpt-shortcode-preview").html('\n\t\t\t\t<div style="padding: 20px; font-size: 20px; color: #aaa;">\n\t\t\t\t\t<span>Create a </span>\n\t\t\t\t\t<span style="color: #333;">New Shortcode</span>\n\t\t\t\t\t<span> or </span>\n\t\t\t\t\t<span style="color: #333;">Edit an Existing</span>\n\t\t\t\t\t<span> Shortcode using the menu above.</span>\n\t\t\t\t</div>\n\t\t\t'),void jQuery(".dpt-shortcode-result").html("");jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_load_shortcode",security:d.security,instance:e},type:"POST",timeout:6e4,success:t=>{const e=JSON.parse(t);if(!jQuery.isEmptyObject(e))if(void 0!==e.error)this.newResponse(e.error,"dpt-error");else if(void 0!==e.form&&void 0!==e.preview){const t='\n\t\t\t\t\t\t<div class="dpt-shortcode-form-wrapper">'.concat(e.form,'</div>\n\t\t\t\t\t\t<div class="dpt-shortcode-form-update dpt-button-wrapper">\n\t\t\t\t\t\t\t<button id="dpt-shortcode-generator-update-btn" class="button button-secondary" style="width: 100%;">Update Shortcode</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="dpt-shortcode-form-delete dpt-button-wrapper">\n\t\t\t\t\t\t\t<button id="dpt-shortcode-generator-delete-btn" class="button button-secondary" style="width: 100%;">Delete Shortcode</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t'),s="\n\t\t\t\t\t\t".concat(e.preview,"\n\t\t\t\t\t\t"),i=jQuery(".dpt-shortcode-result"),n=jQuery("#dpt-shortcode-form"),o=jQuery("#dpt-shortcode-preview");n.html(t).attr("data-instance",e.instance),o.html(s),i.html('\n\t\t\t\t\t\t\t<div class="dpt-shortcode-sidebar-collapse">\n\t\t\t\t\t\t\t\t<a href="#" class="dpt-collapse-sidebar">\n\t\t\t\t\t\t\t\t\t<span class="dashicons dashicons-arrow-left-alt2"></span>\n\t\t\t\t\t\t\t\t\t<span class="dpt-collapse-side">Collapse</span>\n\t\t\t\t\t\t\t\t\t<span class="dpt-expand-side" style="display: none;">Expand</span>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="dpt-shortcode-copy">\n\t\t\t\t\t\t\t\t<span>Your shortcode is </span>\n\t\t\t\t\t\t\t\t<pre class="dpt-shortcode-text"><code>[showdpt instance="'.concat(e.instance,'"]</code></pre>\n\t\t\t\t\t\t\t\t<a href="#" class="dpt-copy-shortcode-text">(Copy shortcode)</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t')),window.dptScriptData.instances=e.instances,jQuery(document).trigger("custom-widget-added")}},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}deleteShortcode(t){const e=jQuery("#dpt-options-module-shortcode"),s=e.find("#dpt-shortcode-form").data("instance"),i=e.find("select.dpt-shortcode-dropdown");e.find("#dpt-shortcode-action-modal").addClass("dpt-hidden"),void 0!==s&&(e.find(".dpt-shortcode-result").html(""),jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_delete_shortcode",security:d.security,instance:s},type:"POST",timeout:6e4,success:t=>{const e=JSON.parse(t);jQuery.isEmptyObject(e)||(void 0!==e.error?this.newResponse(e.error,"dpt-error"):void 0!==e.success&&(i.val(""),i.find('option[value="'.concat(s,'"]')).remove(),0===i.find("option").length?i.remove():i.trigger("change"),this.newResponse("Shortcode deleted successfully","dpt-success",!0)))},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}}))}updateShortcode(t){const{instance:e,values:s}=this.getShortcodeFormValues();s.title&&jQuery(".dpt-shortcode-dropdown option:selected").text(s.title),jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_update_shortcode",security:d.security,data:s,instance:e},type:"POST",timeout:6e4,success:t=>{const e=JSON.parse(t);jQuery.isEmptyObject(e)||(void 0!==e.error?this.newResponse(e.error,"dpt-error"):void 0!==e.success&&this.newResponse("Shortcode updated successfully","dpt-success"))},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}newResponse(t="",e=!1,s=!1){this.newFeedback.removeClass("dpt-error dpt-success dpt-running"),!1!==e&&(this.newFeedback.addClass(e),this.newFeedback.find(".dpt-feedback").text(t)),setTimeout(function(){this.newFeedback.removeClass("dpt-success dpt-running"),s&&window.location.reload()}.bind(this),1e3)}toggleSidebar(t){jQuery("#dpt-shortcode-form").toggleClass("dpt-sidebar-close"),t.toggleClass("dpt-sidebar-close"),window.dispatchEvent(new Event("resize"))}copyShortcodeText(t){const e=t.closest(".dpt-shortcode-copy").find(".dpt-shortcode-text code").text();var s=jQuery("<textarea>");jQuery("body").append(s),s.val(e).select(),document.execCommand("copy"),s.remove(),this.newResponse("Shortcode copied to clipboard","dpt-success")}tabFunctionality(t){const e=t.attr("data-id"),s=t.closest(".dpt-tabs").find(".dpt-tab-content"),i=s.find('[data-attr="'+e+'"]');t.siblings(".dpt-tab-index-item").removeClass("active-tab"),t.addClass("active-tab"),s.find(".dpt-tab-content-item").hide(),i.show()}},c=class{constructor(){this.events()}events(){const t=this;jQuery((function(){t.colorPicker()})),jQuery(document).on("custom-widget-added",(function(){t.colorPicker()}))}colorPicker(){const t={change:function(t,e){setTimeout((function(){jQuery(t.target).trigger("change")}),60)}};jQuery(".dpt-color-picker").not('[id*="__i__"]').wpColorPicker(t)}};jQuery((function(){new a,new c,new o}))})();1 (()=>{"use strict";function t(t,e,s){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var i=s.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}const e=class{constructor(e){t(this,"options",null),t(this,"slides",[]),t(this,"currentIndex",0),t(this,"autoSlideTime",0),t(this,"autoSlideTimeout",null),t(this,"resizeTimeout",null),e&&e.element&&e.slides&&(this.options=e,this.autoSlideTime=this.options.autoSlideTime||0,this.sliderMarkup(),this.sliderEvents(),this.startAutoSlide())}sliderMarkup(){const t=this.getElement(this.options.element,null,!0),e=t?this.getElement(this.options.slides,t,!1):null,s='<svg class="dpt-button-icon" viewBox="0 0 100 100"><path d="M 10,50 L 60,100 L 70,90 L 30,50 L 70,10 L 60,0 Z" class="arrow"></path></svg>',i='\n <button class="dpt-slider-button dpt-slider-prev-button" type="button" aria-label="Previous slide">'.concat(s,'</button>\n <button class="dpt-slider-button dpt-slider-next-button" type="button" aria-label="Next slide">').concat(s,"</button>\n ");if(e&&e.length>0){const s=document.createElement("div"),n=e[0].offsetHeight;s.classList.add("dpt-slider-viewport"),s.style.height=n+"px",s.innerHTML='<div class="dpt-slider-container"></div>';const o=s.querySelector(".dpt-slider-container");e.forEach((t=>o.appendChild(t))),s.innerHTML+=i,t.appendChild(s)}else console.error("Invalid element or slides")}sliderEvents(){const t=this.getElement(this.options.element,null,!0),e=t?t.querySelector(".dpt-slider-viewport"):null;if(!e)return;if(this.slides=this.getElement(this.options.slides,e,!1),this.slides.length<=1)return;const s=e.parentElement.querySelector(".dpt-slider-prev-button"),i=e.parentElement.querySelector(".dpt-slider-next-button");this.slides[this.currentIndex].classList.add("is-selected"),s.addEventListener("click",(()=>{this.changeSlide(!1)})),i.addEventListener("click",(()=>{this.changeSlide(!0)}));let n=0;e.addEventListener("touchstart",(function(t){n=t.touches[0].clientX})),e.addEventListener("touchend",(t=>{const e=t.changedTouches[0].clientX,s=n-e;s>20?this.changeSlide(!1):s<-20&&this.changeSlide(!0)})),e.addEventListener("keydown",(t=>{switch(t.key){case"ArrowLeft":this.changeSlide(!1);break;case"ArrowRight":this.changeSlide(!0)}})),window.addEventListener("resize",function(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(this.dptStyleUpdate.bind(this),100)}.bind(this))}dptStyleUpdate(){const t=this.slides[0]?this.slides[0].closest(".dpt-slider-viewport"):null,e=t.querySelectorAll(".dpt-thumbnail-clone img");if(!t)return;const s=this.slides[this.currentIndex].offsetHeight,i=this.slides[this.currentIndex].offsetWidth;t.style.height=s+"px",e.forEach((t=>{t.style.height=s+"px",t.style.width=i+"px"}))}changeSlide(t){const e=t?this.currentIndex+1:this.currentIndex-1,s=t?"dpt-slider-next":"dpt-slider-prev",i=this.slides[0]?this.slides[0].closest(".dpt-slider-viewport"):null;if(!i)return;i.classList.remove("dpt-slider-next","dpt-slider-prev"),i.classList.add(s),this.slides[this.currentIndex].classList.remove("is-selected"),this.currentIndex=(e+this.slides.length)%this.slides.length;const n=this.slides[this.currentIndex].offsetHeight;i.style.height=n+"px",this.slides[this.currentIndex].classList.add("is-selected"),this.startAutoSlide()}startAutoSlide(){this.autoSlideTime>0&&(clearInterval(this.autoSlideTimeout),this.autoSlideTimeout=setInterval((()=>{this.changeSlide(!0)}),this.autoSlideTime))}getElement(t,e,s=!1){if(!t)return null;const i=e?s?e.querySelector.bind(e):e.querySelectorAll.bind(e):s?document.querySelector.bind(document):document.querySelectorAll.bind(document);return t instanceof Element||t instanceof Document?t:"string"==typeof t?i(t):null}};class s{constructor(t,e=document){this.elements="string"==typeof t?this.get(t,e):[t]}static async sendAjaxRequest(t,e,s=console.error){const i=new URLSearchParams;for(const t in e)"object"==typeof e[t]?i.append(t,JSON.stringify(e[t])):i.append(t,e[t]);try{const e=await fetch(t,{method:"POST",body:i,headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if(!e.ok)throw new Error("Network response was not ok");return await e.json()}catch(t){return s(t.message),null}}static template(t,e){return t.replace(/\{\{(\w+)\}\}/g,((t,s)=>e[s]||""))}static strToHTML(t){const e=document.createElement("div");return e.innerHTML=t,e.firstElementChild}static escapeHtml(t){return t.replace(/</g,"<").replace(/>/g,">")}static get_icon(t,e=""){const s=document.querySelector("#icon-".concat(t)),i=s?s.getAttribute("viewBox"):"0 0 24 24";return s?'<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-'.concat(t," ").concat(e,'" aria-hidden="true" role="img" focusable="false" viewBox="').concat(i,'">').concat(s.innerHTML,"</svg>"):""}static addImageAttrs(t){Array.prototype.slice.call(t.querySelectorAll(".dpt-thumbnail")).forEach((t=>{const e=t.querySelector("img");if(!e)return;const s=e.getAttribute("data-dpt-src"),i=e.getAttribute("data-dpt-srcset");if(!s||!i)return;const n=t.offsetWidth;e.setAttribute("sizes","".concat(n+100,"px")),e.setAttribute("src",s),e.setAttribute("srcset",i)}))}}const i=(t,e=document)=>new s(t,e);Object.getOwnPropertyNames(s).forEach((t=>{"function"==typeof s[t]&&"prototype"!==t&&(i[t]=s[t])}));const n=class{constructor(t){this.elem=t,this.instance=this.elem.id.replace("dpt-wrapper-",""),this.data=window.dptScriptData||{},this.instanceData=this.data?.instances?.[this.instance]||{},this.posts=this.elem.querySelectorAll(".dpt-entry"),this.addTaxonomyFilters(),this.events()}events(){const t=this,e=this.elem.parentElement;let s="",i=null,n=null;const o=e.querySelector(".dpt-hsearch-btn"),r=e.querySelector(".dpt-hfilter-btn"),d=e.querySelector(".dpt-hprev-btn"),a=e.querySelector(".dpt-hnext-btn"),c=e.querySelector(".dpt-hsearch-close"),l=e.querySelector(".dpt-hfilter-close"),p=e.querySelector(".dpt-hsearch-input"),h=e.querySelector(".dpt-taxonomy-hfilter");o&&o.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.disabled=!0})),e.classList.add("dpt-hsearch-open"),p&&p.focus()}.bind(this)),c&&c.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.classList.contains("is-disabled")||(t.disabled=!1)})),e.classList.remove("dpt-hsearch-open"),p.value="",p.dispatchEvent(new Event("input"))}.bind(this)),r&&r.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.disabled=!0})),e.classList.toggle("dpt-hfilter-open")}.bind(this)),l&&l.addEventListener("click",function(){const t=e.querySelector(".dpt-main-header"),s=t?t.querySelectorAll(".dpt-header-btn"):null;s&&s.forEach((function(t){t.classList.contains("is-disabled")||(t.disabled=!1)})),e.classList.remove("dpt-hfilter-open"),h&&(h.value="",h.dispatchEvent(new Event("change")))}.bind(this)),p&&p.addEventListener("input",(function(){if(this.value!==s){let e=[];s=this.value,clearTimeout(i),i=setTimeout(function(){const i=s.trim().toLowerCase(),n=t.elem.querySelector(".dpt-featured-wrap");n&&n.classList.remove("dpt-hidden"),i?(t.elem.querySelectorAll(".dpt-ajax-entry").forEach((function(t){t.remove()})),t.posts.forEach((function(t){if(t.getAttribute("data-title").includes(i)){const s=t.getAttribute("data-id");e.push(parseInt(s)),t.classList.remove("dpt-hidden")}else t.classList.add("dpt-hidden")}))):(t.elem.querySelectorAll(".dpt-ajax-entry").forEach((function(t){t.remove()})),t.posts.forEach((function(t){t.classList.remove("dpt-hidden")})));const o=n?n.querySelector(".dpt-entry"):null;o&&o.classList.contains("dpt-hidden")&&n.classList.add("dpt-hidden")}.bind(this),100),clearTimeout(n),n=setTimeout((function(){t.searchPosts(s,e)}),500)}else clearTimeout(i)})),h&&h.addEventListener("change",(function(e){const s=h.value;t.elem.querySelectorAll(".dpt-ajax-entry").forEach((function(t){t.remove()}));const i=t.elem.querySelector(".dpt-featured-wrap");if(i&&i.classList.remove("dpt-hidden"),s){let o=[];const r=e.target.options[e.target.selectedIndex],d=r.textContent,a=r.closest(".dpt-optgroup"),c=a?a.getAttribute("label"):null;t.posts.forEach((function(t){const e=t.getAttribute("data-"+c);if(e&&e.includes(d.toLowerCase())){const e=t.getAttribute("data-id");o.push(parseInt(e)),t.classList.remove("dpt-hidden")}else t.classList.add("dpt-hidden")}));const l=i?i.querySelector(".dpt-entry"):null;l&&l.classList.contains("dpt-hidden")&&i.classList.add("dpt-hidden"),clearTimeout(n),n=setTimeout((function(){t.filterPosts(s,c,o)}),100)}else t.posts.forEach((function(t){t.classList.remove("dpt-hidden")}))})),d&&d.addEventListener("click",(function(){t.loadPreviousPage(this)})),a&&a.addEventListener("click",(function(){t.loadNextPage(this)}))}addTaxonomyFilters(){const t=this.elem.parentElement.querySelector(".dpt-header-filter"),e=t?t.querySelector(".dpt-filter-menu"):null;if(!e)return;const s=this.instanceData.taxonomies||{},i=Object.keys(s),n='\n\t\t\t<select class="dpt-taxonomy-hfilter">\n\t\t\t\t<option value="">All</option>\n\t\t\t\t'.concat(i.map((t=>'\n\t\t\t\t\t<optgroup label="'.concat(t,'" class="dpt-optgroup">\n\t\t\t\t\t\t').concat(Object.keys(s[t]).map((e=>'<option value="'.concat(s[t][e],'">').concat(e,"</option>"))).join(""),"\n\t\t\t\t\t</optgroup>"))).join(""),"\n\t\t\t</select>\n\t\t");e.innerHTML=n}async searchPosts(t,e){const s=this.elem.querySelector(".dpt-normal-wrap")||this.elem;if(!(t=t.trim().toLowerCase()))return;const n={...this.data?.instances?.[this.instance]?.query_args}||{},o={...this.data?.instances?.[this.instance]?.args}||{};n.s=t,n.post__in=n.post__in&&Array.isArray(n.post__in)?n.post__in.filter((t=>!e.includes(t))):[];const r={action:"dpt_fetch_posts",nonce:this.data.security,query:n,args:o},d=this.elem.parentElement.querySelector(".dpt-fetch-running");d&&d.classList.add("dpt-show");let a=await i.sendAjaxRequest(this.data.ajaxurl,r);d&&d.classList.remove("dpt-show"),a&&a.data&&(a=i.strToHTML("<div>"+a.data+"</div>"),s.append(...a.children),s.querySelectorAll(".dpt-ajax-entry").forEach((function(t){i.addImageAttrs(t)})))}async filterPosts(t,e,s){const n=this.elem.querySelector(".dpt-normal-wrap")||this.elem,o={...this.data?.instances?.[this.instance]?.query_args}||{},r={...this.data?.instances?.[this.instance]?.args}||{},d={taxonomy:e,field:"term_id",terms:[t]};o.tax_query=[d],o.post__in=o.post__in&&Array.isArray(o.post__in)?o.post__in.filter((t=>!s.includes(t))):[];const a={action:"dpt_fetch_posts",nonce:this.data.security,query:o,args:r},c=this.elem.parentElement.querySelector(".dpt-fetch-running");c&&c.classList.add("dpt-show");let l=await i.sendAjaxRequest(this.data.ajaxurl,a);c&&c.classList.remove("dpt-show"),l&&l.data&&(l=i.strToHTML("<div>"+l.data+"</div>"),n.append(...l.children),n.querySelectorAll(".dpt-ajax-entry").forEach((function(t){i.addImageAttrs(t)})))}async loadPreviousPage(t){const e=this.elem.querySelector(".dpt-normal-wrap"),s=e||this.elem,n=this.instanceData.offset||0;let o=this.instanceData.lot_size||10;if(o=e?o-1:o,n<=0)return;let r=n-o;r=e?Math.max(1,r):r;const d={...this.data?.instances?.[this.instance]?.query_args}||{},a={...this.data?.instances?.[this.instance]?.args}||{};d.offset=e?Math.max(1,r):r,d.posts_per_page=e?d.posts_per_page-1:d.posts_per_page;const c={action:"dpt_fetch_posts",nonce:this.data.security,query:d,args:a},l=t.querySelector(".icon-dpt-spin"),p=t.querySelector(".icon-dpt-previous");l&&p&&(l.classList.remove("dpt-hidden"),p.classList.add("dpt-hidden"));let h=await i.sendAjaxRequest(this.data.ajaxurl,c);l&&p&&(l.classList.add("dpt-hidden"),p.classList.remove("dpt-hidden")),h&&h.data&&(h=i.strToHTML("<div>"+h.data+"</div>"),s.replaceChildren(...h.children),this.posts=this.elem.querySelectorAll(".dpt-entry"),this.posts.forEach((function(t){t.classList.contains("dpt-ajax-entry")&&(t.classList.remove("dpt-ajax-entry"),i.addImageAttrs(t))})),this.instanceData.offset=r,r<=0||e&&r<=1?(t.classList.add("is-disabled"),t.setAttribute("disabled","disabled")):(t.classList.remove("is-disabled"),t.removeAttribute("disabled")),t.nextSibling.classList.remove("is-disabled"),t.nextSibling.removeAttribute("disabled"))}async loadNextPage(t){const e=this.elem.querySelector(".dpt-normal-wrap"),s=e||this.elem;let n=this.instanceData.offset||0,o=this.instanceData.lot_size||10;n=e&&0===n?1:n,o=e?o-1:o;const r=this.instanceData.total||0;if(n+o>=r)return;const d=n+o,a={...this.data?.instances?.[this.instance]?.query_args}||{},c={...this.data?.instances?.[this.instance]?.args}||{};a.offset=d,a.posts_per_page=e?a.posts_per_page-1:a.posts_per_page;const l={action:"dpt_fetch_posts",nonce:this.data.security,query:a,args:c},p=t.querySelector(".icon-dpt-spin"),h=t.querySelector(".icon-dpt-next");p&&h&&(p.classList.remove("dpt-hidden"),h.classList.add("dpt-hidden"));let u=await i.sendAjaxRequest(this.data.ajaxurl,l);p&&h&&(p.classList.add("dpt-hidden"),h.classList.remove("dpt-hidden")),u&&u.data&&(u=i.strToHTML("<div>"+u.data+"</div>"),s.replaceChildren(...u.children),this.posts=this.elem.querySelectorAll(".dpt-entry"),this.posts.forEach((function(t){t.classList.contains("dpt-ajax-entry")&&(t.classList.remove("dpt-ajax-entry"),i.addImageAttrs(t))})),this.instanceData.offset=d,d>=r-o?(t.classList.add("is-disabled"),t.setAttribute("disabled","disabled")):(t.classList.remove("is-disabled"),t.removeAttribute("disabled")),t.previousSibling.classList.remove("is-disabled"),t.previousSibling.removeAttribute("disabled"))}},o=class{constructor(){const t=this;this.elems=Array.prototype.slice.call(document.querySelectorAll(".dpt-wrapper")),this.elems.forEach((t=>{this.initializeProFunctionality(t)})),document.addEventListener("animationstart",(function(e){if("dptAdded"!==e.animationName)return;const s=e.target;s.classList.contains("dpt-wrapper")&&(s.classList.contains("dpt-pro-added")||t.initializeProFunctionality(s))}),!1)}initializeProFunctionality(t){if(t.classList.add("dpt-pro-added"),t.classList.contains("dpt-pro-slider1"))this.sliderNavFunctionality(t);else if(t.classList.contains("dpt-custom-slider")){t.classList.contains("dpt-pro-slider3")&&this.sliceImages(t);const s=parseInt(t.getAttribute("data-autotime")),i={element:t,slides:".dpt-entry"};s&&(i.autoSlideTime=s),this.flicKity=new e(i)}else t.classList.contains("dpt-grid1")&&t.querySelectorAll(".dpt-featured-content").forEach((t=>{if(t.clientHeight){const e=Array.from(t.parentElement.querySelectorAll(":scope > .sub-entry"));e.length>0&&(e[e.length-1].style.flex=1)}}));new n(t)}sliderNavFunctionality(t){const e=t.closest(".dpt-pro-slider-wrapper"),s=e.querySelector(".dpt-slider-nav"),i=e.querySelector(".dpt-slider");s&&i&&new Flickity(s,{cellAlign:"center",contain:!0,pageDots:!1,asNavFor:i,prevNextButtons:!1})}sliceImages(t){t.querySelectorAll(".dpt-thumbnail-inner").forEach((t=>{const e=t.querySelector("img"),s=e?e.src:"",i=t.clientWidth,n=t.clientHeight;let o=250,r='<div class="dpt-thumbnail-clones">';for(let t=0;t<5;t++){const e=20*t,d=-1*t*100;r+='<div class="dpt-thumbnail-clone" style="animation-duration: '.concat(o,"ms; left: ").concat(e,'%"><img src="').concat(s,' " width="').concat(i,'" height="').concat(n,'" style="width: ').concat(i,"px; height: ").concat(n,"px; left: ").concat(d,'%"></div>'),o+=150}r+="</div>",e.insertAdjacentHTML("afterend",r),t.classList.add("dpt-slicer")}))}},r=window.dptShortgenData||{},d={stylesSupport:r.styleSupport||{},ajaxUrl:r.ajaxurl||"",security:r.security||"",isPremium:r.isPremium||!1,isStyleSupport:function(t,e){const s=this.stylesSupport[t];return void 0!==s&&s.includes(e)}},a=class{constructor(){this.muChecklistTimer=null,this.newFeedback=jQuery("#dpt-action-feedback"),this.serverTimeOut=null,this.events()}events(){const t=this,e=jQuery("#dpt-options-module-shortcode"),s=jQuery(document);e.on("change","select.dpt-post-type",(function(){t.postTypeChange(jQuery(this))})),e.on("change","select.dpt-taxonomy",(function(){t.toggleTerms(jQuery(this))})),e.on("change","select.dpt-orderby",(function(){t.toggleCustomSort(jQuery(this))})),e.on("change","select.dpt-styles",(function(){t.styleChange(jQuery(this))})),e.on("change","select.dpt-img-aspect",(function(){t.showCroppos(jQuery(this))})),e.on("change",'input[type="checkbox"].spcheckbox',(function(){t.showElemOptions(jQuery(this))})),e.on("change",'.dpt-mu-checklist input[type="checkbox"]',(function(){t.updateMuChecklist(jQuery(this))})),e.on("change",".dpt-getval",(function(){clearTimeout(t.serverTimeOut),t.serverTimeOut=setTimeout((function(){t.updatePreview(jQuery(this))}),100)})),e.on("click","#dpt-shortcode-generator-btn",(function(){t.blankShortcodeTemplate(jQuery(this))})),e.on("click","#dpt-shortcode-generator-submit-btn",(function(){t.createNewShortcode(jQuery(this))})),e.on("click","#dpt-shortcode-generator-delete-btn",(function(){const t=e.find("#dpt-shortcode-action-modal"),s=t.find(".dpt-shortcode-action-wrapper");t.removeClass("dpt-hidden"),jQuery("html, body").animate({scrollTop:s.offset().top-200},400)})),e.on("click","#dpt-shortcode-deletion-btn",(function(){t.deleteShortcode(jQuery(this))})),e.on("click","#dpt-shortcode-deletion-cancel",(function(){e.find("#dpt-shortcode-action-modal").addClass("dpt-hidden")})),e.on("click","#dpt-shortcode-generator-update-btn",(function(){t.updateShortcode(jQuery(this))})),e.on("change","select.dpt-shortcode-dropdown",(function(){t.loadShortcode(jQuery(this))})),e.on("click",".dpt-collapse-sidebar",(function(e){e.preventDefault(),t.toggleSidebar(jQuery(this))})),e.on("click",".dpt-copy-shortcode-text",(function(e){e.preventDefault(),t.copyShortcodeText(jQuery(this))})),this.newFeedback.on("click",".dpt-error-close",(t=>{this.newFeedback.removeClass("dpt-error")})),s.on("click",".dpt-settings-toggle",(function(t){const e=jQuery(this);t.preventDefault(),e.next(".dpt-settings-content").slideToggle("fast"),e.toggleClass("toggle-active")})),s.on("click",".dpt-tab-index-item",(function(){t.tabFunctionality(jQuery(this))}))}toggleCustomSort(t){const e=t.val(),s=[".sort_custom_field_key",".sort_custom_field_type"],i=t.closest(".dpt-shortcode-form");"custom"!==e?i.find(s.join(",")).each((function(){jQuery(this).val("").hide()})):i.find(s.join(",")).show()}postTypeChange(t){const e=t.val(),s=t.closest(".dpt-shortcode-form"),i=s.find(".dpt-settings-toggle"),n=s.find(".dpt-settings-content"),o=s.find("select.dpt-taxonomy"),r=s.find("select.dpt-filter-custom-field-key"),d=s.find("select.dpt-filter-custom-field-operator"),a=s.find("input.dpt-filter-custom-field-value"),c=s.find("select.dpt-filter-custom-field-type"),l=[".post_ids",".taxonomy",".offset",".orderby",".order"],p=[".pages"];e?(i.show(),"page"===e?(n.find(p.join(",")).show().closest(".dpt-wrapper-container").show(),n.find(l.join(",")).hide().closest(".dpt-settings-content").hide().closest(".dpt-wrapper-container").hide().find(".dpt-settings-toggle").removeClass("toggle-active")):(n.find(p.join(",")).hide().closest(".dpt-settings-content").hide().closest(".dpt-wrapper-container").hide().find(".dpt-settings-toggle").removeClass("toggle-active"),n.find(l.join(",")).show().closest(".dpt-wrapper-container").show(),o.find("option").hide(),o.find(".always-visible, ."+e).show(),o.val("")),n.toggleClass("not-post","post"!==e),n.find(".terms, .relation").hide(),r.find("option").hide(),r.find(".always-visible, ."+e).show(),r.val(""),d.val(""),a.val("").prop("disabled",!1),c.prop("disabled",!1)):(i.hide(),n.find(".dpt-settings-content").hide(),n.find(".dpt-settings-toggle").removeClass("toggle-active"),n.hide())}toggleTerms(t){const e=t.closest(".dpt-settings-content"),s=t.val();s?(e.find(".terms, .relation").show(),e.find(".terms").find(".terms-checklist li").hide(),e.find(".terms").find(".terms-checklist ."+s).show()):e.find(".terms, .relation").hide()}styleChange(t){const e=t.val(),s=t.closest(".dpt-shortcode-form");this.saneDefaults(e,s),d.isStyleSupport(e,"multicol")?s.find(".col_narr").show():s.find(".col_narr").hide(),d.isStyleSupport(e,"ialign")?s.find(".img_align").show():s.find(".img_align").hide(),d.isStyleSupport(e,"slider")?s.find(".autotime").show():s.find(".autotime").hide(),d.isStyleSupport(e,"pagination")?s.find(".show_pgnation").show():s.find(".show_pgnation").hide(),d.isStyleSupport(e,"overlay")?(s.find(".text_pos_hor").show(),s.find(".text_pos_ver").show(),s.find(".title_shadow").show(),s.find(".wrapper_width").show(),"content"===s.find("select.dpt-wrapper-type").val()?s.find(".wrapper_height").show():s.find(".wrapper_height").hide()):(s.find(".text_pos_hor").hide(),s.find(".text_pos_ver").hide(),s.find(".title_shadow").hide(),s.find(".wrapper_width").hide(),s.find(".wrapper_height").hide()),s.find(".spcheckbox").each((function(){const t=jQuery(this).val();d.isStyleSupport(e,t)?jQuery(this).closest(".dpt-toggle-container").show():jQuery(this).closest(".dpt-toggle-container").hide()}))}saneDefaults(t,e){const s={"dpt-list1":["thumbnail","title","meta","excerpt"],"dpt-list2":["thumbnail","title","meta"],"dpt-pro-slider2":["thumbnail","title","meta","excerpt"],"dpt-mag1":["thumbnail","title","meta"]},i=e.find(".spcheckbox");void 0!==s[t]?i.each((function(){const e=jQuery(this).val();s[t].includes(e)?jQuery(this).prop("checked",!0).trigger("change"):jQuery(this).prop("checked",!1).trigger("change")})):i.each((function(){const t=jQuery(this).val();["thumbnail","title"].includes(t)?jQuery(this).prop("checked",!0).trigger("change"):jQuery(this).prop("checked",!1).trigger("change")})),["dpt-list1","dpt-list2","dpt-slider1","dpt-mag1"].includes(t)?e.find("select.dpt-img-aspect").val("land1").trigger("change"):["dpt-pro-slider1","dpt-pro-slider3"].includes(t)?e.find("select.dpt-img-aspect").val("wdscrn").trigger("change"):["dpt-pro-slider2"].includes(t)?e.find("select.dpt-img-aspect").val("squr").trigger("change"):e.find("select.dpt-img-aspect").val("").trigger("change")}showCroppos(t){var e=t.val(),s=t.closest(".dpt-shortcode-form");""!==e?("custom"===e?s.find(".custom_aspect").show():s.find(".custom_aspect").hide(),s.find(".image_crop").show()):(s.find(".image_crop").hide(),s.find(".custom_aspect").hide())}showElemOptions(t){const e=t.closest(".dpt-style-wrapper"),s=t.closest(".dpt-widget-option");t.prop("checked")?s.parent().find(".dpt-widget-option, .dpt-tabs-container").show():s.siblings(".dpt-widget-option, .dpt-tabs-container").hide(),this.updateStyleSup(e)}updateStyleSup(t){var e=t.find("input.spcheckbox").first().attr("data-id");if(e){var s=t.find("input.spcheckbox:checked");if(s.length){var i=s.map((function(){return this.value})).get().join(",");jQuery("#"+e).val(i).trigger("change")}else jQuery("#"+e).val("").trigger("change")}}updateMuChecklist(t){clearTimeout(this.muChecklistTimer),this.muChecklistTimer=setTimeout((()=>{const e=t.closest(".dpt-mu-checklist"),s=e.find('input[type="checkbox"]:checked').map((function(){return this.value})).get().join(",");e.find(".dpt-getval").val(s).trigger("change")}),500)}getShortcodeFormValues(){const t=jQuery("#dpt-shortcode-form"),e=t.find(".dpt-getval"),s=t.data("instance"),i={};return e.each((function(){const t=this.name.replace(/^dpt_field_name_/,"");"checkbox"===this.type?i[t]=this.checked?this.value:"":i[t]=this.value})),{instance:s,values:i}}normalizeAjaxResponse(t){let e=t;if("string"==typeof t)try{e=JSON.parse(t)}catch(t){return{}}if(!e||"object"!=typeof e)return{};if(Object.prototype.hasOwnProperty.call(e,"success")&&Object.prototype.hasOwnProperty.call(e,"data")){if(!1===e.success)return{error:e.data&&(e.data.message||e.data.error||e.data)||""};if(!0===e.success)return e.data&&"object"==typeof e.data?e.data:{success:!0}}return e}updatePreview(t){const{instance:e,values:s}=this.getShortcodeFormValues();jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_render_preview",security:d.security,data:s},type:"POST",timeout:6e4,success:t=>{const e=this.normalizeAjaxResponse(t);jQuery.isEmptyObject(e)||(void 0!==e.error?this.newResponse(e.error,"dpt-error"):void 0!==e.markup&&(jQuery("#dpt-shortcode-preview").html(e.markup),window.dptScriptData.instances=e.instances))},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}blankShortcodeTemplate(t){t.siblings("select.dpt-shortcode-dropdown").val(""),jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_blank_shortcode_template",security:d.security},type:"POST",timeout:6e4,success:t=>{const e=this.normalizeAjaxResponse(t);if(!jQuery.isEmptyObject(e))if(void 0!==e.error)this.newResponse(e.error,"dpt-error");else if(void 0!==e.form&&void 0!==e.instance){const t='\n\t\t\t\t\t\t<div class="dpt-shortcode-form-wrapper">'.concat(e.form,'</div>\n\t\t\t\t\t\t<div class="dpt-shortcode-form-submit">\n\t\t\t\t\t\t\t<button id="dpt-shortcode-generator-submit-btn" class="button button-secondary" style="width: 100%;">Generate Shortcode</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t'),s='\n\t\t\t\t\t\t<div style="padding: 20px; font-size: 20px; color: #aaa;">\n\t\t\t\t\t\t\t<span>Shortcode</span>\n\t\t\t\t\t\t\t<span style="color: #333;">Preview</span>\n\t\t\t\t\t\t\t<span> will be displayed here.</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t',i=jQuery("#dpt-shortcode-form"),n=jQuery("#dpt-shortcode-preview");jQuery(".dpt-shortcode-result").html(""),i.html(t).data("instance",e.instance),n.html(s),jQuery(document).trigger("custom-widget-added"),this.newResponse("Shortcode template created successfully","dpt-success")}},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}createNewShortcode(){const{instance:t,values:e}=this.getShortcodeFormValues(),s=e.title||"DPT Shortcode "+(t+1);jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_create_new_shortcode",security:d.security,data:e,instance:t},type:"POST",timeout:6e4,success:e=>{const i=this.normalizeAjaxResponse(e);if(!jQuery.isEmptyObject(i))if(void 0!==i.error)this.newResponse(i.error,"dpt-error");else{const e=jQuery("#dpt-options-module-shortcode"),i=e.find(".dpt-shortcode-action");let n=e.find("select.dpt-shortcode-dropdown");0===n.length&&(i.append('\n\t\t\t\t\t\t\t\t<span class="dpt-separator">or</span>\n\t\t\t\t\t\t\t\t<select class="dpt-shortcode-dropdown">\n\t\t\t\t\t\t\t\t\t<option value="" selected="selected">Select a Shortcode to Edit</option>\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t'),n=e.find("select.dpt-shortcode-dropdown")),n.append('<option value="'.concat(t,'">').concat(s,"</option>")),n.val(t),n.trigger("change"),this.newResponse("New shortcode created successfully","dpt-success")}},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}loadShortcode(t){const e=t.val();if(!e)return jQuery("#dpt-shortcode-form").html(""),jQuery("#dpt-shortcode-preview").html('\n\t\t\t\t<div style="padding: 20px; font-size: 20px; color: #aaa;">\n\t\t\t\t\t<span>Create a </span>\n\t\t\t\t\t<span style="color: #333;">New Shortcode</span>\n\t\t\t\t\t<span> or </span>\n\t\t\t\t\t<span style="color: #333;">Edit an Existing</span>\n\t\t\t\t\t<span> Shortcode using the menu above.</span>\n\t\t\t\t</div>\n\t\t\t'),void jQuery(".dpt-shortcode-result").html("");jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_load_shortcode",security:d.security,instance:e},type:"POST",timeout:6e4,success:t=>{const e=this.normalizeAjaxResponse(t);if(!jQuery.isEmptyObject(e))if(void 0!==e.error)this.newResponse(e.error,"dpt-error");else if(void 0!==e.form&&void 0!==e.preview){const t='\n\t\t\t\t\t\t<div class="dpt-shortcode-form-wrapper">'.concat(e.form,'</div>\n\t\t\t\t\t\t<div class="dpt-shortcode-form-update dpt-button-wrapper">\n\t\t\t\t\t\t\t<button id="dpt-shortcode-generator-update-btn" class="button button-secondary" style="width: 100%;">Update Shortcode</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="dpt-shortcode-form-delete dpt-button-wrapper">\n\t\t\t\t\t\t\t<button id="dpt-shortcode-generator-delete-btn" class="button button-secondary" style="width: 100%;">Delete Shortcode</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t'),s="\n\t\t\t\t\t\t".concat(e.preview,"\n\t\t\t\t\t\t"),i=jQuery(".dpt-shortcode-result"),n=jQuery("#dpt-shortcode-form"),o=jQuery("#dpt-shortcode-preview");n.html(t).attr("data-instance",e.instance),o.html(s),i.html('\n\t\t\t\t\t\t\t<div class="dpt-shortcode-sidebar-collapse">\n\t\t\t\t\t\t\t\t<a href="#" class="dpt-collapse-sidebar">\n\t\t\t\t\t\t\t\t\t<span class="dashicons dashicons-arrow-left-alt2"></span>\n\t\t\t\t\t\t\t\t\t<span class="dpt-collapse-side">Collapse</span>\n\t\t\t\t\t\t\t\t\t<span class="dpt-expand-side" style="display: none;">Expand</span>\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="dpt-shortcode-copy">\n\t\t\t\t\t\t\t\t<span>Your shortcode is </span>\n\t\t\t\t\t\t\t\t<pre class="dpt-shortcode-text"><code>[showdpt instance="'.concat(e.instance,'"]</code></pre>\n\t\t\t\t\t\t\t\t<a href="#" class="dpt-copy-shortcode-text">(Copy shortcode)</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t')),window.dptScriptData.instances=e.instances,jQuery(document).trigger("custom-widget-added")}},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}deleteShortcode(t){const e=jQuery("#dpt-options-module-shortcode"),s=e.find("#dpt-shortcode-form").data("instance"),i=e.find("select.dpt-shortcode-dropdown");e.find("#dpt-shortcode-action-modal").addClass("dpt-hidden"),void 0!==s&&(e.find(".dpt-shortcode-result").html(""),jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_delete_shortcode",security:d.security,instance:s},type:"POST",timeout:6e4,success:t=>{const e=this.normalizeAjaxResponse(t);jQuery.isEmptyObject(e)||(void 0!==e.error?this.newResponse(e.error,"dpt-error"):(i.val(""),i.find('option[value="'.concat(s,'"]')).remove(),0===i.find("option").length?i.remove():i.trigger("change"),this.newResponse("Shortcode deleted successfully","dpt-success",!0)))},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}}))}updateShortcode(t){const{instance:e,values:s}=this.getShortcodeFormValues();s.title&&jQuery(".dpt-shortcode-dropdown option:selected").text(s.title),jQuery.ajax({url:d.ajaxUrl,data:{action:"dpt_update_shortcode",security:d.security,data:s,instance:e},type:"POST",timeout:6e4,success:t=>{const e=this.normalizeAjaxResponse(t);jQuery.isEmptyObject(e)||(void 0!==e.error?this.newResponse(e.error,"dpt-error"):this.newResponse("Shortcode updated successfully","dpt-success"))},error:(t,e,s)=>{this.newResponse(s,"dpt-error")}})}newResponse(t="",e=!1,s=!1){this.newFeedback.removeClass("dpt-error dpt-success dpt-running"),!1!==e&&(this.newFeedback.addClass(e),this.newFeedback.find(".dpt-feedback").text(t)),setTimeout(function(){this.newFeedback.removeClass("dpt-success dpt-running"),s&&window.location.reload()}.bind(this),1e3)}toggleSidebar(t){jQuery("#dpt-shortcode-form").toggleClass("dpt-sidebar-close"),t.toggleClass("dpt-sidebar-close"),window.dispatchEvent(new Event("resize"))}copyShortcodeText(t){const e=t.closest(".dpt-shortcode-copy").find(".dpt-shortcode-text code").text();var s=jQuery("<textarea>");jQuery("body").append(s),s.val(e).select(),document.execCommand("copy"),s.remove(),this.newResponse("Shortcode copied to clipboard","dpt-success")}tabFunctionality(t){const e=t.attr("data-id"),s=t.closest(".dpt-tabs").find(".dpt-tab-content"),i=s.find('[data-attr="'+e+'"]');t.siblings(".dpt-tab-index-item").removeClass("active-tab"),t.addClass("active-tab"),s.find(".dpt-tab-content-item").hide(),i.show()}},c=class{constructor(){this.events()}events(){const t=this;jQuery((function(){t.colorPicker()})),jQuery(document).on("custom-widget-added",(function(){t.colorPicker()}))}colorPicker(){const t={change:function(t,e){setTimeout((function(){jQuery(t.target).trigger("change")}),60)}};jQuery(".dpt-color-picker").not('[id*="__i__"]').wpColorPicker(t)}};jQuery((function(){new a,new c,new o}))})(); -
display-post-types/trunk/backend/js/partials/admin/changedetect.js
r3437759 r3463226 380 380 } 381 381 382 normalizeAjaxResponse(response) { 383 let details = response; 384 if ( 'string' === typeof response ) { 385 try { 386 details = JSON.parse( response ); 387 } catch (e) { 388 return {}; 389 } 390 } 391 392 if ( ! details || 'object' !== typeof details ) { 393 return {}; 394 } 395 396 if ( Object.prototype.hasOwnProperty.call( details, 'success' ) && Object.prototype.hasOwnProperty.call( details, 'data' ) ) { 397 if ( false === details.success ) { 398 const errorMessage = details.data && ( details.data.message || details.data.error || details.data ); 399 return { 400 error: errorMessage || '' 401 }; 402 } 403 404 if ( true === details.success ) { 405 if ( details.data && 'object' === typeof details.data ) { 406 return details.data; 407 } 408 return { 409 success: true 410 }; 411 } 412 } 413 414 return details; 415 } 416 382 417 updatePreview( input ) { 383 418 const { instance, values } = this.getShortcodeFormValues(); … … 390 425 data : values, 391 426 }, 392 type: 'POST',393 timeout: 60000,394 success: response => {395 const details = JSON.parse( response );396 if (!jQuery.isEmptyObject(details)) {397 if ('undefined' !== typeof details.error) {398 this.newResponse(details.error, 'dpt-error');427 type: 'POST', 428 timeout: 60000, 429 success: response => { 430 const details = this.normalizeAjaxResponse( response ); 431 if (!jQuery.isEmptyObject(details)) { 432 if ('undefined' !== typeof details.error) { 433 this.newResponse(details.error, 'dpt-error'); 399 434 } else if ('undefined' !== typeof details.markup) { 400 435 const wrapper = jQuery('#dpt-shortcode-preview'); … … 419 454 security: vars.security, 420 455 }, 421 type: 'POST',422 timeout: 60000,423 success: response => {424 const details = JSON.parse( response );425 if (!jQuery.isEmptyObject(details)) {426 if ('undefined' !== typeof details.error) {427 this.newResponse(details.error, 'dpt-error');456 type: 'POST', 457 timeout: 60000, 458 success: response => { 459 const details = this.normalizeAjaxResponse( response ); 460 if (!jQuery.isEmptyObject(details)) { 461 if ('undefined' !== typeof details.error) { 462 this.newResponse(details.error, 'dpt-error'); 428 463 } else if ('undefined' !== typeof details.form && 'undefined' !== typeof details.instance) { 429 464 const form = ` … … 469 504 instance: instance, 470 505 }, 471 type: 'POST',472 timeout: 60000,473 success: response => {474 const details = JSON.parse( response );475 if (!jQuery.isEmptyObject(details)) {476 if ('undefined' !== typeof details.error) {477 this.newResponse(details.error, 'dpt-error');478 } else if ('undefined' !== typeof details.success){479 const widget = jQuery('#dpt-options-module-shortcode');480 const wrapper = widget.find('.dpt-shortcode-action');481 let dropdown = widget.find('select.dpt-shortcode-dropdown');506 type: 'POST', 507 timeout: 60000, 508 success: response => { 509 const details = this.normalizeAjaxResponse( response ); 510 if (!jQuery.isEmptyObject(details)) { 511 if ('undefined' !== typeof details.error) { 512 this.newResponse(details.error, 'dpt-error'); 513 } else { 514 const widget = jQuery('#dpt-options-module-shortcode'); 515 const wrapper = widget.find('.dpt-shortcode-action'); 516 let dropdown = widget.find('select.dpt-shortcode-dropdown'); 482 517 if (0 === dropdown.length) { 483 518 wrapper.append(` … … 526 561 instance: instance, 527 562 }, 528 type: 'POST',529 timeout: 60000,530 success: response => {531 const details = JSON.parse( response );532 if (!jQuery.isEmptyObject(details)) {533 if ('undefined' !== typeof details.error) {534 this.newResponse(details.error, 'dpt-error');563 type: 'POST', 564 timeout: 60000, 565 success: response => { 566 const details = this.normalizeAjaxResponse( response ); 567 if (!jQuery.isEmptyObject(details)) { 568 if ('undefined' !== typeof details.error) { 569 this.newResponse(details.error, 'dpt-error'); 535 570 } else if ('undefined' !== typeof details.form && 'undefined' !== typeof details.preview) { 536 571 const form = ` … … 593 628 instance: instance, 594 629 }, 595 type: 'POST',596 timeout: 60000,597 success: response => {598 const details = JSON.parse( response );599 if (!jQuery.isEmptyObject(details)) {600 if ('undefined' !== typeof details.error) {601 this.newResponse(details.error, 'dpt-error');602 } else if ('undefined' !== typeof details.success){603 dropdown.val('');604 dropdown.find(`option[value="${instance}"]`).remove();605 // check if dropdown does not have any option left.630 type: 'POST', 631 timeout: 60000, 632 success: response => { 633 const details = this.normalizeAjaxResponse( response ); 634 if (!jQuery.isEmptyObject(details)) { 635 if ('undefined' !== typeof details.error) { 636 this.newResponse(details.error, 'dpt-error'); 637 } else { 638 dropdown.val(''); 639 dropdown.find(`option[value="${instance}"]`).remove(); 640 // check if dropdown does not have any option left. 606 641 if ( 0 === dropdown.find('option').length ) { 607 642 dropdown.remove(); … … 634 669 instance: instance, 635 670 }, 636 type: 'POST', 637 timeout: 60000, 638 success: response => { 639 const details = JSON.parse( response ); 640 if (!jQuery.isEmptyObject(details)) { 641 if ('undefined' !== typeof details.error) { 642 this.newResponse(details.error, 'dpt-error'); 643 } else if ('undefined' !== typeof details.success) { 644 this.newResponse('Shortcode updated successfully', 'dpt-success'); 671 type: 'POST', 672 timeout: 60000, 673 success: response => { 674 const details = this.normalizeAjaxResponse( response ); 675 if (!jQuery.isEmptyObject(details)) { 676 if ('undefined' !== typeof details.error) { 677 this.newResponse(details.error, 'dpt-error'); 678 } else { 679 this.newResponse('Shortcode updated successfully', 'dpt-success'); 680 } 645 681 } 646 }647 682 }, 648 683 error: (jqXHR, textStatus, errorThrown) => { -
display-post-types/trunk/display-post-types.php
r3437759 r3463226 15 15 * Plugin Name: Display Post Types 16 16 * Description: Filter, sort and display post, page or any post type. 17 * Version: 3.2. 517 * Version: 3.2.6 18 18 * Author: easyprolabs 19 19 * Author URI: https://easyprolabs.com/display-post-types/ … … 31 31 // Currently plugin version. 32 32 if ( ! defined( 'DISPLAY_POST_TYPES_VERSION' ) ) { 33 define( 'DISPLAY_POST_TYPES_VERSION', '3.2. 5' );33 define( 'DISPLAY_POST_TYPES_VERSION', '3.2.6' ); 34 34 } 35 35 -
display-post-types/trunk/frontend/class-register.php
r3392911 r3463226 698 698 } 699 699 700 libxml_use_internal_errors(true); 700 if ( ! class_exists( 'DOMDocument' ) ) { 701 return false; 702 } 703 704 $previous_libxml_state = libxml_use_internal_errors(true); 701 705 $doc = new \DOMDocument(); 702 706 $doc->loadHTML('<?xml encoding="utf-8" ?>' . $content); 703 707 libxml_clear_errors(); 708 libxml_use_internal_errors( $previous_libxml_state ); 704 709 705 710 $images = $doc->getElementsByTagName('img'); -
display-post-types/trunk/readme.txt
r3437759 r3463226 5 5 Tested up to: 6.9 6 6 Requires PHP: 7.2 7 Stable tag: 3.2. 57 Stable tag: 3.2.6 8 8 License: GPLv3 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 101 101 102 102 == Changelog == 103 = 3.2.6 = 104 * Big Fixes and code improvements. 105 103 106 = 3.2.5 = 104 107 * Pro Feature: Sort by Custom Fields feature.
Note: See TracChangeset
for help on using the changeset viewer.