updated plugin GP Premium version 2.3.0

This commit is contained in:
KawaiiPunk 2023-03-29 18:20:22 +00:00 committed by Gitium
parent e42ba0e05a
commit 16a556be53
40 changed files with 539 additions and 172 deletions

View File

@ -1 +1 @@
document.addEventListener("DOMContentLoaded",function(){var t,e,n,r=document.querySelector(".masonry-container");r&&(t=new Masonry(r,generateBlog.masonryInit),e=document.querySelector("#nav-below"),n=document.querySelector(".load-more"),imagesLoaded(r,function(){t.layout(),r.classList.remove("are-images-unloaded"),n&&n.classList.remove("are-images-unloaded"),e&&(e.style.opacity=1)}),e&&r.parentNode.insertBefore(e,r.nextSibling),window.addEventListener("orientationchange",function(){t.layout()}));var a,i,l,o,c,d=document.querySelector(".infinite-scroll"),u=document.querySelector(".infinite-scroll-path a");d&&u&&(a=document.querySelectorAll(".infinite-scroll-item")[0].parentNode,i=document.querySelector(".load-more a"),l="",generateBlog.icon&&(l=generateBlog.icon),(o=generateBlog.infiniteScrollInit).outlayer=t,c=new InfiniteScroll(a,o),i&&i.addEventListener("click",function(e){document.activeElement.blur(),e.target.innerHTML=l+generateBlog.loading,e.target.classList.add("loading")}),c.on("append",function(e,n,o){i&&!document.querySelector(".generate-columns-container")&&a.appendChild(i.parentNode),o.forEach(function(e){var n=e.querySelectorAll("img");n&&n.forEach(function(e){var n=e.outerHTML;e.outerHTML=n})}),r&&t&&imagesLoaded(r,function(){t.layout()}),i&&(i.innerHTML=l+generateBlog.more,i.classList.remove("loading")),document.body.dispatchEvent(new Event("post-load"))}),c.on("last",function(){var e=document.querySelector(".load-more");e&&(e.style.display="none")}))});
document.addEventListener("DOMContentLoaded",function(){var t,e,n,r,a,i,l=document.querySelector(".masonry-container"),o=(l&&(t=new Masonry(l,generateBlog.masonryInit),e=document.querySelector("#nav-below"),n=document.querySelector(".load-more"),imagesLoaded(l,function(){t.layout(),l.classList.remove("are-images-unloaded"),n&&n.classList.remove("are-images-unloaded"),e&&(e.style.opacity=1)}),e&&l.parentNode.insertBefore(e,l.nextSibling),window.addEventListener("orientationchange",function(){t.layout()})),document.querySelector(".infinite-scroll")),c=document.querySelector(".infinite-scroll-path a");o&&c&&(r=document.querySelectorAll(".infinite-scroll-item")[0].parentNode,a=document.querySelector(".load-more a"),i="",generateBlog.icon&&(i=generateBlog.icon),(o=generateBlog.infiniteScrollInit).outlayer=t,c=new InfiniteScroll(r,o),a&&a.addEventListener("click",function(e){document.activeElement.blur(),e.target.innerHTML=i+generateBlog.loading,e.target.classList.add("loading")}),c.on("append",function(e,n,o){a&&!document.querySelector(".generate-columns-container")&&r.appendChild(a.parentNode),o.forEach(function(e){e=e.querySelectorAll("img");e&&e.forEach(function(e){var n=e.outerHTML;e.outerHTML=n})}),l&&t&&imagesLoaded(l,function(){t.layout()}),a&&(a.innerHTML=i+generateBlog.more,a.classList.remove("loading")),document.body.dispatchEvent(new Event("post-load"))}),c.on("last",function(){var e=document.querySelector(".load-more");e&&(e.style.display="none")}))});

View File

@ -20,7 +20,7 @@ if ( ! function_exists( 'generate_disable_elements' ) ) {
function generate_disable_elements() {
// Don't run the function unless we're on a page it applies to.
if ( ! is_singular() ) {
return;
return '';
}
global $post;

View File

@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-polyfill', 'wp-server-side-render'), 'version' => 'c15a6f51f21c26086ca8fe73950ba89b');
<?php return array('dependencies' => array('lodash', 'react', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-edit-post', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-server-side-render'), 'version' => '16d169ea381b696418e6');

View File

@ -1,12 +1,6 @@
.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout{display:flex;align-items:center}.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block.block-list-appender{margin-left:20px}.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block-image{line-height:0}.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block-image figcaption{display:none}.inline-post-meta-area .wp-block{margin-left:0;margin-right:0}.gpp-dynamic-container-bg-dropdown .components-popover__content{width:275px}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:not(:last-child){margin-bottom:20px}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:last-child .components-base-control__field{margin-bottom:0}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:last-child .components-base-control__help{margin-top:3px}
.inline-post-meta-area.block-editor-block-list__layout,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout{align-items:center;display:flex}.inline-post-meta-area.block-editor-block-list__layout>.wp-block.block-list-appender,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout>.wp-block.block-list-appender,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block.block-list-appender{margin-left:20px}.inline-post-meta-area.block-editor-block-list__layout>.wp-block-image,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout>.wp-block-image,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block-image{line-height:0}.inline-post-meta-area.block-editor-block-list__layout>.wp-block-image figcaption,.inline-post-meta-area>.gb-inside-container.block-editor-block-list__layout>.wp-block-image figcaption,.inline-post-meta-area>.gb-inside-container>.block-editor-inner-blocks>.block-editor-block-list__layout>.wp-block-image figcaption{display:none}.inline-post-meta-area .wp-block{margin-left:0;margin-right:0}.gpp-dynamic-container-bg-dropdown .components-popover__content{width:275px}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:not(:last-child){margin-bottom:20px}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:last-child .components-base-control__field{margin-bottom:0}.gpp-dynamic-container-bg-dropdown .components-popover__content .components-base-control:last-child .components-base-control__help{margin-top:3px}
.gpp-dynamic-headline-text-dropdown .components-popover__content{width:275px}.gpp-dynamic-headline-text-dropdown .components-popover__content .components-base-control:not(:last-child){margin-bottom:20px}.gpp-dynamic-headline-text-dropdown .components-popover__content .components-base-control:last-child .components-base-control__field{margin-bottom:0}.gpp-dynamic-headline-text-dropdown .components-popover__content .components-base-control:last-child .components-base-control__help{margin-top:3px}.gpp-blocks-dynamic-text-replace-field{display:none}.gpp-block-dynamic-year .components-base-control__help{margin-top:2px}
.wp-block[data-type="generatepress/dynamic-content"]{margin-top:0;margin-bottom:0}
.wp-block[data-type="generatepress/dynamic-image"]{margin-top:0;margin-bottom:0;color:#fff}.wp-block[data-type="generatepress/dynamic-image"] .components-gpp-dynamic-image-placeholder__label{color:white;position:absolute;font-size:1em;top:0;left:0;right:0;bottom:0;display:flex;justify-content:center;align-items:center}.wp-block[data-type="generatepress/dynamic-image"] .components-gpp-dynamic-image-placeholder__label>.gpp-dynamic-featured-image__label{margin-left:10px}.wp-block[data-type="generatepress/dynamic-image"] .gpp-dynamic-image-placeholder{background:#000;vertical-align:middle}.wp-block[data-type="generatepress/dynamic-image"] .components-placeholder{width:100%}.wp-block[data-type="generatepress/dynamic-image"] .gpp-dynamic-image-preview{position:relative;display:inline-block}.wp-block[data-type="generatepress/dynamic-image"] .dynamic-author-image-rounded{border-radius:100%}
.components-generatepress-units-control-header__units{display:flex;justify-content:space-between;margin-bottom:5px;align-items:center}.components-generatepress-control__units .components-generatepress-control-buttons__units button.components-button{background:#fff;box-shadow:none !important;color:#929da7;font-size:10px;padding:0 5px;position:relative;text-align:center;text-shadow:none;border:0;border-radius:0 !important;line-height:20px;padding:0 5px;height:auto}.components-generatepress-control__units .components-generatepress-control-buttons__units button.components-button.is-primary{background:#fff !important;color:#000 !important;cursor:default;z-index:1;font-weight:bold}
.editor-styles-wrapper .is-root-container>.wp-block{max-width:var(--gp-block-element-width);margin-left:auto;margin-right:auto}.left-sidebar-block-type div:not(.block-editor-inner-blocks)>.block-editor-block-list__layout,.right-sidebar-block-type div:not(.block-editor-inner-blocks)>.block-editor-block-list__layout{padding:10px}.gpp-block-element-panel>.components-base-control{margin-bottom:20px}.gpp-block-element-panel .components-notice{margin:0}.gpp-block-element-panel .components-notice .components-notice__content{margin:0}.gpp-element-panel-label .components-panel__body-toggle.components-button{display:flex;flex-direction:row-reverse;justify-content:flex-end}.gpp-element-panel-label .components-panel__body-toggle.components-button svg.components-panel__icon{margin:0 10px 0 0}button.gpp-block-elements-template-button{cursor:pointer;background:#fff;border:1px solid #ddd;border-radius:5px;margin:0 0 10px;padding:5px}button.gpp-block-elements-template-button:hover{border-color:var(--wp-admin-theme-color)}button.gpp-block-elements-template-button .gpp-block-template-label{font-size:13px;color:#888;padding:5px}.element-has-parent #generate_premium_elements{display:none}.gpp-block-element-template-panel{background:#fafafa}.gpp-hook-select .gpp-block-element-search-select{width:100%;position:relative}.gpp-hook-select .components-text-control__input{position:relative;z-index:1;background:#fff url(data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E) no-repeat right 5px top 55%;background-size:13px 13px}.gpp-hook-select .select-search__select{background:#fff;border:1px solid #ddd}.gpp-hook-select .select-search__options{list-style:none}.gpp-hook-select .select-search__row:not(:first-child){border-top:1px solid #eee}.gpp-hook-select .select-search__row{margin:0}.gpp-hook-select .select-search__option,.gpp-hook-select .select-search__not-found{display:block;height:36px;width:100%;padding:0 16px;background:#fff;border:none;outline:none;text-align:left;cursor:pointer;margin:0}.gpp-hook-select .select-search__option.select-search__is-selected{background:#007cba;color:#fff}.gpp-hook-select .select-search__option.select-search__is-highlighted,.gpp-hook-select .select-search__option:not(.select-search__is-selected):hover{background:#fafafa}.gpp-hook-select .select-search__option.select-search__is-highlighted.select-search__is-selected,.gpp-hook-select .select-search__option.select-search__is-selected:hover{background:#007cba;color:#fff}.gpp-hook-select .select-search__group-header{font-size:10px;text-transform:uppercase;background:#eee;padding:8px 16px}.gpp-hook-select .gpp-block-element-search-select.is-disabled{opacity:0.5}.gpp-hook-select .gpp-block-element-search-select.is-loading .select-search__value::after{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='50' height='50' viewBox='0 0 50 50'%3E%3Cpath fill='%232F2D37' d='M25,5A20.14,20.14,0,0,1,45,22.88a2.51,2.51,0,0,0,2.49,2.26h0A2.52,2.52,0,0,0,50,22.33a25.14,25.14,0,0,0-50,0,2.52,2.52,0,0,0,2.5,2.81h0A2.51,2.51,0,0,0,5,22.88,20.14,20.14,0,0,1,25,5Z'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='0.6s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");background-size:11px}.gpp-hook-select .gpp-block-element-search-select:not(.is-disabled) .select-search__input{cursor:pointer}.gpp-hook-select .gpp-block-element-search-select:not(.select-search--multiple) .select-search__select{position:absolute;z-index:2;top:35px;right:0;left:0;border-radius:3px;overflow:auto;max-height:360px}.gpp-hook-select .select-search__not-found{height:auto;padding:16px;text-align:center;color:#888}
.wp-block[data-type="generatepress/dynamic-content"]{margin-bottom:0;margin-top:0}
.wp-block[data-type="generatepress/dynamic-image"]{color:#fff;margin-bottom:0;margin-top:0}.wp-block[data-type="generatepress/dynamic-image"] .components-gpp-dynamic-image-placeholder__label{align-items:center;bottom:0;color:#fff;display:flex;font-size:1em;justify-content:center;left:0;position:absolute;right:0;top:0}.wp-block[data-type="generatepress/dynamic-image"] .components-gpp-dynamic-image-placeholder__label>.gpp-dynamic-featured-image__label{margin-left:10px}.wp-block[data-type="generatepress/dynamic-image"] .gpp-dynamic-image-placeholder{background:#000;vertical-align:middle}.wp-block[data-type="generatepress/dynamic-image"] .components-placeholder{width:100%}.wp-block[data-type="generatepress/dynamic-image"] .gpp-dynamic-image-preview{display:inline-block;position:relative}.wp-block[data-type="generatepress/dynamic-image"] .dynamic-author-image-rounded{border-radius:100%}
.components-generatepress-units-control-header__units{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px}.components-generatepress-control__units .components-generatepress-control-buttons__units button.components-button{background:#fff;border:0;border-radius:0!important;box-shadow:none!important;color:#929da7;font-size:10px;height:auto;line-height:20px;padding:0 5px;position:relative;text-align:center;text-shadow:none}.components-generatepress-control__units .components-generatepress-control-buttons__units button.components-button.is-primary{background:#fff!important;color:#000!important;cursor:default;font-weight:700;z-index:1}
.editor-styles-wrapper .is-root-container>.wp-block{margin-left:auto;margin-right:auto;max-width:var(--gp-block-element-width)}.left-sidebar-block-type div:not(.block-editor-inner-blocks)>.block-editor-block-list__layout,.right-sidebar-block-type div:not(.block-editor-inner-blocks)>.block-editor-block-list__layout{padding:10px}.gpp-block-element-panel>.components-base-control{margin-bottom:20px}.gpp-block-element-panel .components-notice,.gpp-block-element-panel .components-notice .components-notice__content{margin:0}.gpp-element-panel-label .components-panel__body-toggle.components-button{display:flex;flex-direction:row-reverse;justify-content:flex-end}.gpp-element-panel-label .components-panel__body-toggle.components-button svg.components-panel__icon{margin:0 10px 0 0}button.gpp-block-elements-template-button{background:#fff;border:1px solid #ddd;border-radius:5px;cursor:pointer;margin:0 0 10px;padding:5px}button.gpp-block-elements-template-button:hover{border-color:var(--wp-admin-theme-color)}button.gpp-block-elements-template-button .gpp-block-template-label{color:#888;font-size:13px;padding:5px}.element-has-parent #generate_premium_elements{display:none}.gpp-block-element-template-panel{background:#fafafa}.gpp-hook-select .gpp-block-element-search-select{position:relative;width:100%}.gpp-hook-select .components-text-control__input{background:#fff url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E") no-repeat right 5px top 55%;background-size:13px 13px;position:relative;z-index:1}.gpp-hook-select .select-search__select{background:#fff;border:1px solid #ddd}.gpp-hook-select .select-search__options{list-style:none}.gpp-hook-select .select-search__row:not(:first-child){border-top:1px solid #eee}.gpp-hook-select .select-search__row{margin:0}.gpp-hook-select .select-search__not-found,.gpp-hook-select .select-search__option{background:#fff;border:none;cursor:pointer;display:block;height:36px;margin:0;outline:none;padding:0 10px;text-align:left;width:100%}.gpp-hook-select .select-search__option.select-search__is-selected{background:#007cba;color:#fff}.gpp-hook-select .select-search__option.select-search__is-highlighted,.gpp-hook-select .select-search__option:not(.select-search__is-selected):hover{background:#fafafa}.gpp-hook-select .select-search__option.select-search__is-highlighted.select-search__is-selected,.gpp-hook-select .select-search__option.select-search__is-selected:hover{background:#007cba;color:#fff}.gpp-hook-select .select-search__group-header{background:#eee;font-size:10px;padding:8px 10px;text-transform:uppercase}.gpp-hook-select .gpp-block-element-search-select.is-disabled{opacity:.5}.gpp-hook-select .gpp-block-element-search-select.is-loading .select-search__value:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2750%27 height=%2750%27%3E%3Cpath fill=%27%232F2D37%27 d=%27M25 5a20.14 20.14 0 0 1 20 17.88 2.51 2.51 0 0 0 2.49 2.26A2.52 2.52 0 0 0 50 22.33a25.14 25.14 0 0 0-50 0 2.52 2.52 0 0 0 2.5 2.81A2.51 2.51 0 0 0 5 22.88 20.14 20.14 0 0 1 25 5Z%27%3E%3CanimateTransform attributeName=%27transform%27 type=%27rotate%27 from=%270 25 25%27 to=%27360 25 25%27 dur=%270.6s%27 repeatCount=%27indefinite%27/%3E%3C/path%3E%3C/svg%3E");background-size:11px}.gpp-hook-select .gpp-block-element-search-select:not(.is-disabled) .select-search__input{cursor:pointer}.gpp-hook-select .gpp-block-element-search-select:not(.select-search--multiple) .select-search__select{border-radius:3px;left:0;max-height:360px;overflow:auto;position:absolute;right:0;top:35px;z-index:2}.gpp-hook-select .select-search__not-found{color:#888;height:auto;padding:16px;text-align:center}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-hooks', 'wp-i18n', 'wp-polyfill'), 'version' => '2203a0ee5857519ea0c5070720a7bb4a');
<?php return array('dependencies' => array('wp-hooks', 'wp-i18n'), 'version' => '71ce575bd9a3b2ae77bd');

View File

@ -1 +1 @@
!function(e){var o={};function r(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=o,r.d=function(e,o,t){r.o(e,o)||Object.defineProperty(e,o,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,o){if(1&o&&(e=r(e)),8&o)return e;if(4&o&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&o&&"string"!=typeof e)for(var n in e)r.d(t,n,function(o){return e[o]}.bind(null,n));return t},r.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(o,"a",o),o},r.o=function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r.p="",r(r.s=62)}({1:function(e,o){e.exports=window.wp.i18n},16:function(e,o){e.exports=function(e,o,r){return o in e?Object.defineProperty(e,o,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[o]=r,e}},62:function(e,o,r){"use strict";r.r(o);var t=r(16),n=r.n(t),a=r(8),u=r(1);function c(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function l(e){for(var o=1;o<arguments.length;o++){var r=null!=arguments[o]?arguments[o]:{};o%2?c(Object(r),!0).forEach((function(o){n()(e,o,r[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(r,o))}))}return e}Object(a.addFilter)("generate_typography_element_groups","generatepress-pro/customizer/add-typography-groups",(function(e){var o={};return gpCustomizerControls.hasSecondaryNav&&(o.secondaryNavigation=Object(u.__)("Secondary Navigation","gp-premium")),gpCustomizerControls.hasMenuPlus&&(o.offCanvasPanel=Object(u.__)("Off-Canvas Panel","gp-premium")),gpCustomizerControls.hasWooCommerce&&(o.wooCommerce=Object(u.__)("WooCommerce","gp-premium")),l(l({},e),o)})),Object(a.addFilter)("generate_typography_elements","generatepress-pro/customizer/add-typography-elements",(function(e){var o={};return gpCustomizerControls.hasSecondaryNav&&(o["secondary-nav-menu-items"]={module:"secondary-nav",group:"secondaryNavigation",label:Object(u.__)("Secondary Menu Items","gp-premium"),placeholders:{fontSize:{value:"13",min:6,max:30,step:1}}},o["secondary-nav-sub-menu-items"]={module:"secondary-nav",group:"secondaryNavigation",label:Object(u.__)("Secondary Sub-Menu Items","gp-premium"),placeholders:{fontSize:{value:"12",min:6,max:30,step:1}}},o["secondary-nav-menu-toggle"]={module:"secondary-nav",group:"secondaryNavigation",label:Object(u.__)("Secondary Mobile Menu Toggle","gp-premium"),placeholders:{fontSize:{value:"13",min:6,max:30,step:1}}}),gpCustomizerControls.hasMenuPlus&&(o["off-canvas-panel-menu-items"]={module:"off-canvas-panel",group:"offCanvasPanel",label:Object(u.__)("Off-Canvas Menu Items","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:30,step:1}}},o["off-canvas-panel-sub-menu-items"]={module:"off-canvas-panel",group:"offCanvasPanel",label:Object(u.__)("Off-Canvas Sub-Menu Items","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:30,step:1}}}),gpCustomizerControls.hasWooCommerce&&(o["woocommerce-catalog-product-titles"]={module:"woocommerce",group:"wooCommerce",label:Object(u.__)("Catalog Product Titles","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:50,step:1}}},o["woocommerce-related-product-titles"]={module:"woocommerce",group:"wooCommerce",label:Object(u.__)("Related/Upsell Product Titles","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:50,step:1}}}),l(l({},e),o)}))},8:function(e,o){e.exports=window.wp.hooks}});
!function(){"use strict";function e(o){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(o)}function o(o,r,t){return(r=function(o){var r=function(o,r){if("object"!==e(o)||null===o)return o;var t=o[Symbol.toPrimitive];if(void 0!==t){var n=t.call(o,"string");if("object"!==e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}(o);return"symbol"===e(r)?r:String(r)}(r))in o?Object.defineProperty(o,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):o[r]=t,o}var r=window.wp.hooks,t=window.wp.i18n;function n(e,o){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),r.push.apply(r,t)}return r}function a(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?n(Object(t),!0).forEach((function(r){o(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(t,o))}))}return e}(0,r.addFilter)("generate_typography_element_groups","generatepress-pro/customizer/add-typography-groups",(function(e){var o={};return gpCustomizerControls.hasSecondaryNav&&(o.secondaryNavigation=(0,t.__)("Secondary Navigation","gp-premium")),gpCustomizerControls.hasMenuPlus&&(o.offCanvasPanel=(0,t.__)("Off-Canvas Panel","gp-premium")),gpCustomizerControls.hasWooCommerce&&(o.wooCommerce=(0,t.__)("WooCommerce","gp-premium")),a(a({},e),o)})),(0,r.addFilter)("generate_typography_elements","generatepress-pro/customizer/add-typography-elements",(function(e){var o={};return gpCustomizerControls.hasSecondaryNav&&(o["secondary-nav-menu-items"]={module:"secondary-nav",group:"secondaryNavigation",label:(0,t.__)("Secondary Menu Items","gp-premium"),placeholders:{fontSize:{value:"13",min:6,max:30,step:1}}},o["secondary-nav-sub-menu-items"]={module:"secondary-nav",group:"secondaryNavigation",label:(0,t.__)("Secondary Sub-Menu Items","gp-premium"),placeholders:{fontSize:{value:"12",min:6,max:30,step:1}}},o["secondary-nav-menu-toggle"]={module:"secondary-nav",group:"secondaryNavigation",label:(0,t.__)("Secondary Mobile Menu Toggle","gp-premium"),placeholders:{fontSize:{value:"13",min:6,max:30,step:1}}}),gpCustomizerControls.hasMenuPlus&&(o["off-canvas-panel-menu-items"]={module:"off-canvas-panel",group:"offCanvasPanel",label:(0,t.__)("Off-Canvas Menu Items","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:30,step:1}}},o["off-canvas-panel-sub-menu-items"]={module:"off-canvas-panel",group:"offCanvasPanel",label:(0,t.__)("Off-Canvas Sub-Menu Items","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:30,step:1}}}),gpCustomizerControls.hasWooCommerce&&(o["woocommerce-catalog-product-titles"]={module:"woocommerce",group:"wooCommerce",label:(0,t.__)("Catalog Product Titles","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:50,step:1}}},o["woocommerce-related-product-titles"]={module:"woocommerce",group:"wooCommerce",label:(0,t.__)("Related/Upsell Product Titles","gp-premium"),placeholders:{fontSize:{value:"",min:6,max:50,step:1}}}),a(a({},e),o)}))}();

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n', 'wp-polyfill'), 'version' => 'e35c34fc35cf9392a18646bdbdbbcac5');
<?php return array('dependencies' => array('wp-api-fetch', 'wp-components', 'wp-element', 'wp-i18n'), 'version' => '204b0a224864701c559a');

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
<?php return array('dependencies' => array('wp-edit-post', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-plugins', 'wp-polyfill'), 'version' => '57a67d3ae8b04c7fa16a7bfc74c0c4b6');
<?php return array('dependencies' => array('wp-edit-post', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-plugins'), 'version' => '27f43589f8077aec0cae');

View File

@ -1,2 +1 @@
.gpp-active-element-type{color:#555;font-size:11px;text-transform:uppercase}

View File

@ -1 +1 @@
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=63)}({0:function(e,t){e.exports=window.wp.element},1:function(e,t){e.exports=window.wp.i18n},10:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}},11:function(e,t,n){var r=n(24);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&r(e,t)}},12:function(e,t,n){var r=n(14),o=n(13);e.exports=function(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?o(e):t}},13:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},14:function(e,t){function n(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=n=function(e){return typeof e}:e.exports=n=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(t)}e.exports=n},20:function(e,t){e.exports=window.wp.htmlEntities},24:function(e,t){function n(t,r){return e.exports=n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(t,r)}e.exports=n},25:function(e,t){e.exports=window.wp.plugins},26:function(e,t){e.exports=window.wp.editPost},5:function(e,t){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(t)}e.exports=n},53:function(e,t,n){},63:function(e,t,n){"use strict";n.r(t);var r=n(9),o=n.n(r),c=n(10),i=n.n(c),u=n(11),l=n.n(u),f=n(12),p=n.n(f),a=n(5),s=n.n(a),m=n(0),b=(n(53),n(1)),y=n(25),d=n(26),g=n(20);var O=function(e){l()(c,e);var t,n,r=(t=c,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,r=s()(t);if(n){var o=s()(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return p()(this,e)});function c(){return o()(this,c),r.apply(this,arguments)}return i()(c,[{key:"render",value:function(){var e=gpPremiumEditor.activeElements;return!e||e.length<1?null:gpPremiumEditor.postTypeIsPublic?Object(m.createElement)(d.PluginDocumentSettingPanel,{name:"generatepress-elements-info",title:Object(b.__)("Active Elements","gp-premium"),className:"gpp-element-info-panel gpp-element-panel-label"},Object(m.createElement)(m.Fragment,null,Object(m.createElement)("ul",{className:"gpp-active-elements"},Object.keys(e).map((function(t,n){return Object(m.createElement)("li",{key:"gpp-active-block-element-".concat(n)},Object(m.createElement)("a",{href:e[t].url+"&action=edit"},Object(g.decodeEntities)(e[t].name))," ",Object(m.createElement)("span",{className:"gpp-active-element-type"},"- ",e[t].type))}))),Object(m.createElement)("a",{href:gpPremiumEditor.elementsUrl,className:"components-button is-secondary"},Object(b.__)("All Elements","gp-premium")))):null}}]),c}(m.Component);Object(y.registerPlugin)("generatepress-elements-info-panel",{icon:null,render:O})},9:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}}});
!function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(i=o.key,c=void 0,c=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i),"symbol"===e(c)?c:String(c)),o)}var i,c}function n(e,t){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},n(e,t)}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}var o=window.wp.element,i=window.wp.i18n,c=window.wp.plugins,l=window.wp.editPost,u=window.wp.htmlEntities;function a(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var o,i=r(t);if(n){var c=r(this).constructor;o=Reflect.construct(i,arguments,c)}else o=i.apply(this,arguments);return function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}(this,o)}}var p=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}(f,e);var r,c,p=a(f);function f(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),p.apply(this,arguments)}return r=f,(c=[{key:"render",value:function(){var e=gpPremiumEditor.activeElements;return!e||e.length<1?null:gpPremiumEditor.postTypeIsPublic?(0,o.createElement)(l.PluginDocumentSettingPanel,{name:"generatepress-elements-info",title:(0,i.__)("Active Elements","gp-premium"),className:"gpp-element-info-panel gpp-element-panel-label"},(0,o.createElement)(o.Fragment,null,(0,o.createElement)("ul",{className:"gpp-active-elements"},Object.keys(e).map((function(t,n){return(0,o.createElement)("li",{key:"gpp-active-block-element-".concat(n)},(0,o.createElement)("a",{href:e[t].url+"&action=edit"},(0,u.decodeEntities)(e[t].name))," ",(0,o.createElement)("span",{className:"gpp-active-element-type"},"- ",e[t].type))}))),(0,o.createElement)("a",{href:gpPremiumEditor.elementsUrl,className:"components-button is-secondary"},(0,i.__)("All Elements","gp-premium")))):null}}])&&t(r.prototype,c),Object.defineProperty(r,"prototype",{writable:!1}),f}(o.Component);(0,c.registerPlugin)("generatepress-elements-info-panel",{icon:null,render:p})}();

View File

@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-html-entities', 'wp-i18n', 'wp-polyfill'), 'version' => 'a37968473cc463c9f3317b1189943848');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-element', 'wp-html-entities', 'wp-i18n'), 'version' => 'c153dcc4d45dc270e00f');

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,4 @@
.generatepress-module-action{text-decoration:none;font-size:12px;font-weight:normal;display:inline-block;margin-left:10px;line-height:1}.generatepress-dashboard__section-item-settings{display:flex;align-items:center}.generatepress-dashboard__section-item-settings button{height:30px;font-size:11px;justify-content:center !important}.generatepress-dashboard__section-item-settings button .components-spinner{margin-top:0}.generatepress-dashboard__section-item-settings button svg{height:20px;width:20px;margin:0 !important}.generatepress-dashboard__section-item-settings button:not(:last-child){margin-right:5px}
.generatepress-license-key-area .generatepress-dashboard__section-item-message{background:#ffffff}.generatepress-license-key-area .generatepress-dashboard__section-item{flex-wrap:wrap;justify-content:flex-start}.generatepress-license-key-area .generatepress-dashboard__section-item-content{flex-basis:40%;display:flex}.generatepress-license-key-area .generatepress-dashboard__section-item-content .generatepress-dashboard__section-license-key{flex:max-content}.generatepress-license-key-area .generatepress-dashboard__section-item-content .generatepress-dashboard__section-clear-license-key button{height:31px;margin-left:8px}.generatepress-license-key-area .generatepress-dashboard__section-item-action{margin-left:auto}.generatepress-license-key-area .generatepress-dashboard__section-beta-tester{margin-left:20px;padding-left:20px;display:flex;align-items:center;border-left:1px solid #ddd}.generatepress-license-key-area .generatepress-dashboard__section-beta-tester .components-base-control__field{height:30px}.generatepress-license-key-area .generatepress-dashboard__section-license-notice{flex-basis:100%;margin:0 0 20px}.generatepress-license-key-area .components-base-control__help,.generatepress-license-key-area .components-base-control__field{margin-bottom:0}@media (max-width: 768px){.generatepress-license-key-area .generatepress-dashboard__section-item-content{flex-basis:100%}.generatepress-license-key-area .generatepress-dashboard__section-beta-tester{flex-basis:100%;border-left:0;padding-left:0;margin:20px 0}.generatepress-license-key-area .generatepress-dashboard__section-beta-tester .components-base-control__field{height:auto}.generatepress-license-key-area .generatepress-dashboard__section-item-action{margin-left:0}}
.generatepress-dashboard__section-item-action input[type="file"]{padding:5px;border:1px solid #ddd}.generatepress-dashboard__section-item-export-popover .components-popover__content{padding:20px}
.generatepress-module-action{display:inline-block;font-size:12px;font-weight:400;line-height:1;margin-left:10px;text-decoration:none}.generatepress-dashboard__section-item-settings{align-items:center;display:flex}.generatepress-dashboard__section-item-settings button{font-size:11px;height:30px;justify-content:center!important}.generatepress-dashboard__section-item-settings button .components-spinner{margin-top:0}.generatepress-dashboard__section-item-settings button svg{height:20px;margin:0!important;width:20px}.generatepress-dashboard__section-item-settings button:not(:last-child){margin-right:5px}
.generatepress-license-key-area .generatepress-dashboard__section-item-message{background:#fff}.generatepress-license-key-area .generatepress-dashboard__section-item{flex-wrap:wrap;justify-content:flex-start}.generatepress-license-key-area .generatepress-dashboard__section-license-key{display:flex;flex:1}.generatepress-license-key-area .generatepress-dashboard__section-license-key .components-base-control{flex:1}.generatepress-license-key-area .generatepress-dashboard__section-license-key button{height:31px;margin-left:8px}.generatepress-license-key-area .generatepress-dashboard__section-beta-tester{align-items:center;display:flex;flex-basis:100%;margin-top:30px}.generatepress-license-key-area .generatepress-dashboard__section-license-notice{flex-basis:100%;margin:0 0 20px}.generatepress-license-key-area .components-base-control__field,.generatepress-license-key-area .components-base-control__help{margin-bottom:0}
.generatepress-dashboard__section-item-action input[type=file]{border:1px solid #ddd;padding:5px}.generatepress-dashboard__section-item-export-popover .components-popover__content{padding:20px}
.generatepress-dashboard__section-item-modules{margin-top:20px}

View File

@ -3,12 +3,23 @@ jQuery( function( $ ) {
e.preventDefault();
$( '.choose-element-type-parent' ).show();
$( '.choose-element-type .select-type' ).focus();
} );
$( '.close-choose-element-type' ).on( 'click', function( e ) {
e.preventDefault();
$( '.choose-element-type-parent' ).hide();
$( '.page-title-action' ).focus();
} );
$( '.post-type-gp_elements' ).on( 'keyup', function( e ) {
const $element = $( '.choose-element-type-parent' );
if ( e.key === 'Escape' && $element.is( ':visible' ) ) {
$element.hide();
$( '.page-title-action' ).focus();
}
} );
// Don't allow Elements to quick edit parents.

View File

@ -78,8 +78,11 @@ class GeneratePress_Block_Elements {
wp_set_script_translations( 'gp-premium-block-elements', 'gp-premium', GP_PREMIUM_DIR_PATH . 'langs' );
$taxonomies = get_taxonomies(
array(
'public' => true,
apply_filters(
'generate_get_block_element_taxonomies_args',
array(
'public' => true,
)
)
);
@ -310,7 +313,13 @@ class GeneratePress_Block_Elements {
* Build our content block.
*/
public function do_content_block() {
if ( 'gp_elements' !== get_post_type() && ! is_admin() ) {
// Prevents infinite loops while in the editor or autosaving.
$nonpublic_post_types = array(
'gp_elements',
'revision',
);
if ( ! in_array( get_post_type(), $nonpublic_post_types ) && ! is_admin() ) {
return sprintf(
'<div class="dynamic-entry-content">%s</div>',
apply_filters( 'the_content', str_replace( ']]>', ']]&gt;', get_the_content() ) ) // phpcs:ignore -- Core filter.
@ -755,6 +764,10 @@ class GeneratePress_Block_Elements {
$post_title = post_type_archive_title( '', false );
} elseif ( is_archive() && function_exists( 'get_the_archive_title' ) ) {
$post_title = get_the_archive_title();
if ( is_author() ) {
$post_title = get_the_author();
}
} elseif ( is_home() ) {
$page_for_posts = get_option( 'page_for_posts' );
@ -1303,7 +1316,13 @@ class GeneratePress_Block_Elements {
public function set_dynamic_container_url( $attributes, $settings ) {
$link_type = ! empty( $settings['gpDynamicLinkType'] ) ? $settings['gpDynamicLinkType'] : '';
if ( $link_type && '' !== $settings['url'] && ( 'wrapper' === $settings['linkType'] || 'hidden-link' === $settings['linkType'] ) ) {
if (
$link_type &&
isset( $settings['url'] ) &&
isset( $settings['linkType'] ) &&
'' !== $settings['url'] &&
( 'wrapper' === $settings['linkType'] || 'hidden-link' === $settings['linkType'] )
) {
if ( ! empty( $link_type ) ) {
$source = ! empty( $settings['gpDynamicSource'] ) ? $settings['gpDynamicSource'] : 'current-post';
$id = $this->get_source_id( $source, $settings );

View File

@ -132,6 +132,10 @@ class GeneratePress_Block_Element {
case 'loop-template':
$hook = 'generate_before_main_content';
break;
case 'search-modal':
$hook = 'generate_inside_search_modal';
break;
}
if ( 'custom' === $hook && $custom_hook ) {
@ -181,6 +185,10 @@ class GeneratePress_Block_Element {
add_filter( 'post_class', array( $this, 'post_classes' ) );
}
if ( 'search-modal' === $this->type ) {
remove_action( 'generate_inside_search_modal', 'generate_do_search_fields' );
}
add_action( 'wp', array( $this, 'remove_elements' ), 100 );
add_action( esc_attr( $hook ), array( $this, 'build_hook' ), absint( $priority ) );
add_filter( 'generateblocks_do_content', array( $this, 'do_block_content' ) );
@ -291,6 +299,7 @@ class GeneratePress_Block_Element {
}
remove_action( 'generate_archive_title', 'generate_archive_title' );
remove_filter( 'get_the_archive_title', 'generate_filter_the_archive_title' );
// WooCommerce removal.
if ( class_exists( 'WooCommerce' ) ) {

View File

@ -194,6 +194,10 @@ class GeneratePress_Elements_Helper {
$label = __( 'Content Template', 'gp-premium' );
break;
case 'loop-template':
$label = __( 'Loop Template', 'gp-premium' );
break;
case 'post-meta-template':
$label = __( 'Post Meta Template', 'gp-premium' );
break;

View File

@ -890,6 +890,7 @@ class GeneratePress_Hero {
}
remove_action( 'generate_archive_title', 'generate_archive_title' );
remove_filter( 'get_the_archive_title', 'generate_filter_the_archive_title' );
add_filter( 'post_class', array( self::$hero, 'remove_hentry' ) );
}
@ -935,6 +936,10 @@ class GeneratePress_Hero {
$post_title = post_type_archive_title( '', false );
} elseif ( is_archive() && function_exists( 'get_the_archive_title' ) ) {
$post_title = get_the_archive_title();
if ( is_author() ) {
$post_title = get_the_author();
}
} elseif ( is_home() ) {
$post_title = __( 'Blog', 'gp-premium' );
}

View File

@ -241,6 +241,7 @@ class GeneratePress_Elements_Post_Type {
'site-header',
'page-hero',
'content-template',
'loop-template',
'post-meta-template',
'post-navigation-template',
'archive-navigation-template',

View File

@ -227,12 +227,10 @@ class GeneratePress_External_CSS_File {
return false;
}
global $wp_filesystem;
$filesystem = generate_premium_get_wp_filesystem();
// Initialize the WordPress filesystem.
if ( empty( $wp_filesystem ) ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
WP_Filesystem();
if ( ! $filesystem ) {
return false;
}
// Take care of domain mapping.
@ -252,7 +250,7 @@ class GeneratePress_External_CSS_File {
$chmod_file = FS_CHMOD_FILE;
}
if ( ! $wp_filesystem->put_contents( $this->file( 'path' ), wp_strip_all_tags( $content ), $chmod_file ) ) {
if ( ! $filesystem->put_contents( $this->file( 'path' ), wp_strip_all_tags( $content ), $chmod_file ) ) {
// Fail!
return false;

View File

@ -3,7 +3,7 @@
* Plugin Name: GP Premium
* Plugin URI: https://generatepress.com
* Description: The entire collection of GeneratePress premium modules.
* Version: 2.2.2
* Version: 2.3.0
* Requires at least: 5.2
* Requires PHP: 5.6
* Author: Tom Usborne
@ -19,7 +19,7 @@ if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
define( 'GP_PREMIUM_VERSION', '2.2.2' );
define( 'GP_PREMIUM_VERSION', '2.3.0' );
define( 'GP_PREMIUM_DIR_PATH', plugin_dir_path( __FILE__ ) );
define( 'GP_PREMIUM_DIR_URL', plugin_dir_url( __FILE__ ) );
define( 'GP_LIBRARY_DIRECTORY', plugin_dir_path( __FILE__ ) . 'library/' );

View File

@ -81,6 +81,16 @@ class GeneratePress_Pro_Rest extends WP_REST_Controller {
)
);
register_rest_route(
$namespace,
'/beta/',
array(
'methods' => WP_REST_Server::EDITABLE,
'callback' => array( $this, 'update_beta_testing' ),
'permission_callback' => array( $this, 'update_settings_permission' ),
)
);
register_rest_route(
$namespace,
'/export/',
@ -167,14 +177,12 @@ class GeneratePress_Pro_Rest extends WP_REST_Controller {
*/
public function update_licensing( WP_REST_Request $request ) {
$new_license_key = $request->get_param( 'key' );
$new_beta_tester = $request->get_param( 'betaTester' );
$old_license = get_option( 'gen_premium_license_key', '' );
$old_status = get_option( 'gen_premium_license_key_status', 'deactivated' );
$new_license = strpos( $new_license_key, '***' ) !== false
? trim( $old_license )
: trim( $new_license_key );
if ( $new_license ) {
$api_params = array(
'edd_action' => 'activate_license',
@ -257,14 +265,35 @@ class GeneratePress_Pro_Rest extends WP_REST_Controller {
update_option( 'gen_premium_license_key_status', esc_attr( $license_data->license ) );
}
update_option( 'gen_premium_license_key', sanitize_key( $new_license ) );
if ( ! isset( $api_params ) ) {
return $this->success( __( 'Settings saved.', 'gp-premium' ) );
}
if ( ! empty( $message ) ) {
return $this->failed( $message );
}
return $this->success( $license_data );
}
/**
* Update licensing.
*
* @param WP_REST_Request $request request object.
*
* @return mixed
*/
public function update_beta_testing( WP_REST_Request $request ) {
$new_beta_tester = $request->get_param( 'beta' );
if ( ! empty( $new_beta_tester ) ) {
update_option( 'gp_premium_beta_testing', true, false );
} else {
delete_option( 'gp_premium_beta_testing' );
}
update_option( 'gen_premium_license_key', sanitize_key( $new_license ) );
if ( ! isset( $api_params ) ) {
return $this->success( __( 'Settings saved.', 'gp-premium' ) );
}

View File

@ -107,3 +107,46 @@ function generate_premium_remove_featured_image_class( $classes, $remove_class )
return $classes;
}
/**
* Returns the global $wp_filesystem with credentials set.
* Returns null in case of any errors.
*
* @return WP_Filesystem_Base|null
*/
function generate_premium_get_wp_filesystem() {
global $wp_filesystem;
$success = true;
// Initialize the file system if it has not been done yet.
if ( ! $wp_filesystem ) {
require_once ABSPATH . '/wp-admin/includes/file.php';
$constants = array(
'hostname' => 'FTP_HOST',
'username' => 'FTP_USER',
'password' => 'FTP_PASS',
'public_key' => 'FTP_PUBKEY',
'private_key' => 'FTP_PRIKEY',
);
$credentials = array();
// We provide credentials based on wp-config.php constants.
// Reference https://developer.wordpress.org/apis/wp-config-php/#wordpress-upgrade-constants.
foreach ( $constants as $key => $constant ) {
if ( defined( $constant ) ) {
$credentials[ $key ] = constant( $constant );
}
}
$success = WP_Filesystem( $credentials );
}
if ( ! $success || $wp_filesystem->errors->has_errors() ) {
return null;
}
return $wp_filesystem;
}

View File

@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Allows plugins to use their own update API.
*
* @author Easy Digital Downloads
* @version 1.9.0
* @version 1.9.2
*/
class GeneratePress_Premium_Plugin_Updater {
@ -21,7 +21,7 @@ class GeneratePress_Premium_Plugin_Updater {
private $version = '';
private $wp_override = false;
private $beta = false;
private $health_check_timeout = 5;
private $failed_request_cache_key;
/**
* Class constructor.
@ -37,14 +37,15 @@ class GeneratePress_Premium_Plugin_Updater {
global $edd_plugin_data;
$this->api_url = trailingslashit( $_api_url );
$this->api_data = $_api_data;
$this->plugin_file = $_plugin_file;
$this->name = plugin_basename( $_plugin_file );
$this->slug = basename( $_plugin_file, '.php' );
$this->version = $_api_data['version'];
$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
$this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
$this->api_url = trailingslashit( $_api_url );
$this->api_data = $_api_data;
$this->plugin_file = $_plugin_file;
$this->name = plugin_basename( $_plugin_file );
$this->slug = basename( $_plugin_file, '.php' );
$this->version = $_api_data['version'];
$this->wp_override = isset( $_api_data['wp_override'] ) ? (bool) $_api_data['wp_override'] : false;
$this->beta = ! empty( $this->api_data['beta'] ) ? true : false;
$this->failed_request_cache_key = 'edd_sl_failed_http_' . md5( $this->api_url );
$edd_plugin_data[ $this->slug ] = $this->api_data;
@ -142,6 +143,7 @@ class GeneratePress_Premium_Plugin_Updater {
// This is required for your plugin to support auto-updates in WordPress 5.5.
$version_info->plugin = $this->name;
$version_info->id = $this->name;
$version_info->tested = $this->get_tested_version( $version_info );
$this->set_version_info_cache( $version_info );
}
@ -149,6 +151,38 @@ class GeneratePress_Premium_Plugin_Updater {
return $version_info;
}
/**
* Gets the plugin's tested version.
*
* @since 1.9.2
* @param object $version_info
* @return null|string
*/
private function get_tested_version( $version_info ) {
// There is no tested version.
if ( empty( $version_info->tested ) ) {
return null;
}
// Strip off extra version data so the result is x.y or x.y.z.
list( $current_wp_version ) = explode( '-', get_bloginfo( 'version' ) );
// The tested version is greater than or equal to the current WP version, no need to do anything.
if ( version_compare( $version_info->tested, $current_wp_version, '>=' ) ) {
return $version_info->tested;
}
$current_version_parts = explode( '.', $current_wp_version );
$tested_parts = explode( '.', $version_info->tested );
// The current WordPress version is x.y.z, so update the tested version to match it.
if ( isset( $current_version_parts[2] ) && $current_version_parts[0] === $tested_parts[0] && $current_version_parts[1] === $tested_parts[1] ) {
$tested_parts[2] = $current_version_parts[2];
}
return implode( '.', $tested_parts );
}
/**
* Show the update notification on multisite subsites.
*
@ -162,7 +196,8 @@ class GeneratePress_Premium_Plugin_Updater {
return;
}
if ( ! current_user_can( 'update_plugins' ) ) {
// Allow single site admins to see that an update is available.
if ( ! current_user_can( 'activate_plugins' ) ) {
return;
}
@ -223,17 +258,22 @@ class GeneratePress_Premium_Plugin_Updater {
esc_html( $plugin['Name'] )
);
if ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) {
if ( ! current_user_can( 'update_plugins' ) ) {
echo ' ';
esc_html_e( 'Contact your network administrator to install the update.', 'easy-digital-downloads' );
} elseif ( empty( $update_cache->response[ $this->name ]->package ) && ! empty( $changelog_link ) ) {
echo ' ';
printf(
/* translators: 1. opening anchor tag, do not translate 2. the new plugin version 3. closing anchor tag, do not translate. */
__( ' %1$sView version %2$s details%3$s.', 'easy-digital-downloads' ),
__( '%1$sView version %2$s details%3$s.', 'easy-digital-downloads' ),
'<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">',
esc_html( $update_cache->response[ $this->name ]->new_version ),
'</a>'
);
} elseif ( ! empty( $changelog_link ) ) {
echo ' ';
printf(
__( ' %1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ),
__( '%1$sView version %2$s details%3$s or %4$supdate now%5$s.', 'easy-digital-downloads' ),
'<a target="_blank" class="thickbox open-plugin-details-modal" href="' . esc_url( $changelog_link ) . '">',
esc_html( $update_cache->response[ $this->name ]->new_version ),
'</a>',
@ -394,40 +434,9 @@ class GeneratePress_Premium_Plugin_Updater {
*
* @param string $_action The requested action.
* @param array $_data Parameters for the API action.
* @return false|object
* @return false|object|void
*/
private function api_request( $_action, $_data ) {
global $edd_plugin_url_available;
// Do a quick status check on this domain if we haven't already checked it.
$store_hash = md5( $this->api_url );
if ( ! is_array( $edd_plugin_url_available ) || ! isset( $edd_plugin_url_available[ $store_hash ] ) ) {
$test_url_parts = wp_parse_url( $this->api_url );
$scheme = ! empty( $test_url_parts['scheme'] ) ? $test_url_parts['scheme'] : 'http';
$host = ! empty( $test_url_parts['host'] ) ? $test_url_parts['host'] : '';
$port = ! empty( $test_url_parts['port'] ) ? ':' . $test_url_parts['port'] : '';
if ( empty( $host ) ) {
$edd_plugin_url_available[ $store_hash ] = false;
} else {
$test_url = $scheme . '://' . $host . $port;
$response = wp_remote_get(
$test_url,
array(
'timeout' => $this->health_check_timeout,
'sslverify' => $this->verify_ssl(),
)
);
$edd_plugin_url_available[ $store_hash ] = is_wp_error( $response ) ? false : true;
}
}
if ( false === $edd_plugin_url_available[ $store_hash ] ) {
return false;
}
$data = array_merge( $this->api_data, $_data );
if ( $data['slug'] !== $this->slug ) {
@ -439,9 +448,56 @@ class GeneratePress_Premium_Plugin_Updater {
return false;
}
if ( $this->request_recently_failed() ) {
return false;
}
return $this->get_version_from_remote();
}
/**
* Determines if a request has recently failed.
*
* @since 1.9.1
*
* @return bool
*/
private function request_recently_failed() {
$failed_request_details = get_option( $this->failed_request_cache_key );
// Request has never failed.
if ( empty( $failed_request_details ) || ! is_numeric( $failed_request_details ) ) {
return false;
}
/*
* Request previously failed, but the timeout has expired.
* This means we're allowed to try again.
*/
if ( time() > $failed_request_details ) {
delete_option( $this->failed_request_cache_key );
return false;
}
return true;
}
/**
* Logs a failed HTTP request for this API URL.
* We set a timestamp for 1 hour from now. This prevents future API requests from being
* made to this domain for 1 hour. Once the timestamp is in the past, API requests
* will be allowed again. This way if the site is down for some reason we don't bombard
* it with failed API requests.
*
* @see EDD_SL_Plugin_Updater::request_recently_failed
*
* @since 1.9.1
*/
private function log_failed_request() {
update_option( $this->failed_request_cache_key, strtotime( '+1 hour' ) );
}
/**
* If available, show the changelog for sites in a multisite install.
*/
@ -512,7 +568,9 @@ class GeneratePress_Premium_Plugin_Updater {
)
);
if ( is_wp_error( $request ) ) {
if ( is_wp_error( $request ) || ( 200 !== wp_remote_retrieve_response_code( $request ) ) ) {
$this->log_failed_request();
return false;
}

View File

@ -9,26 +9,25 @@
/* Off-canvas element CSS */
.main-navigation.offside {
position: fixed; /* Does not play well with some old browsers (see: README) */
width: 265px;
width: var(--gp-slideout-width);
height: 100%;
height: 100vh;
top: 0;
z-index: 9999;
overflow: auto;
-webkit-overflow-scrolling: touch; /* enables momentum scrolling in iOS overflow elements */
visibility: hidden;
}
/* Left off-canvas elements default status: out of the page */
.offside,
.offside--left {
left: -265px;
left: calc(var(--gp-slideout-width) * -1);
}
/* Right off-canvas elements default status: out of the page */
.offside--right {
left: auto;
right: -265px;
right: calc(var(--gp-slideout-width) * -1);
}
/*
@ -36,9 +35,9 @@
* - off-canvas element slides in
* - container elements slides out
*/
.offside--left.is-open,
.offside--left.is-open:not(.slideout-transition),
.offside-js--is-left .offside-sliding-element {
transform: translate3d(265px, 0, 0);
transform: translate3d(var(--gp-slideout-width), 0, 0);
}
/*
@ -46,9 +45,9 @@
* - off-canvas element slides in
* - container elements slides out
*/
.offside--right.is-open,
.offside--right.is-open:not(.slideout-transition),
.offside-js--is-right .offside-sliding-element {
transform: translate3d(-265px, 0, 0);
transform: translate3d(calc(var(--gp-slideout-width) * -1), 0, 0);
}
/* Elements Transitions */
@ -90,14 +89,26 @@
/* Element is open: container elements slide out */
.no-csstransforms3d > .offside-js--is-left .offside-sliding-element {
right: -265px;
right: calc(var(--gp-slideout-width) * -1);
}
.no-csstransforms3d > .offside-js--is-right .offside-sliding-element {
left: -265px;
left: calc(var(--gp-slideout-width) * -1);
}
/* GP */
.slideout-navigation.main-navigation:not(.is-open):not(.slideout-transition) {
display: none;
}
.slideout-navigation.main-navigation:not(.slideout-transition).do-overlay {
opacity: 1;
}
.slideout-navigation.main-navigation.slideout-transition.do-overlay {
opacity: 0;
}
.slideout-overlay {
z-index: 100000;
position: fixed;
@ -110,7 +121,7 @@
bottom: 0;
left: 0;
background-color: rgba(0,0,0,0.8);
visibility: hidden;
visibility: hidden;
opacity: 0;
cursor: pointer;
transition: visibility .2s ease, opacity .2s ease;
@ -154,11 +165,11 @@ button.slideout-exit:hover {
}
.offside-js--is-left.slide-opened .slideout-overlay button.slideout-exit {
left: 260px;
left: calc(var(--gp-slideout-width) - 5px);
}
.offside-js--is-right.slide-opened .slideout-overlay button.slideout-exit {
right: 260px;
right: calc(var(--gp-slideout-width) - 5px);
}
.slideout-widget {
@ -269,21 +280,12 @@ button.slideout-exit:hover {
/* Overlay */
.slideout-navigation.do-overlay {
transform: none;
transform: none !important;
transition: opacity 0.2s, visibility 0.2s;
width: 100%;
visibility: hidden;
opacity: 0;
text-align: center;
left: 0;
right: 0;
pointer-events: none;
}
.slideout-navigation.do-overlay.is-open {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
.slideout-navigation.do-overlay .inside-navigation {

File diff suppressed because one or more lines are too long

View File

@ -103,6 +103,10 @@ if ( ! function_exists( 'generate_menu_plus_customize_register' ) ) {
* @param object $wp_customize The Customizer object.
*/
function generate_menu_plus_customize_register( $wp_customize ) {
if ( version_compare( PHP_VERSION, '5.6', '<' ) ) {
return;
}
$defaults = generate_menu_plus_get_defaults();
$settings = wp_parse_args(
@ -302,7 +306,13 @@ if ( ! function_exists( 'generate_menu_plus_customize_register' ) ) {
array(
'default' => $defaults['sticky_navigation_logo'],
'type' => 'option',
'sanitize_callback' => 'esc_url_raw',
'sanitize_callback' => function( $input ) {
if ( is_numeric( $input ) ) {
return absint( $input );
}
return esc_url_raw( $input );
},
)
);
@ -315,7 +325,54 @@ if ( ! function_exists( 'generate_menu_plus_customize_register' ) ) {
'section' => 'menu_plus_sticky_menu',
'settings' => 'generate_menu_plus_settings[sticky_navigation_logo]',
'priority' => 125,
'active_callback' => 'generate_sticky_navigation_activated',
'active_callback' => function() {
if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
return false;
}
$settings = wp_parse_args(
get_option( 'generate_menu_plus_settings', array() ),
generate_menu_plus_get_defaults()
);
return (
'' !== $settings['sticky_navigation_logo'] &&
! is_numeric( $settings['sticky_navigation_logo'] ) &&
'false' !== $settings['sticky_menu']
);
},
)
)
);
$wp_customize->add_control(
new WP_Customize_Media_Control(
$wp_customize,
'sticky_navigation_logo',
array(
'mime_type' => 'image',
'label' => esc_html__( 'Sticky Navigation Logo', 'gp-premium' ),
'section' => 'menu_plus_sticky_menu',
'settings' => 'generate_menu_plus_settings[sticky_navigation_logo]',
'priority' => 125,
'active_callback' => function() {
if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
return false;
}
$settings = wp_parse_args(
get_option( 'generate_menu_plus_settings', array() ),
generate_menu_plus_get_defaults()
);
return (
'false' !== $settings['sticky_menu'] &&
(
'' === $settings['sticky_navigation_logo'] ||
is_numeric( $settings['sticky_navigation_logo'] )
)
);
},
)
)
);
@ -483,7 +540,13 @@ if ( ! function_exists( 'generate_menu_plus_customize_register' ) ) {
array(
'default' => $defaults['mobile_header_logo'],
'type' => 'option',
'sanitize_callback' => 'esc_url_raw',
'sanitize_callback' => function( $input ) {
if ( is_numeric( $input ) ) {
return absint( $input );
}
return esc_url_raw( $input );
},
)
);
@ -495,7 +558,55 @@ if ( ! function_exists( 'generate_menu_plus_customize_register' ) ) {
'label' => esc_html__( 'Logo', 'gp-premium' ),
'section' => $header_section,
'settings' => 'generate_menu_plus_settings[mobile_header_logo]',
'active_callback' => 'generate_mobile_header_logo_active_callback',
'active_callback' => function() {
if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
return false;
}
$settings = wp_parse_args(
get_option( 'generate_menu_plus_settings', array() ),
generate_menu_plus_get_defaults()
);
return (
'' !== $settings['mobile_header_logo'] &&
! is_numeric( $settings['mobile_header_logo'] ) &&
'enable' === $settings['mobile_header'] &&
'logo' === $settings['mobile_header_branding']
);
},
)
)
);
$wp_customize->add_control(
new WP_Customize_Media_Control(
$wp_customize,
'mobile_header_logo',
array(
'mime_type' => 'image',
'label' => esc_html__( 'Logo', 'gp-premium' ),
'section' => $header_section,
'settings' => 'generate_menu_plus_settings[mobile_header_logo]',
'active_callback' => function() {
if ( ! function_exists( 'generate_menu_plus_get_defaults' ) ) {
return false;
}
$settings = wp_parse_args(
get_option( 'generate_menu_plus_settings', array() ),
generate_menu_plus_get_defaults()
);
return (
'enable' === $settings['mobile_header'] &&
'logo' === $settings['mobile_header_branding'] &&
(
'' === $settings['mobile_header_logo'] ||
is_numeric( $settings['mobile_header_logo'] )
)
);
},
)
)
);
@ -1145,7 +1256,7 @@ if ( ! function_exists( 'generate_slideout_navigation' ) ) {
}
?>
<nav id="generate-slideout-menu" class="main-navigation slideout-navigation<?php echo esc_attr( $overlay ); ?>" <?php echo $microdata; // phpcs:ignore -- No escaping needed. ?> style="display: none;" aria-hidden="true">
<nav id="generate-slideout-menu" class="main-navigation slideout-navigation<?php echo esc_attr( $overlay ); ?>" <?php echo $microdata; // phpcs:ignore -- No escaping needed. ?>>
<div class="inside-navigation grid-container grid-parent">
<?php
do_action( 'generate_inside_slideout_navigation' );
@ -1338,7 +1449,7 @@ if ( ! function_exists( 'generate_menu_plus_slidebar_icon' ) ) {
$icon = apply_filters(
'generate_off_canvas_toggle_output',
sprintf(
'<li class="slideout-toggle menu-item-align-right %2$s"><a href="#">%1$s%3$s</a></li>',
'<li class="slideout-toggle menu-item-align-right %2$s"><a href="#" role="button">%1$s%3$s</a></li>',
$svg_icon,
$svg_icon ? 'has-svg-icon' : '',
'' !== $settings['off_canvas_desktop_toggle_label'] ? '<span class="off-canvas-toggle-label">' . wp_kses_post( $settings['off_canvas_desktop_toggle_label'] ) . '</span>' : ''
@ -1398,10 +1509,15 @@ function generate_do_off_canvas_toggle_button() {
$icon = apply_filters(
'generate_off_canvas_toggle_output',
sprintf(
'<span class="menu-bar-item slideout-toggle hide-on-mobile %2$s"><a href="#">%1$s%3$s</a></span>',
'<span class="menu-bar-item slideout-toggle hide-on-mobile %2$s"><a href="#" role="button"%4$s>%1$s%3$s</a></span>',
$svg_icon,
$svg_icon ? 'has-svg-icon' : '',
'' !== $settings['off_canvas_desktop_toggle_label'] ? '<span class="off-canvas-toggle-label">' . wp_kses_post( $settings['off_canvas_desktop_toggle_label'] ) . '</span>' : ''
'' !== $settings['off_canvas_desktop_toggle_label'] ? '<span class="off-canvas-toggle-label">' . wp_kses_post( $settings['off_canvas_desktop_toggle_label'] ) . '</span>' : '',
'' === $settings['off_canvas_desktop_toggle_label']
? sprintf(
' aria-label="%s"',
apply_filters( 'generate_off_canvas_button_aria_label', __( 'Open Off-Canvas Panel', 'gp-premium' ) )
) : ''
)
);
@ -1509,7 +1625,14 @@ if ( ! function_exists( 'generate_menu_plus_mobile_header_logo' ) ) {
);
if ( 'logo' === $settings['mobile_header_branding'] && '' !== $settings['mobile_header_logo'] ) {
$image = attachment_url_to_postid( $settings['mobile_header_logo'] );
if ( is_numeric( $settings['mobile_header_logo'] ) ) {
$image = $settings['mobile_header_logo'];
$image_url = wp_get_attachment_image_url( $image, 'full' );
} else {
$image_url = $settings['mobile_header_logo'];
$image = attachment_url_to_postid( $image_url );
}
$image_width = '';
$image_height = '';
@ -1536,12 +1659,12 @@ if ( ! function_exists( 'generate_menu_plus_mobile_header_logo' ) ) {
</div>',
esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
esc_url( apply_filters( 'generate_mobile_header_logo', $settings['mobile_header_logo'] ) ),
esc_url( apply_filters( 'generate_mobile_header_logo', $image_url ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
! empty( $image_width ) ? absint( $image_width ) : '',
! empty( $image_height ) ? absint( $image_height ) : ''
),
$settings['mobile_header_logo'],
$image_url,
$image
);
}
@ -1599,6 +1722,9 @@ function generate_do_off_canvas_css() {
require_once GP_LIBRARY_DIRECTORY . 'class-make-css.php';
$css = new GeneratePress_Pro_CSS();
$css->set_selector( ':root' );
$css->add_property( '--gp-slideout-width', apply_filters( 'generate_slideout_width', '265px' ) );
$css->set_selector( '.slideout-navigation.main-navigation' );
$css->add_property( 'background-color', esc_attr( $settings['slideout_background_color'] ) );
@ -2103,7 +2229,14 @@ function generate_do_navigation_branding() {
}
if ( 'false' !== $settings['sticky_menu'] && '' !== $settings['sticky_navigation_logo'] ) {
$image = attachment_url_to_postid( $settings['sticky_navigation_logo'] );
if ( is_numeric( $settings['sticky_navigation_logo'] ) ) {
$image = $settings['sticky_navigation_logo'];
$image_url = wp_get_attachment_image_url( $image, 'full' );
} else {
$image_url = $settings['sticky_navigation_logo'];
$image = attachment_url_to_postid( $image_url );
}
$image_width = '';
$image_height = '';
@ -2129,11 +2262,11 @@ function generate_do_navigation_branding() {
</div>',
esc_url( apply_filters( 'generate_logo_href', home_url( '/' ) ) ),
esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
esc_url( $settings['sticky_navigation_logo'] ),
esc_url( $image_url ),
! empty( $image_width ) ? absint( $image_width ) : '',
! empty( $image_height ) ? absint( $image_height ) : ''
),
$settings['sticky_navigation_logo'],
$image_url,
$image
);
}

View File

@ -497,19 +497,18 @@
/**
* Start GP.
*/
document.addEventListener( 'DOMContentLoaded', function() {
document.querySelector( '.slideout-navigation' ).style.display = '';
} );
var generateOffside = offside( '.slideout-navigation', {
slidingElementsSelector:'#slideout-container',
buttonsSelector: '.slideout-mobile .main-navigation .menu-toggle, .slideout-both .main-navigation .menu-toggle, .slideout-both .slideout-toggle, .slideout-desktop .slideout-toggle',
slidingSide: offSide.side,
beforeOpen: function() {
// Turn on visibility so we can transition nicely.
document.querySelector( '.slideout-navigation' ).style.visibility = 'visible';
document.querySelector( '.slideout-navigation' ).classList.add( 'slideout-transition' );
},
afterOpen: function() {
setTimeout( function() {
document.querySelector( '.slideout-navigation' ).classList.remove( 'slideout-transition' );
}, 10 );
document.documentElement.classList.add( 'slide-opened' );
document.body.classList.add( 'slide-opened' );
@ -526,8 +525,6 @@ var generateOffside = offside( '.slideout-navigation', {
}
}
document.querySelector( '.slideout-navigation' ).removeAttribute( 'aria-hidden' );
// Focus the first focusable element.
var focusable = document.querySelector( '.slideout-navigation' ).querySelectorAll( 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])' );
@ -537,7 +534,14 @@ var generateOffside = offside( '.slideout-navigation', {
}, 200 );
}
},
beforeClose: function() {
document.querySelector( '.slideout-navigation' ).classList.add( 'slideout-transition' );
},
afterClose: function() {
setTimeout( function() {
document.querySelector( '.slideout-navigation' ).classList.remove( 'slideout-transition' );
}, 500 );
var body = document.body,
nav = document.querySelectorAll( '.main-navigation' );
@ -566,12 +570,6 @@ var generateOffside = offside( '.slideout-navigation', {
}
}
}
// Turn off visibility.
setTimeout( function() {
document.querySelector( '.slideout-navigation:not(.is-open)' ).style.visibility = '';
document.querySelector( '.slideout-navigation:not(.is-open)' ).setAttribute( 'aria-hidden', 'true' );
}, 500 );
}
} );
@ -636,3 +634,13 @@ document.addEventListener( 'keyup', function( e ) {
}
}
} );
var toggles = document.querySelectorAll( '.slideout-toggle a' );
for ( var i = 0; i < toggles.length; i++ ) {
toggles[ i ].addEventListener( 'keypress', function( e ) {
if ( ' ' === e.key ) {
e.preventDefault();
generateOffside.open();
}
} );
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3,9 +3,9 @@ Contributors: edge22
Donate link: https://generatepress.com
Tags: generatepress
Requires at least: 5.2
Tested up to: 6.1
Tested up to: 6.2
Requires PHP: 5.6
Stable tag: 2.2.2
Stable tag: 2.3.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@ -27,6 +27,28 @@ In most cases, #1 will work fine and is way easier.
== Changelog ==
= 2.3.0 =
* Feature: Add Search Modal Element type
* Fix: Inline post meta feature in GenerateBlocks 1.7
* Fix: Close "Choose Element Type" modal with ESC key
* Fix: Replace WooCommerce secondary image attachment size
* Fix: WP Filesystem error missing credentials
* Fix: Undefined array keys in dynamic Container URL
* Fix: Author avatar in Header/Block Element titles
* Fix: Infinite loop error when autosaving with dynamic content block
* Fix: Add aria-label to off-canvas panel button
* Fix: WooCommerce button dynamic typography
* Fix: Empty WooCommerce quantity fields
* Fix: PHP 8.1 notice using disable elements in Customizer
* Tweak: Improve license key area
* Tweak: Improve off-canvas transitions
* Tweak: Check for WooCommerce functions
* Tweak: Open off-canvas using space bar
* Tweak: Use image ID in mobile header/sticky nav logos
* Tweak: Improve Elements hook selection dropdown UI
* Tweak: Add site library check for min GenerateBlocks version
* Tweak: Add Loop Template to Custom Post Type dropdown filters
= 2.2.2 =
* Fix: Off Canvas anchor links not working

View File

@ -216,6 +216,7 @@ class GeneratePress_Site_Library_Rest extends WP_REST_Controller {
'category' => $site['category'],
'min_version' => $site['min_version'],
'min_theme_version' => $site['min_theme_version'],
'min_generateblocks_version' => $site['min_generateblocks_version'],
'uploads_url' => $site['uploads_url'],
'plugins' => $site['plugins'],
'documentation' => $site['documentation'],

View File

@ -114,6 +114,7 @@ class GeneratePress_Site_Library {
'hasBackup' => ! empty( get_option( '_generatepress_site_library_backup', array() ) ),
'gppVersion' => GP_PREMIUM_VERSION,
'gpVersion' => generate_premium_get_theme_version(),
'generateblocksVersion' => defined( 'GENERATEBLOCKS_VERSION' ) ? GENERATEBLOCKS_VERSION : '',
'elementorReplaceUrls' => esc_url( admin_url( 'admin.php?page=elementor-tools#tab-replace_url' ) ),
'uploadsUrl' => $uploads_url['baseurl'],
'isDebugEnabled' => defined( 'WP_DEBUG' ) && true === WP_DEBUG,

View File

@ -523,7 +523,7 @@ ul.products .woocommerce-text-align-right {
margin-top: 40px;
}
.woocommerce div.product form.cart,
.woocommerce div.product.do-quantity-buttons form.cart,
.add-to-cart-panel form.cart {
display: flex;
flex-wrap: wrap;

File diff suppressed because one or more lines are too long

View File

@ -158,6 +158,26 @@ function generatepress_wc_post_class( $classes ) {
if ( 'product' === get_post_type() || is_cart() ) {
if ( generatepress_wc_get_setting( 'quantity_buttons' ) ) {
$classes[] = 'do-quantity-buttons';
$product = wc_get_product( get_the_ID() );
$check_stock = is_callable( array( $product, 'managing_stock' ) ) &&
is_callable( array( $product, 'get_stock_quantity' ) ) &&
is_callable( array( $product, 'backorders_allowed' ) ) &&
is_callable( array( $product, 'is_sold_individually' ) ) &&
function_exists( 'is_product' ) &&
is_product() &&
defined( 'WC_VERSION' );
if ( $check_stock && version_compare( WC_VERSION, '7.4.0', '>=' ) ) {
$managing_stock = $product->managing_stock();
$stock_quantity = $product->get_stock_quantity();
$backorders_allowed = $product->backorders_allowed();
$sold_individually = $product->is_sold_individually();
if ( $sold_individually || ( $managing_stock && $stock_quantity < 2 && ! $backorders_allowed ) ) {
$classes = array_diff( $classes, array( 'do-quantity-buttons' ) );
}
}
}
}
@ -199,6 +219,10 @@ add_action( 'wp_enqueue_scripts', 'generatepress_wc_scripts', 100 );
* @since 1.3
*/
function generatepress_wc_scripts() {
if ( ! function_exists( 'is_checkout' ) ) {
return;
}
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_style( 'generate-woocommerce', plugin_dir_url( __FILE__ ) . "css/woocommerce{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION );
wp_enqueue_style( 'generate-woocommerce-mobile', plugin_dir_url( __FILE__ ) . "css/woocommerce-mobile{$suffix}.css", array(), GENERATE_WOOCOMMERCE_VERSION, generate_premium_get_media_query( 'mobile' ) );
@ -443,10 +467,14 @@ function generatepress_wc_setup() {
*
* @since 1.3
*
* @param string $sidebar Existing sidebar layout.
* @param string $layout Existing sidebar layout.
* @return string New sidebar layout.
*/
function generatepress_wc_checkout_sidebar_layout( $layout ) {
if ( ! function_exists( 'is_checkout' ) ) {
return $layout;
}
if ( is_checkout() ) {
return 'no-sidebar';
}
@ -463,6 +491,10 @@ function generatepress_wc_checkout_sidebar_layout( $layout ) {
* @return int New number of widgets.
*/
function generatepress_wc_checkout_footer_widgets( $widgets ) {
if ( ! function_exists( 'is_checkout' ) ) {
return $widgets;
}
if ( is_checkout() ) {
return '0';
}
@ -810,27 +842,29 @@ function generatepress_wc_css() {
foreach ( (array) $typography as $key => $data ) {
if ( 'buttons' === $data['selector'] ) {
$unit = isset( $data['fontSizeUnit'] ) ? $data['fontSizeUnit'] : 'px';
if ( ! empty( $data['fontSize'] ) ) {
$css->add_property( 'font-size', absint( $data['fontSize'] ), false, 'px' );
$css->add_property( 'font-size', floatval( $data['fontSize'] ), false, $unit );
}
if ( ! empty( $data['fontWeight'] ) ) {
$css->add_property( 'font-weight', absint( $data['fontWeight'] ) );
$css->add_property( 'font-weight', esc_attr( $data['fontWeight'] ) );
}
if ( ! empty( $data['textTransform'] ) ) {
$css->add_property( 'text-transform', absint( $data['textTransform'] ) );
$css->add_property( 'text-transform', esc_attr( $data['textTransform'] ) );
}
if ( ! empty( $data['fontSizeTablet'] ) ) {
$css->start_media_query( generate_premium_get_media_query( 'tablet' ) );
$css->add_property( 'font-size', absint( $data['fontSizeTablet'] ), false, 'px' );
$css->add_property( 'font-size', floatval( $data['fontSizeTablet'] ), false, $unit );
$css->stop_media_query();
}
if ( ! empty( $data['fontSizeMobile'] ) ) {
$css->start_media_query( generate_premium_get_media_query( 'mobile' ) );
$css->add_property( 'font-size', absint( $data['fontSizeMobile'] ), false, 'px' );
$css->add_property( 'font-size', floatval( $data['fontSizeMobile'] ), false, $unit );
$css->stop_media_query();
}
}
@ -1209,7 +1243,7 @@ function generatepress_wc_secondary_product_image() {
if ( $attachment_ids && generatepress_wc_get_setting( 'product_secondary_image' ) && generatepress_wc_get_setting( 'product_archive_image' ) && has_post_thumbnail() ) {
$secondary_image_id = $attachment_ids['0'];
echo wp_get_attachment_image( $secondary_image_id, 'shop_catalog', '', $attr = array( 'class' => 'secondary-image attachment-shop-catalog' ) );
echo wp_get_attachment_image( $secondary_image_id, 'woocommerce_thumbnail', '', $attr = array( 'class' => 'secondary-image attachment-shop-catalog' ) );
}
}
}
@ -1416,6 +1450,10 @@ function generatepress_add_to_cart_panel_fragments( $fragments ) {
* @since 1.8
*/
function generatepress_wc_show_sticky_add_to_cart() {
if ( ! function_exists( 'wc_get_product' ) ) {
return false;
}
$product = wc_get_product( get_the_ID() );
$show = false;

View File

@ -1 +1 @@
jQuery(function(m){function t(t,a){var e;return function(){clearTimeout(e),e=setTimeout(function(){e=void 0,t.call()},a)}}var u,f;function a(){try{return generateWooCommerce.hooks.generateQuantityButtons()}catch(t){}var a,e;if(m(".woocommerce div.product form.cart").first().closest(".elementor-add-to-cart").length)m(".elementor.product").removeClass("do-quantity-buttons");else{try{a=generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes}catch(t){a=m(".cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)").find(".qty")}try{if(0===a.length)return}catch(t){return}try{e=generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes}catch(t){e=function(t,a){var e,s=m(a);-1===["date","hidden"].indexOf(s.prop("type"))&&(s.parent().addClass("buttons-added").prepend('<a href="javascript:void(0)" class="minus">-</a>'),s.after('<a href="javascript:void(0)" class="plus">+</a>'),(e=parseFloat(m(this).attr("min")))&&0<e&&parseFloat(m(this).val())<e&&m(this).val(e),s.parent().find(".plus, .minus").on("click",function(){var t=parseFloat(s.val()),a=parseFloat(s.attr("max")),e=parseFloat(s.attr("min")),o=s.attr("step");t&&""!==t&&"NaN"!==t||(t=0),""!==a&&"NaN"!==a||(a=""),""!==e&&"NaN"!==e||(e=0),"any"!==o&&""!==o&&void 0!==o&&"NaN"!==parseFloat(o)||(o=1),m(this).is(".plus")?a&&(a===t||a<t)?s.val(a):s.val(t+parseFloat(o)):e&&(e===t||t<e)?s.val(e):0<t&&s.val(t-parseFloat(o)),s.trigger("change")}))}}m.each(a,e)}}m("body").on("added_to_cart",function(){m(".wc-menu-item").hasClass("has-items")||m(".wc-menu-item").addClass("has-items"),m(".wc-mobile-cart-items").hasClass("has-items")||m(".wc-mobile-cart-items").addClass("has-items")}),m("body").on("removed_from_cart",function(){var t=m(".number-of-items");t.length&&t.hasClass("no-items")&&(m(".wc-menu-item").removeClass("has-items"),m(".wc-mobile-cart-items").removeClass("has-items"))}),generateWooCommerce.addToCartPanel&&(m(document.body).on("added_to_cart",function(){var t=m("#wpadminbar"),a=m(".navigation-stick"),e=0;t.length&&(e=t.outerHeight()),a.length&&"0px"===a.css("top")&&(e+=a.outerHeight()),m(".add-to-cart-panel").addClass("item-added").css({"-webkit-transform":"translateY("+e+"px)","-ms-transform":"translateY("+e+"px)",transform:"translateY("+e+"px)"})}),m(".add-to-cart-panel .continue-shopping").on("click",function(t){t.preventDefault(),m(".add-to-cart-panel").removeClass("item-added").css({"-webkit-transform":"translateY(-100%)","-ms-transform":"translateY(-100%)",transform:"translateY(-100%)"})}),m(window).on("scroll",t(function(){var t=m(".add-to-cart-panel");t.hasClass("item-added")&&t.removeClass("item-added").css({"-webkit-transform":"translateY(-100%)","-ms-transform":"translateY(-100%)",transform:"translateY(-100%)"})},250))),generateWooCommerce.stickyAddToCart&&(u=0,f=300,m(window).on("scroll",t(function(){var t=m("#wpadminbar"),a=m(".navigation-stick"),e=m(".stuckElement"),o=0,s=m(window).scrollTop(),r=m(".add-to-cart-panel"),n=r.offset().top+r.outerHeight(),i=m(".single_add_to_cart_button"),c=i.offset().top,l=i.outerHeight(),d=m(".site-footer").offset().top;0===e.length&&(f=0),c+l<s&&n<d?setTimeout(function(){t.length&&(o=t.outerHeight()),a.length&&(a.hasClass("auto-hide-sticky")?(s<u&&"0px"===a.css("top")&&(o+=a.outerHeight()),u=s):o+=a.outerHeight()),r.addClass("show-sticky-add-to-cart").css({"-webkit-transform":"translateY("+o+"px)","-ms-transform":"translateY("+o+"px)",transform:"translateY("+o+"px)"})},f):r.removeClass("show-sticky-add-to-cart").css({"-webkit-transform":"","-ms-transform":"",transform:""})},50)),m(".go-to-variables").on("click",function(t){t.preventDefault();var a=0,e=m(".navigation-stick"),o=m("#wpadminbar");e.length&&(a=e.outerHeight()),o.length&&(a+=o.outerHeight()),m("html, body").animate({scrollTop:m(".variations").offset().top-a},250)})),m(function(){"use strict";generateWooCommerce.quantityButtons&&a()}),m(document).ajaxComplete(function(){"use strict";generateWooCommerce.quantityButtons&&a()})});
jQuery(function(d){function t(t,a){var e;return function(){clearTimeout(e),e=setTimeout(function(){e=void 0,t.call()},a)}}var m,u;function a(){try{return generateWooCommerce.hooks.generateQuantityButtons()}catch(t){}var a,e;if(d(".woocommerce div.product form.cart").first().closest(".elementor-add-to-cart").length)d(".elementor.product").removeClass("do-quantity-buttons");else{try{a=generateWooCommerce.selectors.generateQuantityButtons.quantityBoxes}catch(t){a=d(".cart div.quantity:not(.buttons-added), .cart td.quantity:not(.buttons-added)").find(".qty")}try{if(0===a.length)return}catch(t){return}try{e=generateWooCommerce.callbacks.generateQuantityButtons.quantityBoxes}catch(t){e=function(t,a){var s=d(a);-1===["date","hidden"].indexOf(s.prop("type"))&&(s.parent().addClass("buttons-added").prepend('<a href="javascript:void(0)" class="minus">-</a>'),s.after('<a href="javascript:void(0)" class="plus">+</a>'),(a=parseFloat(d(this).attr("min")))&&0<a&&parseFloat(d(this).val())<a&&d(this).val(a),s.parent().find(".plus, .minus").on("click",function(){var t=parseFloat(s.val()),a=parseFloat(s.attr("max")),e=parseFloat(s.attr("min")),o=s.attr("step");t&&""!==t&&"NaN"!==t||(t=0),""!==a&&"NaN"!==a||(a=""),""!==e&&"NaN"!==e||(e=0),"any"!==o&&""!==o&&void 0!==o&&"NaN"!==parseFloat(o)||(o=1),d(this).is(".plus")?a&&(a===t||a<t)?s.val(a):s.val(t+parseFloat(o)):e&&(e===t||t<e)?s.val(e):0<t&&s.val(t-parseFloat(o)),s.trigger("change")}))}}d.each(a,e)}}d("body").on("added_to_cart",function(){d(".wc-menu-item").hasClass("has-items")||d(".wc-menu-item").addClass("has-items"),d(".wc-mobile-cart-items").hasClass("has-items")||d(".wc-mobile-cart-items").addClass("has-items")}),d("body").on("removed_from_cart",function(){var t=d(".number-of-items");t.length&&t.hasClass("no-items")&&(d(".wc-menu-item").removeClass("has-items"),d(".wc-mobile-cart-items").removeClass("has-items"))}),generateWooCommerce.addToCartPanel&&(d(document.body).on("added_to_cart",function(){var t=d("#wpadminbar"),a=d(".navigation-stick"),e=0;t.length&&(e=t.outerHeight()),a.length&&"0px"===a.css("top")&&(e+=a.outerHeight()),d(".add-to-cart-panel").addClass("item-added").css({"-webkit-transform":"translateY("+e+"px)","-ms-transform":"translateY("+e+"px)",transform:"translateY("+e+"px)"})}),d(".add-to-cart-panel .continue-shopping").on("click",function(t){t.preventDefault(),d(".add-to-cart-panel").removeClass("item-added").css({"-webkit-transform":"translateY(-100%)","-ms-transform":"translateY(-100%)",transform:"translateY(-100%)"})}),d(window).on("scroll",t(function(){var t=d(".add-to-cart-panel");t.hasClass("item-added")&&t.removeClass("item-added").css({"-webkit-transform":"translateY(-100%)","-ms-transform":"translateY(-100%)",transform:"translateY(-100%)"})},250))),generateWooCommerce.stickyAddToCart&&(m=0,u=300,d(window).on("scroll",t(function(){var t=d("#wpadminbar"),a=d(".navigation-stick"),e=d(".stuckElement"),o=0,s=d(window).scrollTop(),r=d(".add-to-cart-panel"),n=r.offset().top+r.outerHeight(),i=d(".single_add_to_cart_button"),c=i.offset().top,i=i.outerHeight(),l=d(".site-footer").offset().top;0===e.length&&(u=0),c+i<s&&n<l?setTimeout(function(){t.length&&(o=t.outerHeight()),a.length&&(a.hasClass("auto-hide-sticky")?(s<m&&"0px"===a.css("top")&&(o+=a.outerHeight()),m=s):o+=a.outerHeight()),r.addClass("show-sticky-add-to-cart").css({"-webkit-transform":"translateY("+o+"px)","-ms-transform":"translateY("+o+"px)",transform:"translateY("+o+"px)"})},u):r.removeClass("show-sticky-add-to-cart").css({"-webkit-transform":"","-ms-transform":"",transform:""})},50)),d(".go-to-variables").on("click",function(t){t.preventDefault();var t=0,a=d(".navigation-stick"),e=d("#wpadminbar");a.length&&(t=a.outerHeight()),e.length&&(t+=e.outerHeight()),d("html, body").animate({scrollTop:d(".variations").offset().top-t},250)})),d(function(){"use strict";generateWooCommerce.quantityButtons&&a()}),d(document).ajaxComplete(function(){"use strict";generateWooCommerce.quantityButtons&&a()})});