plugin updates
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,62 +1,62 @@
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item:focus,
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item:active {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-questions-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-questions-button .wpsp-faq-icon-wrap {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-questions-button .wpsp-question {
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-icon svg,
|
||||
.wp-block-wpsp-faq-child .wpsp-icon-active svg {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-content span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-content p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon-active,
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon {
|
||||
display: none;
|
||||
width: 0;
|
||||
padding: 0;
|
||||
height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon,
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon,
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item span.wpsp-icon-active.wpsp-faq-icon-wrap,
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
|
||||
display: none;
|
||||
}
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item:focus,
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item:active {
|
||||
outline: thin dotted;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-questions-button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-questions-button .wpsp-faq-icon-wrap {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-questions-button .wpsp-question {
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-icon svg,
|
||||
.wp-block-wpsp-faq-child .wpsp-icon-active svg {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-content span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child .wpsp-faq-content p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon-active,
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon {
|
||||
display: none;
|
||||
width: 0;
|
||||
padding: 0;
|
||||
height: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon,
|
||||
.wp-block-wpsp-faq-child.wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
|
||||
display: inline-block;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item .wpsp-icon,
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item span.wpsp-icon-active.wpsp-faq-icon-wrap,
|
||||
.wpsp-faq-layout-grid .wpsp-faq-child__outer-wrap .wpsp-faq-item.wpsp-faq-item-active .wpsp-icon-active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.wp-block-wpsp-faq.wpsp-faq-layout-accordion .wpsp-faq-child__outer-wrap .wpsp-faq-questions-button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-child__outer-wrap,
|
||||
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-child__wrapper,
|
||||
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-item {
|
||||
height: 100%;
|
||||
}
|
||||
.wp-block-wpsp-faq.wpsp-faq-layout-accordion .wpsp-faq-child__outer-wrap .wpsp-faq-questions-button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-child__outer-wrap,
|
||||
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-child__wrapper,
|
||||
.wpsp-faq-layout-grid.wpsp-faq-equal-height .wpsp-faq__wrap .wpsp-faq-item {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
@@ -1,454 +1,454 @@
|
||||
.wpsp-editor-bg-image-control .components-button {
|
||||
vertical-align: middle;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.wpsp-editor-bg-image-control .components-button:last-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon-wrap,
|
||||
.wpsp-ifb-icon-wrap * {
|
||||
-webkit-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon-wrap .wpsp-ifb-icon,
|
||||
.wpsp-ifb-content {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon svg {
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
vertical-align: middle;
|
||||
fill: #333;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-above-title .wpsp-ifb-left-right-wrap {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-cta-link span {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.wpsp-ifb-cta.wpsp-howto-child-cta-link-style:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-cta-link,
|
||||
.entry .entry-content a.wpsp-howto-child-cta-link,
|
||||
a.wpsp-howto-child-link-wrap,
|
||||
.entry .entry-content a.wpsp-howto-child-link-wrap {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-cta-link:hover,
|
||||
.entry .entry-content a.wpsp-howto-child-cta-link:hover,
|
||||
a.wpsp-howto-child-link-wrap:hover,
|
||||
.entry .entry-content a.wpsp-howto-child-link-wrap:hover .entry .entry-content a.wpsp-howto-child-cta-link:hover {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title.wpsp-howto-child-image-valign-middle .wpsp-ifb-title-wrap,
|
||||
.wpsp-howto-child-icon-right-title.wpsp-howto-child-image-valign-middle .wpsp-ifb-title-wrap,
|
||||
.wpsp-howto-child-image-valign-middle .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-left.wpsp-howto-child-image-valign-middle .wpsp-ifb-content,
|
||||
.wpsp-howto-child-icon-right.wpsp-howto-child-image-valign-middle .wpsp-ifb-content {
|
||||
-ms-flex-item-align: center;
|
||||
-webkit-align-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-left {
|
||||
text-align: left;
|
||||
-webkit-box-pack: start;
|
||||
-ms-flex-pack: start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-moz-box-pack: start;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-center {
|
||||
text-align: center;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
-webkit-justify-content: center;
|
||||
-moz-box-pack: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-right {
|
||||
text-align: right;
|
||||
-webkit-box-pack: end;
|
||||
-ms-flex-pack: end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-moz-box-pack: end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.wpsp-ifb-left-right-wrap {
|
||||
width: 100%;
|
||||
word-break: break-word;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-above-title .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-below-title .wpsp-ifb-left-right-wrap {
|
||||
display: block;
|
||||
min-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-icon-wrap,
|
||||
.wpsp-howto-child-icon-left .wpsp-ifb-icon-wrap {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right-title .wpsp-ifb-icon-wrap,
|
||||
.wpsp-howto-child-icon-right .wpsp-ifb-icon-wrap {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* stylelint-disable declaration-block-no-duplicate-properties */
|
||||
.wpsp-howto-child-icon-left .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-right .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-left-title-image,
|
||||
.wpsp-howto-child-icon-right-title .wpsp-ifb-right-title-image {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
-js-display: flex;
|
||||
display: -webkit-flex;
|
||||
display: -moz-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-right-title .wpsp-ifb-right-title-image {
|
||||
-webkit-box-pack: end;
|
||||
-ms-flex-pack: end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-moz-box-pack: end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon-wrap .wpsp-ifb-icon span {
|
||||
font-style: initial;
|
||||
height: auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-ifb-image-content {
|
||||
display: inline-block;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-ifb-image-content img {
|
||||
display: inline;
|
||||
height: auto !important;
|
||||
max-width: 100%;
|
||||
width: auto;
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
-webkit-border-radius: inherit;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-image-crop-circle img {
|
||||
-webkit-border-radius: 100%;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-image-crop-square img {
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-module-link {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.wpsp-edit-mode .wpsp-howto-child-module-link {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-link-icon-after {
|
||||
margin-left: 5px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-link-icon-before {
|
||||
margin-left: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-link-icon {
|
||||
-webkit-transition: all 200ms linear;
|
||||
transition: all 200ms linear;
|
||||
}
|
||||
|
||||
.wpsp-howto-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wpsp-ifb-separator {
|
||||
width: 30%;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #333;
|
||||
border-top-style: solid;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wpsp-ifb-separator-parent {
|
||||
line-height: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-cta-button {
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
background-color: #818a91;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpsp-ifb-button-wrapper .wp-block-button__link svg {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.wpsp-ifb-cta a {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wpsp-ifb-title-wrap {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-ifb-title-wrap .wpsp-ifb-title,
|
||||
.wpsp-ifb-title-wrap {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wpsp-how-to__content-wrap.wpsp-howto-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon span {
|
||||
font-size: 40px;
|
||||
height: 40px;
|
||||
color: #333;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-how-to__content-wrap.wpsp-howto-child,
|
||||
.wpsp-ifb-content,
|
||||
.wpsp-ifb-title-wrap,
|
||||
svg.dashicon.dashicons-upload {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-cta-link {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-link-wrap {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.wpsp-ifb-content p:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wpsp-howto-child .wpsp-ifb-icon,
|
||||
.wpsp-howto-child .wpsp-ifb-image-content img {
|
||||
display: inline-block;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.wpsp-ifb-align-icon-after {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-align-icon-before {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
span.wpsp-ifb-button-icon.wpsp-ifb-align-icon-after {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.wpsp-ifb-button-icon {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
font-size: 15px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wpsp-ifb-text-icon {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
font-size: 15px;
|
||||
line-height: 15px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-ifb-button-icon svg,
|
||||
.wpsp-ifb-text-icon svg {
|
||||
height: inherit;
|
||||
width: inherit;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.block-editor-page #wpwrap .wpsp-howto-child-cta-link svg,
|
||||
.wpsp-howto-child-cta-link svg {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.wpsp-howto-child__outer-wrap {
|
||||
position: relative;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
a.wpsp-how-to__link-to-all {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 976px) {
|
||||
|
||||
.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
padding: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-tablet.wpsp-reverse-order-tablet .wpsp-ifb-left-right-wrap {
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
-js-display: inline-flex;
|
||||
display: -webkit-inline-flex;
|
||||
display: -moz-inline-box;
|
||||
display: inline-flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: reverse;
|
||||
-ms-flex-direction: column-reverse;
|
||||
-webkit-flex-direction: column-reverse;
|
||||
-moz-box-orient: vertical;
|
||||
-moz-box-direction: reverse;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-content,
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-left.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right-title.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-right.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-separator-parent {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
|
||||
.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
padding: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-mobile.wpsp-reverse-order-mobile .wpsp-ifb-left-right-wrap {
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
-js-display: inline-flex;
|
||||
display: -webkit-inline-flex;
|
||||
display: -moz-inline-box;
|
||||
display: inline-flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: reverse;
|
||||
-ms-flex-direction: column-reverse;
|
||||
-webkit-flex-direction: column-reverse;
|
||||
-moz-box-orient: vertical;
|
||||
-moz-box-direction: reverse;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-content,
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-left.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right-title.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-right.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-separator-parent {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
.wpsp-editor-bg-image-control .components-button {
|
||||
vertical-align: middle;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.wpsp-editor-bg-image-control .components-button:last-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon-wrap,
|
||||
.wpsp-ifb-icon-wrap * {
|
||||
-webkit-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon-wrap .wpsp-ifb-icon,
|
||||
.wpsp-ifb-content {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon svg {
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
vertical-align: middle;
|
||||
fill: #333;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-above-title .wpsp-ifb-left-right-wrap {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-cta-link span {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
.wpsp-ifb-cta.wpsp-howto-child-cta-link-style:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-cta-link,
|
||||
.entry .entry-content a.wpsp-howto-child-cta-link,
|
||||
a.wpsp-howto-child-link-wrap,
|
||||
.entry .entry-content a.wpsp-howto-child-link-wrap {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-cta-link:hover,
|
||||
.entry .entry-content a.wpsp-howto-child-cta-link:hover,
|
||||
a.wpsp-howto-child-link-wrap:hover,
|
||||
.entry .entry-content a.wpsp-howto-child-link-wrap:hover .entry .entry-content a.wpsp-howto-child-cta-link:hover {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title.wpsp-howto-child-image-valign-middle .wpsp-ifb-title-wrap,
|
||||
.wpsp-howto-child-icon-right-title.wpsp-howto-child-image-valign-middle .wpsp-ifb-title-wrap,
|
||||
.wpsp-howto-child-image-valign-middle .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-left.wpsp-howto-child-image-valign-middle .wpsp-ifb-content,
|
||||
.wpsp-howto-child-icon-right.wpsp-howto-child-image-valign-middle .wpsp-ifb-content {
|
||||
-ms-flex-item-align: center;
|
||||
-webkit-align-self: center;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-left {
|
||||
text-align: left;
|
||||
-webkit-box-pack: start;
|
||||
-ms-flex-pack: start;
|
||||
-webkit-justify-content: flex-start;
|
||||
-moz-box-pack: start;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-center {
|
||||
text-align: center;
|
||||
-webkit-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
-webkit-justify-content: center;
|
||||
-moz-box-pack: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-right {
|
||||
text-align: right;
|
||||
-webkit-box-pack: end;
|
||||
-ms-flex-pack: end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-moz-box-pack: end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.wpsp-ifb-left-right-wrap {
|
||||
width: 100%;
|
||||
word-break: break-word;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-above-title .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-below-title .wpsp-ifb-left-right-wrap {
|
||||
display: block;
|
||||
min-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-icon-wrap,
|
||||
.wpsp-howto-child-icon-left .wpsp-ifb-icon-wrap {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right-title .wpsp-ifb-icon-wrap,
|
||||
.wpsp-howto-child-icon-right .wpsp-ifb-icon-wrap {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
/* stylelint-disable declaration-block-no-duplicate-properties */
|
||||
.wpsp-howto-child-icon-left .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-right .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-left-title-image,
|
||||
.wpsp-howto-child-icon-right-title .wpsp-ifb-right-title-image {
|
||||
display: -webkit-box;
|
||||
display: -ms-flexbox;
|
||||
-js-display: flex;
|
||||
display: -webkit-flex;
|
||||
display: -moz-box;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right .wpsp-ifb-left-right-wrap,
|
||||
.wpsp-howto-child-icon-right-title .wpsp-ifb-right-title-image {
|
||||
-webkit-box-pack: end;
|
||||
-ms-flex-pack: end;
|
||||
-webkit-justify-content: flex-end;
|
||||
-moz-box-pack: end;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon-wrap .wpsp-ifb-icon span {
|
||||
font-style: initial;
|
||||
height: auto;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-ifb-image-content {
|
||||
display: inline-block;
|
||||
line-height: 0;
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-ifb-image-content img {
|
||||
display: inline;
|
||||
height: auto !important;
|
||||
max-width: 100%;
|
||||
width: auto;
|
||||
-webkit-box-sizing: content-box;
|
||||
-moz-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
-webkit-border-radius: inherit;
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-image-crop-circle img {
|
||||
-webkit-border-radius: 100%;
|
||||
border-radius: 100%;
|
||||
}
|
||||
|
||||
.wpsp-ifb-imgicon-wrap .wpsp-image-crop-square img {
|
||||
-webkit-border-radius: 0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-module-link {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
.wpsp-edit-mode .wpsp-howto-child-module-link {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-link-icon-after {
|
||||
margin-left: 5px;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-link-icon-before {
|
||||
margin-left: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-link-icon {
|
||||
-webkit-transition: all 200ms linear;
|
||||
transition: all 200ms linear;
|
||||
}
|
||||
|
||||
.wpsp-howto-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wpsp-ifb-separator {
|
||||
width: 30%;
|
||||
border-top-width: 2px;
|
||||
border-top-color: #333;
|
||||
border-top-style: solid;
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wpsp-ifb-separator-parent {
|
||||
line-height: 0;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-cta-button {
|
||||
display: inline-block;
|
||||
line-height: 1;
|
||||
background-color: #818a91;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpsp-ifb-button-wrapper .wp-block-button__link svg {
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.wpsp-ifb-cta a {
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.wpsp-ifb-title-wrap {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-ifb-title-wrap .wpsp-ifb-title,
|
||||
.wpsp-ifb-title-wrap {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wpsp-how-to__content-wrap.wpsp-howto-child {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wpsp-ifb-icon span {
|
||||
font-size: 40px;
|
||||
height: 40px;
|
||||
color: #333;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.wpsp-how-to__content-wrap.wpsp-howto-child,
|
||||
.wpsp-ifb-content,
|
||||
.wpsp-ifb-title-wrap,
|
||||
svg.dashicon.dashicons-upload {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-cta-link {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
a.wpsp-howto-child-link-wrap {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.wpsp-ifb-content p:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.wpsp-howto-child .wpsp-ifb-icon,
|
||||
.wpsp-howto-child .wpsp-ifb-image-content img {
|
||||
display: inline-block;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.wpsp-ifb-align-icon-after {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.wpsp-ifb-align-icon-before {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
span.wpsp-ifb-button-icon.wpsp-ifb-align-icon-after {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.wpsp-ifb-button-icon {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
font-size: 15px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wpsp-ifb-text-icon {
|
||||
height: 15px;
|
||||
width: 15px;
|
||||
font-size: 15px;
|
||||
line-height: 15px;
|
||||
vertical-align: middle;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-ifb-button-icon svg,
|
||||
.wpsp-ifb-text-icon svg {
|
||||
height: inherit;
|
||||
width: inherit;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.block-editor-page #wpwrap .wpsp-howto-child-cta-link svg,
|
||||
.wpsp-howto-child-cta-link svg {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.wpsp-howto-child__outer-wrap {
|
||||
position: relative;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
a.wpsp-how-to__link-to-all {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
z-index: 3;
|
||||
-webkit-box-shadow: none;
|
||||
box-shadow: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 976px) {
|
||||
|
||||
.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
padding: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-tablet.wpsp-reverse-order-tablet .wpsp-ifb-left-right-wrap {
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
-js-display: inline-flex;
|
||||
display: -webkit-inline-flex;
|
||||
display: -moz-inline-box;
|
||||
display: inline-flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: reverse;
|
||||
-ms-flex-direction: column-reverse;
|
||||
-webkit-flex-direction: column-reverse;
|
||||
-moz-box-orient: vertical;
|
||||
-moz-box-direction: reverse;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-content,
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-tablet .wpsp-ifb-left-right-wrap {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-left.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right-title.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-right.wpsp-howto-child-stacked-tablet .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-separator-parent {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
|
||||
.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
padding: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-mobile.wpsp-reverse-order-mobile .wpsp-ifb-left-right-wrap {
|
||||
display: -webkit-inline-box;
|
||||
display: -ms-inline-flexbox;
|
||||
-js-display: inline-flex;
|
||||
display: -webkit-inline-flex;
|
||||
display: -moz-inline-box;
|
||||
display: inline-flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-box-direction: reverse;
|
||||
-ms-flex-direction: column-reverse;
|
||||
-webkit-flex-direction: column-reverse;
|
||||
-moz-box-orient: vertical;
|
||||
-moz-box-direction: reverse;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-content,
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
display: block;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.wpsp-howto-child.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-stacked-mobile .wpsp-ifb-left-right-wrap {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-left.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-right-title.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap,
|
||||
.wpsp-howto-child-icon-right.wpsp-howto-child-stacked-mobile .wpsp-ifb-imgicon-wrap {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.wpsp-howto-child-icon-left-title .wpsp-ifb-separator-parent {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
.wpsp-howto__cost-wrap {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wpsp-howto__cost-wrap .wpsp-howto-estcost-text,
|
||||
.wpsp-howto__cost-wrap .wpsp-howto-estcost-value,
|
||||
.wpsp-howto__cost-wrap .wpsp-howto-estcost-type {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.wpsp-howto__time-wrap {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-text,
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-value,
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.wpsp-how-to-main-wrap .wpsp-tools__wrap,
|
||||
.wpsp-how-to-main-wrap .wpsp-how-to-materials {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.wpsp-howto__cost-wrap {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wpsp-howto__cost-wrap .wpsp-howto-estcost-text,
|
||||
.wpsp-howto__cost-wrap .wpsp-howto-estcost-value,
|
||||
.wpsp-howto__cost-wrap .wpsp-howto-estcost-type {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.wpsp-howto__time-wrap {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-text,
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeNeeded-value,
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.wpsp-howto__time-wrap .wpsp-howto-timeINmin-text {
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.wpsp-how-to-main-wrap .wpsp-tools__wrap,
|
||||
.wpsp-how-to-main-wrap .wpsp-how-to-materials {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@@ -1,225 +1,225 @@
|
||||
function WPSPslideUp( wpsptarget, duration ) {
|
||||
wpsptarget.style.transitionProperty = 'height, margin, padding';
|
||||
wpsptarget.style.transitionDuration = duration + 'ms';
|
||||
wpsptarget.style.boxSizing = 'border-box';
|
||||
wpsptarget.style.height = wpsptarget.offsetHeight + 'px';
|
||||
wpsptarget.style.overflow = 'hidden';
|
||||
wpsptarget.style.height = 0;
|
||||
wpsptarget.style.paddingTop = 0;
|
||||
wpsptarget.style.paddingBottom = 0;
|
||||
wpsptarget.style.marginTop = 0;
|
||||
wpsptarget.style.marginBottom = 0;
|
||||
window.setTimeout( function () {
|
||||
wpsptarget.style.display = 'none';
|
||||
wpsptarget.style.removeProperty( 'height' );
|
||||
wpsptarget.style.removeProperty( 'padding-top' );
|
||||
wpsptarget.style.removeProperty( 'padding-bottom' );
|
||||
wpsptarget.style.removeProperty( 'margin-top' );
|
||||
wpsptarget.style.removeProperty( 'margin-bottom' );
|
||||
wpsptarget.style.removeProperty( 'overflow' );
|
||||
wpsptarget.style.removeProperty( 'transition-duration' );
|
||||
wpsptarget.style.removeProperty( 'transition-property' );
|
||||
}, duration );
|
||||
}
|
||||
|
||||
function WPSPslideDown( wpsptarget, duration ) {
|
||||
wpsptarget.style.removeProperty( 'display' );
|
||||
let display = window.getComputedStyle( wpsptarget ).display;
|
||||
|
||||
if ( display === 'none' ) display = 'block';
|
||||
|
||||
wpsptarget.style.display = display;
|
||||
const height = wpsptarget.offsetHeight;
|
||||
wpsptarget.style.overflow = 'hidden';
|
||||
wpsptarget.style.height = 0;
|
||||
wpsptarget.style.paddingTop = 0;
|
||||
wpsptarget.style.paddingBottom = 0;
|
||||
wpsptarget.style.marginTop = 0;
|
||||
wpsptarget.style.marginBottom = 0;
|
||||
wpsptarget.style.boxSizing = 'border-box';
|
||||
wpsptarget.style.transitionProperty = 'height, margin, padding';
|
||||
wpsptarget.style.transitionDuration = duration + 'ms';
|
||||
wpsptarget.style.height = height + 'px';
|
||||
wpsptarget.style.removeProperty( 'padding-top' );
|
||||
wpsptarget.style.removeProperty( 'padding-bottom' );
|
||||
wpsptarget.style.removeProperty( 'margin-top' );
|
||||
wpsptarget.style.removeProperty( 'margin-bottom' );
|
||||
window.setTimeout( function () {
|
||||
wpsptarget.style.removeProperty( 'height' );
|
||||
wpsptarget.style.removeProperty( 'overflow' );
|
||||
wpsptarget.style.removeProperty( 'transition-duration' );
|
||||
wpsptarget.style.removeProperty( 'transition-property' );
|
||||
}, duration );
|
||||
}
|
||||
|
||||
function setupFAQ() {
|
||||
const pattern = new RegExp( '^[\\w\\-]+$' );
|
||||
const hashval = window.location.hash.substring( 1 );
|
||||
const expandFirstelements = document.getElementsByClassName(
|
||||
'wpsp-faq-expand-first-true'
|
||||
);
|
||||
const inactiveOtherelements = document.getElementsByClassName(
|
||||
'wpsp-faq-inactive-other-false'
|
||||
);
|
||||
|
||||
if (
|
||||
document.getElementById( hashval ) !== undefined &&
|
||||
document.getElementById( hashval ) !== null &&
|
||||
document.getElementById( hashval ) !== '' &&
|
||||
pattern.test( hashval )
|
||||
) {
|
||||
const elementToOpen = document.getElementById( hashval );
|
||||
if (
|
||||
elementToOpen.getElementsByClassName( 'wpsp-faq-item' )[ 0 ] !==
|
||||
undefined
|
||||
) {
|
||||
elementToOpen
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.classList.add( 'wpsp-faq-item-active' );
|
||||
elementToOpen
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.setAttribute( 'aria-expanded', true );
|
||||
WPSPslideDown(
|
||||
elementToOpen.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
|
||||
500
|
||||
);
|
||||
}
|
||||
} else {
|
||||
for ( let item = 0; item < expandFirstelements.length; item++ ) {
|
||||
if (
|
||||
true ===
|
||||
expandFirstelements[ item ].classList.contains(
|
||||
'wpsp-faq-layout-accordion'
|
||||
)
|
||||
) {
|
||||
expandFirstelements[ item ]
|
||||
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.classList.add( 'wpsp-faq-item-active' );
|
||||
expandFirstelements[ item ]
|
||||
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.setAttribute( 'aria-expanded', true );
|
||||
expandFirstelements[ item ]
|
||||
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.querySelectorAll(
|
||||
'.wpsp-faq-content'
|
||||
)[ 0 ].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (
|
||||
let otherItem = 0;
|
||||
otherItem < inactiveOtherelements.length;
|
||||
otherItem++
|
||||
) {
|
||||
if (
|
||||
true ===
|
||||
inactiveOtherelements[ otherItem ].classList.contains(
|
||||
'wpsp-faq-layout-accordion'
|
||||
)
|
||||
) {
|
||||
const otherItems = inactiveOtherelements[
|
||||
otherItem
|
||||
].querySelectorAll( '.wpsp-faq-child__outer-wrap' );
|
||||
|
||||
for (
|
||||
let childItem = 0;
|
||||
childItem < otherItems.length;
|
||||
childItem++
|
||||
) {
|
||||
otherItems[ childItem ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.classList.add( 'wpsp-faq-item-active' );
|
||||
otherItems[ childItem ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.setAttribute( 'aria-expanded', true );
|
||||
otherItems[ childItem ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.querySelectorAll(
|
||||
'.wpsp-faq-content'
|
||||
)[ 0 ].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* eslint-disable */
|
||||
window.addEventListener('load', function () {
|
||||
/* eslint-enable */
|
||||
setupFAQ();
|
||||
|
||||
const accordionElements = document.getElementsByClassName(
|
||||
'wpsp-faq-layout-accordion'
|
||||
);
|
||||
for ( let item = 0; item < accordionElements.length; item++ ) {
|
||||
const questionButtons = accordionElements[ item ].querySelectorAll(
|
||||
'.wpsp-faq-questions-button'
|
||||
);
|
||||
|
||||
for ( let button = 0; button < questionButtons.length; button++ ) {
|
||||
questionButtons[ button ].parentElement.addEventListener(
|
||||
'click',
|
||||
function ( e ) {
|
||||
WPSPfaqClick( e, this );
|
||||
}
|
||||
);
|
||||
questionButtons[ button ].parentElement.addEventListener(
|
||||
'keypress',
|
||||
function ( e ) {
|
||||
WPSPfaqClick( e, this );
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
function WPSPfaqClick( e, wpspfaqItem ) {
|
||||
if ( e.target.tagName === 'A' ) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
if ( wpspfaqItem.classList.contains( 'wpsp-faq-item-active' ) ) {
|
||||
wpspfaqItem.classList.remove( 'wpsp-faq-item-active' );
|
||||
wpspfaqItem.setAttribute( 'aria-expanded', false );
|
||||
WPSPslideUp(
|
||||
wpspfaqItem.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
|
||||
500
|
||||
);
|
||||
} else {
|
||||
const parent = e.currentTarget.closest( '.wp-block-wpsp-faq' );
|
||||
let faqToggle = 'true';
|
||||
if ( parent.classList.contains( 'wp-block-wpsp-faq' ) ) {
|
||||
faqToggle = parent.getAttribute( 'data-faqtoggle' );
|
||||
}
|
||||
wpspfaqItem.classList.add( 'wpsp-faq-item-active' );
|
||||
wpspfaqItem.setAttribute( 'aria-expanded', true );
|
||||
WPSPslideDown(
|
||||
wpspfaqItem.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
|
||||
500
|
||||
);
|
||||
if ( 'true' === faqToggle ) {
|
||||
const questionButtons = parent.querySelectorAll(
|
||||
'.wpsp-faq-questions-button'
|
||||
);
|
||||
for (
|
||||
let buttonChild = 0;
|
||||
buttonChild < questionButtons.length;
|
||||
buttonChild++
|
||||
) {
|
||||
const buttonItem = questionButtons[ buttonChild ].parentElement;
|
||||
if ( buttonItem === wpspfaqItem ) {
|
||||
continue;
|
||||
}
|
||||
buttonItem.classList.remove( 'wpsp-faq-item-active' );
|
||||
buttonItem.setAttribute( 'aria-expanded', false );
|
||||
WPSPslideUp(
|
||||
buttonItem.getElementsByClassName(
|
||||
'wpsp-faq-content'
|
||||
)[ 0 ],
|
||||
500
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function WPSPslideUp( wpsptarget, duration ) {
|
||||
wpsptarget.style.transitionProperty = 'height, margin, padding';
|
||||
wpsptarget.style.transitionDuration = duration + 'ms';
|
||||
wpsptarget.style.boxSizing = 'border-box';
|
||||
wpsptarget.style.height = wpsptarget.offsetHeight + 'px';
|
||||
wpsptarget.style.overflow = 'hidden';
|
||||
wpsptarget.style.height = 0;
|
||||
wpsptarget.style.paddingTop = 0;
|
||||
wpsptarget.style.paddingBottom = 0;
|
||||
wpsptarget.style.marginTop = 0;
|
||||
wpsptarget.style.marginBottom = 0;
|
||||
window.setTimeout( function () {
|
||||
wpsptarget.style.display = 'none';
|
||||
wpsptarget.style.removeProperty( 'height' );
|
||||
wpsptarget.style.removeProperty( 'padding-top' );
|
||||
wpsptarget.style.removeProperty( 'padding-bottom' );
|
||||
wpsptarget.style.removeProperty( 'margin-top' );
|
||||
wpsptarget.style.removeProperty( 'margin-bottom' );
|
||||
wpsptarget.style.removeProperty( 'overflow' );
|
||||
wpsptarget.style.removeProperty( 'transition-duration' );
|
||||
wpsptarget.style.removeProperty( 'transition-property' );
|
||||
}, duration );
|
||||
}
|
||||
|
||||
function WPSPslideDown( wpsptarget, duration ) {
|
||||
wpsptarget.style.removeProperty( 'display' );
|
||||
let display = window.getComputedStyle( wpsptarget ).display;
|
||||
|
||||
if ( display === 'none' ) display = 'block';
|
||||
|
||||
wpsptarget.style.display = display;
|
||||
const height = wpsptarget.offsetHeight;
|
||||
wpsptarget.style.overflow = 'hidden';
|
||||
wpsptarget.style.height = 0;
|
||||
wpsptarget.style.paddingTop = 0;
|
||||
wpsptarget.style.paddingBottom = 0;
|
||||
wpsptarget.style.marginTop = 0;
|
||||
wpsptarget.style.marginBottom = 0;
|
||||
wpsptarget.style.boxSizing = 'border-box';
|
||||
wpsptarget.style.transitionProperty = 'height, margin, padding';
|
||||
wpsptarget.style.transitionDuration = duration + 'ms';
|
||||
wpsptarget.style.height = height + 'px';
|
||||
wpsptarget.style.removeProperty( 'padding-top' );
|
||||
wpsptarget.style.removeProperty( 'padding-bottom' );
|
||||
wpsptarget.style.removeProperty( 'margin-top' );
|
||||
wpsptarget.style.removeProperty( 'margin-bottom' );
|
||||
window.setTimeout( function () {
|
||||
wpsptarget.style.removeProperty( 'height' );
|
||||
wpsptarget.style.removeProperty( 'overflow' );
|
||||
wpsptarget.style.removeProperty( 'transition-duration' );
|
||||
wpsptarget.style.removeProperty( 'transition-property' );
|
||||
}, duration );
|
||||
}
|
||||
|
||||
function setupFAQ() {
|
||||
const pattern = new RegExp( '^[\\w\\-]+$' );
|
||||
const hashval = window.location.hash.substring( 1 );
|
||||
const expandFirstelements = document.getElementsByClassName(
|
||||
'wpsp-faq-expand-first-true'
|
||||
);
|
||||
const inactiveOtherelements = document.getElementsByClassName(
|
||||
'wpsp-faq-inactive-other-false'
|
||||
);
|
||||
|
||||
if (
|
||||
document.getElementById( hashval ) !== undefined &&
|
||||
document.getElementById( hashval ) !== null &&
|
||||
document.getElementById( hashval ) !== '' &&
|
||||
pattern.test( hashval )
|
||||
) {
|
||||
const elementToOpen = document.getElementById( hashval );
|
||||
if (
|
||||
elementToOpen.getElementsByClassName( 'wpsp-faq-item' )[ 0 ] !==
|
||||
undefined
|
||||
) {
|
||||
elementToOpen
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.classList.add( 'wpsp-faq-item-active' );
|
||||
elementToOpen
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.setAttribute( 'aria-expanded', true );
|
||||
WPSPslideDown(
|
||||
elementToOpen.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
|
||||
500
|
||||
);
|
||||
}
|
||||
} else {
|
||||
for ( let item = 0; item < expandFirstelements.length; item++ ) {
|
||||
if (
|
||||
true ===
|
||||
expandFirstelements[ item ].classList.contains(
|
||||
'wpsp-faq-layout-accordion'
|
||||
)
|
||||
) {
|
||||
expandFirstelements[ item ]
|
||||
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.classList.add( 'wpsp-faq-item-active' );
|
||||
expandFirstelements[ item ]
|
||||
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.setAttribute( 'aria-expanded', true );
|
||||
expandFirstelements[ item ]
|
||||
.querySelectorAll( '.wpsp-faq-child__outer-wrap' )[ 0 ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.querySelectorAll(
|
||||
'.wpsp-faq-content'
|
||||
)[ 0 ].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
for (
|
||||
let otherItem = 0;
|
||||
otherItem < inactiveOtherelements.length;
|
||||
otherItem++
|
||||
) {
|
||||
if (
|
||||
true ===
|
||||
inactiveOtherelements[ otherItem ].classList.contains(
|
||||
'wpsp-faq-layout-accordion'
|
||||
)
|
||||
) {
|
||||
const otherItems = inactiveOtherelements[
|
||||
otherItem
|
||||
].querySelectorAll( '.wpsp-faq-child__outer-wrap' );
|
||||
|
||||
for (
|
||||
let childItem = 0;
|
||||
childItem < otherItems.length;
|
||||
childItem++
|
||||
) {
|
||||
otherItems[ childItem ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.classList.add( 'wpsp-faq-item-active' );
|
||||
otherItems[ childItem ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.setAttribute( 'aria-expanded', true );
|
||||
otherItems[ childItem ]
|
||||
.getElementsByClassName( 'wpsp-faq-item' )[ 0 ]
|
||||
.querySelectorAll(
|
||||
'.wpsp-faq-content'
|
||||
)[ 0 ].style.display = 'block';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* eslint-disable */
|
||||
window.addEventListener('load', function () {
|
||||
/* eslint-enable */
|
||||
setupFAQ();
|
||||
|
||||
const accordionElements = document.getElementsByClassName(
|
||||
'wpsp-faq-layout-accordion'
|
||||
);
|
||||
for ( let item = 0; item < accordionElements.length; item++ ) {
|
||||
const questionButtons = accordionElements[ item ].querySelectorAll(
|
||||
'.wpsp-faq-questions-button'
|
||||
);
|
||||
|
||||
for ( let button = 0; button < questionButtons.length; button++ ) {
|
||||
questionButtons[ button ].parentElement.addEventListener(
|
||||
'click',
|
||||
function ( e ) {
|
||||
WPSPfaqClick( e, this );
|
||||
}
|
||||
);
|
||||
questionButtons[ button ].parentElement.addEventListener(
|
||||
'keypress',
|
||||
function ( e ) {
|
||||
WPSPfaqClick( e, this );
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
function WPSPfaqClick( e, wpspfaqItem ) {
|
||||
if ( e.target.tagName === 'A' ) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
if ( wpspfaqItem.classList.contains( 'wpsp-faq-item-active' ) ) {
|
||||
wpspfaqItem.classList.remove( 'wpsp-faq-item-active' );
|
||||
wpspfaqItem.setAttribute( 'aria-expanded', false );
|
||||
WPSPslideUp(
|
||||
wpspfaqItem.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
|
||||
500
|
||||
);
|
||||
} else {
|
||||
const parent = e.currentTarget.closest( '.wp-block-wpsp-faq' );
|
||||
let faqToggle = 'true';
|
||||
if ( parent.classList.contains( 'wp-block-wpsp-faq' ) ) {
|
||||
faqToggle = parent.getAttribute( 'data-faqtoggle' );
|
||||
}
|
||||
wpspfaqItem.classList.add( 'wpsp-faq-item-active' );
|
||||
wpspfaqItem.setAttribute( 'aria-expanded', true );
|
||||
WPSPslideDown(
|
||||
wpspfaqItem.getElementsByClassName( 'wpsp-faq-content' )[ 0 ],
|
||||
500
|
||||
);
|
||||
if ( 'true' === faqToggle ) {
|
||||
const questionButtons = parent.querySelectorAll(
|
||||
'.wpsp-faq-questions-button'
|
||||
);
|
||||
for (
|
||||
let buttonChild = 0;
|
||||
buttonChild < questionButtons.length;
|
||||
buttonChild++
|
||||
) {
|
||||
const buttonItem = questionButtons[ buttonChild ].parentElement;
|
||||
if ( buttonItem === wpspfaqItem ) {
|
||||
continue;
|
||||
}
|
||||
buttonItem.classList.remove( 'wpsp-faq-item-active' );
|
||||
buttonItem.setAttribute( 'aria-expanded', false );
|
||||
WPSPslideUp(
|
||||
buttonItem.getElementsByClassName(
|
||||
'wpsp-faq-content'
|
||||
)[ 0 ],
|
||||
500
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,169 +1,169 @@
|
||||
<?php
|
||||
/**
|
||||
* Schema Pro Admin.
|
||||
*
|
||||
* @package Schema Pro
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'BSF_SP_Admin' ) ) {
|
||||
|
||||
/**
|
||||
* Class BSF_SP_Admin.
|
||||
*/
|
||||
final class BSF_SP_Admin {
|
||||
|
||||
/**
|
||||
* Calls on initialization
|
||||
*
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public static function init() {
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::wpsp_initialize_ajax();
|
||||
|
||||
add_action( 'wpsp_render_admin_content', __CLASS__ . '::render_content' );
|
||||
// Activation hook.
|
||||
add_action( 'admin_init', __CLASS__ . '::wpsp_activation_redirect' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Activation Reset
|
||||
*/
|
||||
public static function wpsp_activation_redirect() {
|
||||
$do_redirect = apply_filters( 'wpsp_enable_redirect_activation', get_option( '__wpsp_do_redirect' ) );
|
||||
if ( $do_redirect ) {
|
||||
update_option( '__wpsp_do_redirect', false );
|
||||
if ( ! is_multisite() ) {
|
||||
wp_safe_redirect( esc_url( admin_url( 'options-general.php?page=' . SP_SLUG ) ) );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize Ajax
|
||||
*/
|
||||
public static function wpsp_initialize_ajax() {
|
||||
|
||||
// if ( ! current_user_can( 'manage_options' ) ) {
|
||||
// return;
|
||||
// }
|
||||
// Ajax requests.
|
||||
add_action( 'wp_ajax_wpsp_activate_widget', __CLASS__ . '::wpsp_activate_widget' );
|
||||
add_action( 'wp_ajax_wpsp_deactivate_widget', __CLASS__ . '::wpsp_deactivate_widget' );
|
||||
|
||||
add_action( 'wp_ajax_wpsp_bulk_activate_widgets', __CLASS__ . '::wpsp_bulk_activate_widgets' );
|
||||
add_action( 'wp_ajax_wpsp_bulk_deactivate_widgets', __CLASS__ . '::wpsp_bulk_deactivate_widgets' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate module
|
||||
*/
|
||||
public static function wpsp_activate_widget() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
$block_id = isset( $_POST['block_id'] ) ? sanitize_text_field( $_POST['block_id'] ) : '';
|
||||
$blocks = BSF_SP_Admin_Helper::get_admin_settings_option( '_wpsp_blocks', array() );
|
||||
$blocks[ $block_id ] = $block_id;
|
||||
$blocks = array_map( 'esc_attr', $blocks );
|
||||
|
||||
// Update blocks.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate module
|
||||
*/
|
||||
public static function wpsp_deactivate_widget() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
$block_id = isset( $_POST['block_id'] ) ? sanitize_text_field( $_POST['block_id'] ) : '';
|
||||
$blocks = BSF_SP_Admin_Helper::get_admin_settings_option( '_wpsp_blocks', array() );
|
||||
$blocks[ $block_id ] = 'disabled';
|
||||
$blocks = array_map( 'esc_attr', $blocks );
|
||||
|
||||
// Update blocks.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate all module
|
||||
*/
|
||||
public static function wpsp_bulk_activate_widgets() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
// Get all widgets.
|
||||
$all_blocks = BSF_SP_Helper::$block_list;
|
||||
$new_blocks = array();
|
||||
|
||||
// Set all extension to enabled.
|
||||
foreach ( $all_blocks as $slug => $value ) {
|
||||
$_slug = str_replace( 'wpsp/', '', $slug );
|
||||
$new_blocks[ $_slug ] = $_slug;
|
||||
}
|
||||
|
||||
// Escape attrs.
|
||||
$new_blocks = array_map( 'esc_attr', $new_blocks );
|
||||
|
||||
// Update new_extensions.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $new_blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate all module
|
||||
*/
|
||||
public static function wpsp_bulk_deactivate_widgets() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
// Get all extensions.
|
||||
$old_blocks = BSF_SP_Helper::$block_list;
|
||||
$new_blocks = array();
|
||||
|
||||
// Set all extension to enabled.
|
||||
foreach ( $old_blocks as $slug => $value ) {
|
||||
$_slug = str_replace( 'wpsp/', '', $slug );
|
||||
$new_blocks[ $_slug ] = 'disabled';
|
||||
}
|
||||
|
||||
// Escape attrs.
|
||||
$new_blocks = array_map( 'esc_attr', $new_blocks );
|
||||
|
||||
// Update new_extensions.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $new_blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
}
|
||||
|
||||
BSF_SP_Admin::init();
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* Schema Pro Admin.
|
||||
*
|
||||
* @package Schema Pro
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'BSF_SP_Admin' ) ) {
|
||||
|
||||
/**
|
||||
* Class BSF_SP_Admin.
|
||||
*/
|
||||
final class BSF_SP_Admin {
|
||||
|
||||
/**
|
||||
* Calls on initialization
|
||||
*
|
||||
* @since 0.0.1
|
||||
*/
|
||||
public static function init() {
|
||||
|
||||
if ( ! is_admin() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
self::wpsp_initialize_ajax();
|
||||
|
||||
add_action( 'wpsp_render_admin_content', __CLASS__ . '::render_content' );
|
||||
// Activation hook.
|
||||
add_action( 'admin_init', __CLASS__ . '::wpsp_activation_redirect' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Activation Reset
|
||||
*/
|
||||
public static function wpsp_activation_redirect() {
|
||||
$do_redirect = apply_filters( 'wpsp_enable_redirect_activation', get_option( '__wpsp_do_redirect' ) );
|
||||
if ( $do_redirect ) {
|
||||
update_option( '__wpsp_do_redirect', false );
|
||||
if ( ! is_multisite() ) {
|
||||
wp_safe_redirect( esc_url( admin_url( 'options-general.php?page=' . SP_SLUG ) ) );
|
||||
exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize Ajax
|
||||
*/
|
||||
public static function wpsp_initialize_ajax() {
|
||||
|
||||
// if ( ! current_user_can( 'manage_options' ) ) {
|
||||
// return;
|
||||
// }
|
||||
// Ajax requests.
|
||||
add_action( 'wp_ajax_wpsp_activate_widget', __CLASS__ . '::wpsp_activate_widget' );
|
||||
add_action( 'wp_ajax_wpsp_deactivate_widget', __CLASS__ . '::wpsp_deactivate_widget' );
|
||||
|
||||
add_action( 'wp_ajax_wpsp_bulk_activate_widgets', __CLASS__ . '::wpsp_bulk_activate_widgets' );
|
||||
add_action( 'wp_ajax_wpsp_bulk_deactivate_widgets', __CLASS__ . '::wpsp_bulk_deactivate_widgets' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate module
|
||||
*/
|
||||
public static function wpsp_activate_widget() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
$block_id = isset( $_POST['block_id'] ) ? sanitize_text_field( $_POST['block_id'] ) : '';
|
||||
$blocks = BSF_SP_Admin_Helper::get_admin_settings_option( '_wpsp_blocks', array() );
|
||||
$blocks[ $block_id ] = $block_id;
|
||||
$blocks = array_map( 'esc_attr', $blocks );
|
||||
|
||||
// Update blocks.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate module
|
||||
*/
|
||||
public static function wpsp_deactivate_widget() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
$block_id = isset( $_POST['block_id'] ) ? sanitize_text_field( $_POST['block_id'] ) : '';
|
||||
$blocks = BSF_SP_Admin_Helper::get_admin_settings_option( '_wpsp_blocks', array() );
|
||||
$blocks[ $block_id ] = 'disabled';
|
||||
$blocks = array_map( 'esc_attr', $blocks );
|
||||
|
||||
// Update blocks.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Activate all module
|
||||
*/
|
||||
public static function wpsp_bulk_activate_widgets() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
// Get all widgets.
|
||||
$all_blocks = BSF_SP_Helper::$block_list;
|
||||
$new_blocks = array();
|
||||
|
||||
// Set all extension to enabled.
|
||||
foreach ( $all_blocks as $slug => $value ) {
|
||||
$_slug = str_replace( 'wpsp/', '', $slug );
|
||||
$new_blocks[ $_slug ] = $_slug;
|
||||
}
|
||||
|
||||
// Escape attrs.
|
||||
$new_blocks = array_map( 'esc_attr', $new_blocks );
|
||||
|
||||
// Update new_extensions.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $new_blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deactivate all module
|
||||
*/
|
||||
public static function wpsp_bulk_deactivate_widgets() {
|
||||
if ( ! current_user_can( 'manage_options' ) ) {
|
||||
return false;
|
||||
}
|
||||
check_ajax_referer( 'wpsp-block-nonce', 'nonce' );
|
||||
|
||||
// Get all extensions.
|
||||
$old_blocks = BSF_SP_Helper::$block_list;
|
||||
$new_blocks = array();
|
||||
|
||||
// Set all extension to enabled.
|
||||
foreach ( $old_blocks as $slug => $value ) {
|
||||
$_slug = str_replace( 'wpsp/', '', $slug );
|
||||
$new_blocks[ $_slug ] = 'disabled';
|
||||
}
|
||||
|
||||
// Escape attrs.
|
||||
$new_blocks = array_map( 'esc_attr', $new_blocks );
|
||||
|
||||
// Update new_extensions.
|
||||
BSF_SP_Admin_Helper::update_admin_settings_option( '_wpsp_blocks', $new_blocks );
|
||||
BSF_SP_Admin_Helper::create_specific_stylesheet();
|
||||
|
||||
wp_send_json_success();
|
||||
}
|
||||
}
|
||||
|
||||
BSF_SP_Admin::init();
|
||||
}
|
||||
|
||||
@@ -1,238 +1,238 @@
|
||||
<?php
|
||||
/**
|
||||
* Schema Pro Blocks Initializer
|
||||
*
|
||||
* Enqueue CSS/JS of all the blocks.
|
||||
*
|
||||
* @since 2.2.0
|
||||
* @package Schema Pro
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* BSF_SP_Init_Blocks.
|
||||
*
|
||||
* @package Schema Pro
|
||||
*/
|
||||
class BSF_SP_Init_Blocks {
|
||||
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
// Hook: Frontend assets.
|
||||
add_action( 'enqueue_block_assets', array( $this, 'block_assets' ) );
|
||||
|
||||
// Hook: Editor assets.
|
||||
add_action( 'enqueue_block_editor_assets', array( $this, 'editor_assets' ), 15 );
|
||||
|
||||
add_filter( 'block_categories_all', array( $this, 'register_block_category' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gutenberg block category for Schema Pro.
|
||||
*
|
||||
* @param array $categories Block categories.
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function register_block_category( $categories ) {
|
||||
return array_merge(
|
||||
$categories,
|
||||
array(
|
||||
array(
|
||||
'slug' => 'wpsp',
|
||||
'title' => __( 'Schema Pro', 'wp-schema-pro' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Gutenberg block assets for both frontend + backend.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function block_assets() {
|
||||
|
||||
$post = get_post();
|
||||
|
||||
/**
|
||||
* Filters the post to build stylesheet for.
|
||||
*
|
||||
* @param \WP_Post $post The global post.
|
||||
*/
|
||||
$post = apply_filters( 'wpsp_post_for_stylesheet', $post );
|
||||
|
||||
if ( false === has_blocks( $post ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( false === BSF_SP_Helper::$wpsp_flag ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style(
|
||||
'wpsp-block-css', // Handle.
|
||||
BSF_AIOSRS_PRO_URI . 'dist/style-blocks.css', // Block style CSS.
|
||||
array(),
|
||||
BSF_AIOSRS_PRO_VER
|
||||
);
|
||||
$blocks = BSF_SP_Config::get_block_attributes();
|
||||
$block_assets = BSF_SP_Config::get_block_assets();
|
||||
|
||||
foreach ( $blocks as $slug => $value ) {
|
||||
|
||||
$js_assets = ( isset( $blocks[ $slug ]['js_assets'] ) ) ? $blocks[ $slug ]['js_assets'] : array();
|
||||
|
||||
$css_assets = ( isset( $blocks[ $slug ]['css_assets'] ) ) ? $blocks[ $slug ]['css_assets'] : array();
|
||||
|
||||
foreach ( $js_assets as $asset_handle => $val ) {
|
||||
// Scripts.
|
||||
wp_register_script(
|
||||
$val, // Handle.
|
||||
$block_assets[ $val ]['src'],
|
||||
$block_assets[ $val ]['dep'],
|
||||
BSF_AIOSRS_PRO_VER,
|
||||
true
|
||||
);
|
||||
|
||||
$skip_editor = isset( $block_assets[ $val ]['skipEditor'] ) ? $block_assets[ $val ]['skipEditor'] : false;
|
||||
|
||||
if ( is_admin() && false === $skip_editor ) {
|
||||
wp_enqueue_script( $val );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $css_assets as $asset_handle => $val ) {
|
||||
// Styles.
|
||||
wp_register_style(
|
||||
$val, // Handle.
|
||||
$block_assets[ $val ]['src'],
|
||||
$block_assets[ $val ]['dep'],
|
||||
BSF_AIOSRS_PRO_VER
|
||||
);
|
||||
|
||||
if ( is_admin() ) {
|
||||
wp_enqueue_style( $val );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // End function editor_assets().
|
||||
|
||||
/**
|
||||
* Enqueue Gutenberg block assets for backend editor.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function editor_assets() {
|
||||
|
||||
$wpsp_ajax_nonce = wp_create_nonce( 'wpsp_ajax_nonce' );
|
||||
$script_dep_path = BSF_AIOSRS_PRO_DIR . 'dist/blocks.asset.php';
|
||||
$script_info = file_exists( $script_dep_path )
|
||||
? include $script_dep_path
|
||||
: array(
|
||||
'dependencies' => array(),
|
||||
'version' => BSF_AIOSRS_PRO_VER,
|
||||
);
|
||||
$script_dep = array_merge( $script_info['dependencies'], array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor', 'wp-api-fetch' ) );
|
||||
// Scripts.
|
||||
wp_enqueue_script(
|
||||
'wpsp-block-editor-js', // Handle.
|
||||
BSF_AIOSRS_PRO_URI . 'dist/blocks.js',
|
||||
$script_dep, // Dependencies, defined above.
|
||||
$script_info['version'], // BSF_AIOSRS_PRO_VER.
|
||||
true // Enqueue the script in the footer.
|
||||
);
|
||||
|
||||
// Common Editor style.
|
||||
wp_enqueue_style(
|
||||
'wpsp-block-common-editor-css', // Handle.
|
||||
BSF_AIOSRS_PRO_URI . 'wpsp-blocks/assets/css/blocks.commoneditorstyle.build.css', // Block editor CSS.
|
||||
array( 'wp-edit-blocks' ), // Dependency to include the CSS after it.
|
||||
BSF_AIOSRS_PRO_VER
|
||||
);
|
||||
|
||||
$blocks = array();
|
||||
$saved_blocks = BSF_SP_Admin_Helper::get_admin_settings_option( '_wpsp_blocks' );
|
||||
|
||||
if ( is_array( $saved_blocks ) ) {
|
||||
foreach ( $saved_blocks as $slug => $data ) {
|
||||
$_slug = 'wpsp/' . $slug;
|
||||
$current_block = BSF_SP_Config::$block_attributes[ $_slug ];
|
||||
|
||||
if ( isset( $current_block['is_child'] ) && $current_block['is_child'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $current_block['is_active'] ) && ! $current_block['is_active'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $saved_blocks[ $slug ] ) && ( 'disabled' === $saved_blocks[ $slug ] ) ) {
|
||||
array_push( $blocks, $_slug );
|
||||
}
|
||||
}
|
||||
}
|
||||
wp_localize_script(
|
||||
'wpsp-block-editor-js',
|
||||
'wpsp_blocks_info',
|
||||
array(
|
||||
'blocks' => BSF_SP_Config::get_block_attributes(),
|
||||
'category' => 'wpsp',
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'tablet_breakpoint' => WPSP_TABLET_BREAKPOINT,
|
||||
'mobile_breakpoint' => WPSP_MOBILE_BREAKPOINT,
|
||||
'wpsp_ajax_nonce' => $wpsp_ajax_nonce,
|
||||
'wpsp_home_url' => home_url(),
|
||||
'wpsp_base_url' => BSF_AIOSRS_PRO_URI,
|
||||
'wpsp_icons' => $this->get_svg_icons(),
|
||||
)
|
||||
);
|
||||
} // End function editor_assets().
|
||||
|
||||
/**
|
||||
* Get the SVG icons.
|
||||
*/
|
||||
private function get_svg_icons() {
|
||||
|
||||
$file_path = BSF_AIOSRS_PRO_DIR . 'wpsp-config/controls/WPSPIcon.json';
|
||||
|
||||
// Check if the file exists before attempting to read it.
|
||||
if ( file_exists( $file_path ) ) {
|
||||
$file_content = file_get_contents( $file_path );
|
||||
|
||||
// Check if file_get_contents was successful.
|
||||
if ( $file_content !== false ) {
|
||||
// Parse JSON content.
|
||||
return json_decode( $file_content, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Prepare if class 'BSF_SP_Init_Blocks' exist.
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
BSF_SP_Init_Blocks::get_instance();
|
||||
<?php
|
||||
/**
|
||||
* Schema Pro Blocks Initializer
|
||||
*
|
||||
* Enqueue CSS/JS of all the blocks.
|
||||
*
|
||||
* @since 2.2.0
|
||||
* @package Schema Pro
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit; // Exit if accessed directly.
|
||||
}
|
||||
|
||||
/**
|
||||
* BSF_SP_Init_Blocks.
|
||||
*
|
||||
* @package Schema Pro
|
||||
*/
|
||||
class BSF_SP_Init_Blocks {
|
||||
|
||||
|
||||
/**
|
||||
* Member Variable
|
||||
*
|
||||
* @var instance
|
||||
*/
|
||||
private static $instance;
|
||||
|
||||
/**
|
||||
* Initiator
|
||||
*/
|
||||
public static function get_instance() {
|
||||
if ( ! isset( self::$instance ) ) {
|
||||
self::$instance = new self();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct() {
|
||||
// Hook: Frontend assets.
|
||||
add_action( 'enqueue_block_assets', array( $this, 'block_assets' ) );
|
||||
|
||||
// Hook: Editor assets.
|
||||
add_action( 'enqueue_block_editor_assets', array( $this, 'editor_assets' ), 15 );
|
||||
|
||||
add_filter( 'block_categories_all', array( $this, 'register_block_category' ), 10, 2 );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gutenberg block category for Schema Pro.
|
||||
*
|
||||
* @param array $categories Block categories.
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function register_block_category( $categories ) {
|
||||
return array_merge(
|
||||
$categories,
|
||||
array(
|
||||
array(
|
||||
'slug' => 'wpsp',
|
||||
'title' => __( 'Schema Pro', 'wp-schema-pro' ),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Gutenberg block assets for both frontend + backend.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function block_assets() {
|
||||
|
||||
$post = get_post();
|
||||
|
||||
/**
|
||||
* Filters the post to build stylesheet for.
|
||||
*
|
||||
* @param \WP_Post $post The global post.
|
||||
*/
|
||||
$post = apply_filters( 'wpsp_post_for_stylesheet', $post );
|
||||
|
||||
if ( false === has_blocks( $post ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( false === BSF_SP_Helper::$wpsp_flag ) {
|
||||
return;
|
||||
}
|
||||
|
||||
wp_enqueue_style(
|
||||
'wpsp-block-css', // Handle.
|
||||
BSF_AIOSRS_PRO_URI . 'dist/style-blocks.css', // Block style CSS.
|
||||
array(),
|
||||
BSF_AIOSRS_PRO_VER
|
||||
);
|
||||
$blocks = BSF_SP_Config::get_block_attributes();
|
||||
$block_assets = BSF_SP_Config::get_block_assets();
|
||||
|
||||
foreach ( $blocks as $slug => $value ) {
|
||||
|
||||
$js_assets = ( isset( $blocks[ $slug ]['js_assets'] ) ) ? $blocks[ $slug ]['js_assets'] : array();
|
||||
|
||||
$css_assets = ( isset( $blocks[ $slug ]['css_assets'] ) ) ? $blocks[ $slug ]['css_assets'] : array();
|
||||
|
||||
foreach ( $js_assets as $asset_handle => $val ) {
|
||||
// Scripts.
|
||||
wp_register_script(
|
||||
$val, // Handle.
|
||||
$block_assets[ $val ]['src'],
|
||||
$block_assets[ $val ]['dep'],
|
||||
BSF_AIOSRS_PRO_VER,
|
||||
true
|
||||
);
|
||||
|
||||
$skip_editor = isset( $block_assets[ $val ]['skipEditor'] ) ? $block_assets[ $val ]['skipEditor'] : false;
|
||||
|
||||
if ( is_admin() && false === $skip_editor ) {
|
||||
wp_enqueue_script( $val );
|
||||
}
|
||||
}
|
||||
|
||||
foreach ( $css_assets as $asset_handle => $val ) {
|
||||
// Styles.
|
||||
wp_register_style(
|
||||
$val, // Handle.
|
||||
$block_assets[ $val ]['src'],
|
||||
$block_assets[ $val ]['dep'],
|
||||
BSF_AIOSRS_PRO_VER
|
||||
);
|
||||
|
||||
if ( is_admin() ) {
|
||||
wp_enqueue_style( $val );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // End function editor_assets().
|
||||
|
||||
/**
|
||||
* Enqueue Gutenberg block assets for backend editor.
|
||||
*
|
||||
* @since 2.2.0
|
||||
*/
|
||||
public function editor_assets() {
|
||||
|
||||
$wpsp_ajax_nonce = wp_create_nonce( 'wpsp_ajax_nonce' );
|
||||
$script_dep_path = BSF_AIOSRS_PRO_DIR . 'dist/blocks.asset.php';
|
||||
$script_info = file_exists( $script_dep_path )
|
||||
? include $script_dep_path
|
||||
: array(
|
||||
'dependencies' => array(),
|
||||
'version' => BSF_AIOSRS_PRO_VER,
|
||||
);
|
||||
$script_dep = array_merge( $script_info['dependencies'], array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor', 'wp-api-fetch' ) );
|
||||
// Scripts.
|
||||
wp_enqueue_script(
|
||||
'wpsp-block-editor-js', // Handle.
|
||||
BSF_AIOSRS_PRO_URI . 'dist/blocks.js',
|
||||
$script_dep, // Dependencies, defined above.
|
||||
$script_info['version'], // BSF_AIOSRS_PRO_VER.
|
||||
true // Enqueue the script in the footer.
|
||||
);
|
||||
|
||||
// Common Editor style.
|
||||
wp_enqueue_style(
|
||||
'wpsp-block-common-editor-css', // Handle.
|
||||
BSF_AIOSRS_PRO_URI . 'wpsp-blocks/assets/css/blocks.commoneditorstyle.build.css', // Block editor CSS.
|
||||
array( 'wp-edit-blocks' ), // Dependency to include the CSS after it.
|
||||
BSF_AIOSRS_PRO_VER
|
||||
);
|
||||
|
||||
$blocks = array();
|
||||
$saved_blocks = BSF_SP_Admin_Helper::get_admin_settings_option( '_wpsp_blocks' );
|
||||
|
||||
if ( is_array( $saved_blocks ) ) {
|
||||
foreach ( $saved_blocks as $slug => $data ) {
|
||||
$_slug = 'wpsp/' . $slug;
|
||||
$current_block = BSF_SP_Config::$block_attributes[ $_slug ];
|
||||
|
||||
if ( isset( $current_block['is_child'] ) && $current_block['is_child'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $current_block['is_active'] ) && ! $current_block['is_active'] ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( isset( $saved_blocks[ $slug ] ) && ( 'disabled' === $saved_blocks[ $slug ] ) ) {
|
||||
array_push( $blocks, $_slug );
|
||||
}
|
||||
}
|
||||
}
|
||||
wp_localize_script(
|
||||
'wpsp-block-editor-js',
|
||||
'wpsp_blocks_info',
|
||||
array(
|
||||
'blocks' => BSF_SP_Config::get_block_attributes(),
|
||||
'category' => 'wpsp',
|
||||
'ajax_url' => admin_url( 'admin-ajax.php' ),
|
||||
'tablet_breakpoint' => WPSP_TABLET_BREAKPOINT,
|
||||
'mobile_breakpoint' => WPSP_MOBILE_BREAKPOINT,
|
||||
'wpsp_ajax_nonce' => $wpsp_ajax_nonce,
|
||||
'wpsp_home_url' => home_url(),
|
||||
'wpsp_base_url' => BSF_AIOSRS_PRO_URI,
|
||||
'wpsp_icons' => $this->get_svg_icons(),
|
||||
)
|
||||
);
|
||||
} // End function editor_assets().
|
||||
|
||||
/**
|
||||
* Get the SVG icons.
|
||||
*/
|
||||
private function get_svg_icons() {
|
||||
|
||||
$file_path = BSF_AIOSRS_PRO_DIR . 'wpsp-config/controls/WPSPIcon.json';
|
||||
|
||||
// Check if the file exists before attempting to read it.
|
||||
if ( file_exists( $file_path ) ) {
|
||||
$file_content = file_get_contents( $file_path );
|
||||
|
||||
// Check if file_get_contents was successful.
|
||||
if ( $file_content !== false ) {
|
||||
// Parse JSON content.
|
||||
return json_decode( $file_content, true );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Prepare if class 'BSF_SP_Init_Blocks' exist.
|
||||
* Kicking this off by calling 'get_instance()' method
|
||||
*/
|
||||
BSF_SP_Init_Blocks::get_instance();
|
||||
|
||||
Reference in New Issue
Block a user