diff --git a/.DS_Store b/.DS_Store index 4d59e6f1..37ea5456 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/assets/css/scss/_additional.scss b/assets/css/scss/_additional.scss new file mode 100644 index 00000000..41c476ad --- /dev/null +++ b/assets/css/scss/_additional.scss @@ -0,0 +1,261 @@ +/* Additional information specific styles */ +/* Fast Facts Wrapper */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:first-child { + display: flex; + align-items: flex-start; + /* Align content in this group to the top */ + gap: 5px; + /* Space between icon and text */ + flex-shrink: 0; + /* Prevent group from shrinking */ +} +/* Style the image icon */ +.fast-facts-wrapper > .wp-block-group .wp-block-image img { + width: 20px; + /* Fixed width */ + height: 20px; + /* Fixed height */ + display: flex; + object-fit: contain; + /* Ensure image doesn't stretch or distort */ +} +/* Styling for the label (e.g., "Special Interests:") */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:first-child p { + margin: 0; + white-space: nowrap; + /* Prevent wrapping for label */ + vertical-align: middle; + /* Align text with the middle of the icon */ + line-height: 1.2; + /* Improve readability */ + display: inline-block; + /* Keep text inline */ +} +/* Styling for the flowing text */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child { + display: flex; + flex-wrap: nowrap; + /* Keep the text flowing inline */ + white-space: normal; + /* Allow wrapping for text if it overflows */ + overflow-wrap: break-word; + /* Ensure long words wrap correctly */ + word-break: break-word; + /* Break long words when needed */ + flex: 1; + /* Allow the container to use available space */ + align-items: flex-start; + /* Ensure text starts at the top */ +} +/* Specific styling for the text content */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child p { + white-space: normal; + /* Allow wrapping for long text */ + overflow-wrap: break-word; + /* Break words when needed */ + word-break: break-word; + /* Break words on legacy browsers */ + line-height: 1.4; + /* Improve readability */ + text-transform: capitalize; + /* Capitalize text */ + padding: 0; + /* Ensure no unnecessary padding */ + margin: 0; + /* Remove extra margins */ + display: inline; + /* Ensure the text flows inline with the label */ +} +/* Facilities List */ +.facilities-list li::marker { + display: none; +} +.facilities-list { + padding-left: 0 !important; +} +.facilities-list li { + margin-left: 10px; + list-style: none; + /* Remove default list marker */ + position: relative; + /* Position for pseudo-element */ +} +.facilities-list li::before { + content: ''; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + /* Center the icon vertically */ + width: 20px; + /* Adjust the size of the tick icon */ + height: 20px; + background-image: url('../img/tick.svg'); + /* Replace with the path to your tick.svg */ + background-size: contain; + background-repeat: no-repeat; + left: -28px; +} +/* Additional Info */ +.additional-info .wp-block-group.content .read-more-btn,.additional-info .wp-block-group.content .read-less-btn { + color: #0073aa; + cursor: pointer; + font-weight: bold; +} +.additional-info .wp-block-group.content .read-more-btn:hover { + text-decoration: underline; +} +.additional-info .wp-block-group.content .read-less-btn { + display: none; +} +/* FacetWP --------------------------------------------- */ +.facetwp-facet input.facetwp-search{ + border: 1px solid #757575; + padding: 8px 14px 10px; + font-size: 18px; + min-width: 85%; +} +.facetwp-icon{ + background:#a29f9f; + padding:0 4px; +} +.facetwp-icon:hover{ + background-color: #4F4F4F; +} +.facetwp-facet select{ + -webkit-appearance: none; + -moz-appearance: none; + background: transparent; + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position-x: 100%; + background-position-y: 5px; + border-radius: 4px; + color: var(--wp--preset--color--contrast); + font-family: var(--wp--preset--font-family--primary); + font-size: var(--wp--preset--font-size--x-small); + font-weight: var(--wp--custom--font-weight--regular); + padding: 12px 22px 12px 12px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + position: relative; + background-color: #fff; + border: 1px solid #757575!important; + cursor: default; +} +body .fs-label-wrap .fs-label{ + padding: 12px 22px 12px 12px!important; +} +body .fs-arrow{ + right:12px!important; +} +.archive .fs-label-wrap{ + border: 1px solid #757575!important; + border-radius: 4px; +} +.fs-wrap .fs-search input::placeholder { + font-size: var(--wp--preset--font-size--x-small); +} +.facetwp-selections{ + max-width:27%; +} +.facet-row .wp-block-group{ + width:100%; +} +button.facetwp-reset{ + background-color: var(--wp--preset--color--primary); + border-width: 0; + color: var(--wp--preset--color--base); + font-family: inherit; + font-size: var(--wp--preset--font-size--x-small); + font-weight: 500; + line-height: inherit; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; + padding-top: 9px; + padding-right: 8px; + padding-bottom: 10px; + padding-left: 8px; + text-decoration: none; + width:150px; + border-radius: 4px; +} +@media only screen and (min-width:1240px){ + body .facetwp-facet .facetwp-dropdown,body .facetwp-facet .facetwp-checkboxes,body .facetwp-facet .facetwp-range,body .facetwp-facet .facetwp-radio { + min-width: 220px; + /* Adjust this value as needed */ + } + .archive .facetwp-facet{ + margin-top:4px!important; + } + .archive .facetwp-type-reset{ + margin-top:-2px!important; + } + .archive .fs-wrap { + width: 292px; + } +} +@media only screen and (min-width:768px) and (max-width:1199px){ + .archive .fs-wrap { + width: auto!important; + } + body .facetwp-facet .facetwp-dropdown,body .facetwp-facet .facetwp-checkboxes,body .facetwp-facet .facetwp-range,body .facetwp-facet .facetwp-radio { + min-width: 220px; + /* Adjust this value as needed */ + } +} +@media only screen and (max-width:480px){ + .facet-row .wp-block-group{ + flex-wrap: wrap!important; + } + .facet-row .wp-block-group p{ + width:100%!important; + } + .facet-row .wp-block-group .facetwp-facet{ + width:100%!important; + } + body .facetwp-facet .facetwp-dropdown,body .facetwp-facet .facetwp-checkboxes,body .facetwp-facet .facetwp-range,body .facetwp-facet .facetwp-radio { + min-width: 100%!important; + /* Adjust this value as needed */ + } + .facet-row{ + flex-wrap: wrap!important; + margin-left: -20px !important; + margin-right: -20px !important; + } + .facetwp-selections{ + max-width:100%!important; + } + .facetwp-input-wrap,.fs-wrap{ + width:100%!important; + } + .facetwp-facet input.facetwp-search{ + min-width: 88%!important; + } + .facetwp-selections ul li{ + margin-left:0!important; + } + button.facetwp-reset{ + background-color: var(--wp--preset--color--primary); + border-width: 0; + color: var(--wp--preset--color--base); + font-family: inherit; + font-size: var(--wp--preset--font-size--x-small); + font-weight: 500; + line-height: inherit; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; + padding-top: 7px; + padding-right: 8px; + padding-bottom: 7px; + padding-left: 8px; + text-decoration: none; + width:100%; + border-radius: 4px; + } +} diff --git a/assets/css/scss/_collapse.scss b/assets/css/scss/_collapse.scss new file mode 100644 index 00000000..df47103b --- /dev/null +++ b/assets/css/scss/_collapse.scss @@ -0,0 +1,48 @@ +@media (min-width: 800px) { + .single-tour-operator .toggle-button {display:none;} +} + +/* Optional: Responsive adjustments for smaller screens */ +@media (max-width: 768px) { + + .single-tour-operator { + /* Styling for the toggle button */ + .toggle-button { + display: inline-flex; + align-items: center; + padding: 5px; + background: none; + border: none; + cursor: pointer; + font-size: 14px; + color: var(--wp--preset--color--contrast); + } + + /* Styling for the SVG icons */ + .toggle-icon { + width: 16px; + height: 16px; + fill: var(--wp--preset--color--contrast); + margin-left: 5px; + } + + /* Collapsed state for the second wp-block-group */ + section { + &.wp-block-group, + &.wp-block-cover { + .wp-block-group.collapsed { + display: none; /* Hide the content */ + } + } + } + } + + .fast-facts-wrapper > .wp-block-group { + flex-wrap: wrap; /* Allow wrapping for better readability */ + gap: 5px; + } + + .fast-facts-wrapper > .wp-block-group .wp-block-group.is-layout-flex:last-child { + flex-wrap: wrap; /* Allow text to wrap on smaller screens */ + } +} diff --git a/assets/css/scss/_icons.scss b/assets/css/scss/_icons.scss index 68b0334b..a17fa85d 100644 --- a/assets/css/scss/_icons.scss +++ b/assets/css/scss/_icons.scss @@ -119,15 +119,16 @@ .lsx-price-wrapper, .lsx-single-supplement-wrapper, .unit-price-wrapper { - /*&:before { - background-image: url( ../img/icons/price-icon.png ); - }*/ & .amount { @extend %currency-icons; + .strike { + text-decoration: line-through; + } + .currency-icon { - &:after { margin-right: 0px; } + &:after { margin-right: 0px;margin-left: 0px; } } } } diff --git a/assets/css/scss/_slider.scss b/assets/css/scss/_slider.scss index c8f98a3c..260aaff3 100644 --- a/assets/css/scss/_slider.scss +++ b/assets/css/scss/_slider.scss @@ -1,112 +1,235 @@ -.slick-lightbox-close { - right: 32px; - top: 32px; -} +.lsx-to-slider { + &.lsx-travel-information-wrapper { + .slick-list { + max-width: 100% !important; + width: 100% !important; + } + + .slick-slide { + padding: 0 !important; + margin: 0 10px !important; + } + } + } +.wp-block-query, +.lsx-travel-information-wrapper { + &.lsx-to-slider { + gap: var(--wp--preset--spacing--small) var(--wp--preset--spacing--small); + position: relative; + .slick-arrow { + cursor: pointer; + border-color: #000 !important; + height: 30px; + width: 30px; -.lsx-to-slider, -.slick-lightbox-inner { - .slick-arrow { - background: transparent; - border-radius: 50%; - border-style: solid; - border-width: 2px; - font: 0/0 a; - height: 4rem; - margin-top: calc((2.25rem - 17px) / 2); - padding: 0; - text-shadow: none; - transform: translateY(-50%); - transition: border 300ms ease; - width: 4rem; - z-index: 3; - - &:before { - display: block; - font-family: 'FontAwesome'; - font-size: 3rem; - line-height: 1; - position: absolute; - text-rendering: auto; - top: 47%; - transform: translateY(-50%); - transition: color 300ms ease; - - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } - - &.slick-disabled { cursor: not-allowed; } - - &.slick-prev { &:before { - content: '\f104'; - left: 1.1rem; + border-color: #000 !important; + height: 30px; + width: 30px; } - } - &.slick-next { - &:before { - content: '\f105'; - left: 1.5rem; + &.slick-prev:before { + background: url('../img/left-arrow-dark.svg') no-repeat center center; + width: 20px; + left: 3px; + height: 20px; + } + + &.slick-next:before { + background: url('../img/right-arrow-dark.svg') no-repeat center center; + width: 20px; + left: 3px; + height: 20px; } } } } -.lsx-to-slider { - .slick-dots:not(.dropdown-menu) { - align-items: center; - display: flex; - flex-flow: row wrap; - height: auto; - justify-content: center; - list-style: none; - margin: 2rem 0 0; - padding: 0; - - & > li { - line-height: 1; - padding: 5px; - - & > button { - background: transparent; - border-style: solid; - border-width: 1px; - font: 0/0 a; - height: 12px; - transition: all 300ms ease-in-out; - width: 4rem; - } +.wp-block-query { + &.lsx-to-slider { + .slick-slide { + padding: 15px !important; } } +} - .slick-arrow { - &.slick-prev { left: -4rem; } - &.slick-next { right: -4rem; } +.slick-lightbox-close { + right: 52px; + top: 35px; + + &:before { + font-size: 40px; + } +} + +.lsx-to-slider, +.slick-lightbox-inner { + .slick-arrow { + background: transparent; + border-radius: 50%; + position: absolute; + top: 50%; + border-style: solid; + border-color: #fff; + border-width: 2px; + font: 0/0 a; + height: 4rem; + margin-top: calc((2.25rem - 17px) / 2); + padding: 0; + text-shadow: none; + transform: translateY(-50%); + transition: border 300ms ease; + width: 4rem; + z-index: 3; + color: white; + + &:before { + display: block; + font-family: "slick"; + color: white; + font-size: 3rem; + line-height: 1; + position: absolute; + text-rendering: auto; + top: 47%; + transform: translateY(-50%); + transition: color 300ms ease; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } + &.slick-prev:before { + background: url('../img/left-arrow.svg') no-repeat center center; + width: 20px; + left: 3px; + height: 20px; + } + + &.slick-next:before { + background: url('../img/right-arrow.svg') no-repeat center center; + width: 20px; + left: 3px; + height: 20px; + } + } } -.lsx-to-slider { - &.slider-disabled { overflow: hidden; } +.slick-prev svg, +.slick-next svg { + color: white; } +.lsx-to-slider, .slick-lightbox-inner { + .slick-arrow { + &.slick-disabled { + cursor: not-allowed; + } + + &.slick-prev { + &:before { + content: ''; /* Remove font icon */ + width: 40px; + height: 40px; + display: inline-block; + left: 8px; + } + } + + &.slick-next { + &:before { + content: ''; /* Remove font icon */ + width: 40px; + height: 40px; + display: inline-block; + left: 12px; + } + } + } +} + +.lsx-to-slider { + .slick-dots:not(.dropdown-menu) { + align-items: center; + display: flex; + flex-flow: row wrap; + height: auto; + justify-content: center; + list-style: none; + margin: 1rem 0 0; + padding: 0; + + > li { + line-height: 1; + padding: 5px; + margin-left:15px; + + &.slick-active > button { + background: #000; // Active state color + } + + > button { + background: transparent; + border-style: solid; + border-width: 1px; + font: 0/0 a; + height: 12px; + border-radius:50%; + transition: all 300ms ease-in-out; + width: 12px; + + } + } + } + .slick-arrow { - opacity: .75; + &.slick-prev { + left: -4rem; + } + + &.slick-next { + right: -4rem; + } + } + + &.slider-disabled { + overflow: hidden; + } + + .slick-slide { + .lazy-hidden { + max-height: 154px; + } + } +} - &:hover { opacity: 1; } +.slick-lightbox-inner { + .slick-arrow { + opacity: 0.75; + + &:hover { + opacity: 1; + } } } -.slick-lightbox-slick-caption { display: inline-block; } +.slick-lightbox-slick-caption { + display: inline-block; +} -.lsx-to-slider, .lsx-post-carousel-items { .slick-slide { .lazy-hidden { max-height: 154px; } } -} \ No newline at end of file +} + +.lsx-itinerary-wrapper, +.lsx-units-wrapper { + .hidden { + display: none; + } +} + \ No newline at end of file diff --git a/assets/css/scss/_update-fixes.scss b/assets/css/scss/_update-fixes.scss deleted file mode 100644 index 818d46b0..00000000 --- a/assets/css/scss/_update-fixes.scss +++ /dev/null @@ -1,4 +0,0 @@ -/* WP 6.3 Fixes */ -.single-lsx-to-special #posts .lsx-to-widget-content .moretag { - margin-top: 2.4rem; -} diff --git a/assets/css/scss/layout/_single-sections.scss b/assets/css/scss/layout/_single-sections.scss deleted file mode 100644 index 8fd8f688..00000000 --- a/assets/css/scss/layout/_single-sections.scss +++ /dev/null @@ -1,605 +0,0 @@ -.lsx-to-section { - margin: 0 -9999rem; - padding: $lsx-to-gap-large 9999rem; - - &#activity-map, - &#special-map, - &#accommodation-map, - &#destination-map, - &#tour-map { - margin: 0 0 0 calc(-50vw + 50%); - padding: 0; - width: 100vw; - } - - .archive & { - &#destination-map { - margin-top: $lsx-to-gap-large; - margin-left: calc(-100vw / 2 + 500px / 2); - margin-right: calc(-100vw / 2 + 500px / 2); - .lsx-map-preview { - text-align: center; - } - .lsx-map-placeholder { - width: initial; - } - } - } - - .site-main > & { - &:first-of-type { padding-top: 0; } - } - - .lsx-to-section { padding-bottom: 0; } - - &.lsx-to-collapse-section { - @include media('=desktop') { display: block; } - } - } -} - -.to-facts-wrapper { - @include media('>=tablet') { - max-width: 420px; - margin: 0 auto; - float: right; - } -} - -.lsx-to-section-inner { - margin-top: $lsx-to-gap; - padding: $lsx-to-gap-half; - - #fast-facts & { - @include media('>=tablet') { margin-top: 0; } - } - - .entry-content & { - @include media('>=phone') { margin-top: 0; } - } - - #highlights & { - #fast-facts + & { - margin-top: 0; - padding-top: 0; - } - - @include media('>=tablet') { margin-top: 0; } - } - - & + #sharing { margin-top: $lsx-to-gap; } -} - -#fast-facts { - &.full-fact { - display: block !important; - } -} - -.lsx-to-section-title { - & + .lsx-to-archive-items, - & + .lsx-to-widget-items { - margin-top: -1 * $lsx-to-gap-half; - } - - & + .envira-gallery-wrap { margin-top: $lsx-to-gap; } - - &.lsx-to-collapse-title { - @include media(' p { - margin-bottom: $lsx-to-gap-half; - text-align: center; - - @include media('>=phone') { - margin-bottom: 0; - text-align: left; - } - } - } -} - -.lsx-to-more-link, -.single-tour-operator .wp-block-read-more { - &:after { - color: inherit; - content: '\f178'; - display: inline-block; - font-family: 'FontAwesome'; - font-size: inherit; - margin-left: 5px; - text-rendering: auto; - - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } -} - -.lsx-to-summary { - margin-bottom: $lsx-to-gap-half; - - @include media ('>=tablet') { - align-items: center; - display: flex; - flex-flow: row nowrap; - justify-content: space-between; - - .lsx-to-summary-title { margin-bottom: 0; } - } -} - -#included-excluded, -#highlights { - .entry-content { - ul { - list-style: none; - margin-bottom: 0; - padding-left: 20px; - - li { - position: relative; - - & + li { margin-top: 1.2rem; } - - & > ul { - margin-top: 1.2rem; - padding-left: 40px; - } - - &:before { - color: inherit; - content: '\f058'; - display: inline-block; - font-family: 'FontAwesome'; - font-size: 16px; - position: absolute; - left: -20px; - text-rendering: auto; - - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - } - } - } - } - - .not-included { - .entry-content { - ul { - li { - &:before { content: '\f057'; } - } - } - } - } -} - -#when-to-go { - .lsx-to-month { - border-style: solid; - border-width: 1px; - border-top: 0 none; - border-right: 0 none; - height: 90px; - overflow: hidden; - padding: 0; - position: relative; - text-align: center; - - &:nth-child(6), - &:last-child { - border-right-style: solid; - border-right-width: 1px; - - } - - @include media('>=phone') { - &:nth-child(6) { border-right: 0 none; } - } - - & > small { - display: block; - font-weight: 700; - line-height: 40px; - text-transform: uppercase; - } - - & > .fa { - font-size: 18px; - left: 50%; - margin-top: 20px; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); - } - } -} - -#keynotes { padding-top: 0; } - -// #highlights { -// @include media('=phone') { - align-items: flex-start; - display: flex; - flex-flow: row wrap; - justify-content: center; - } -} - -.facilities-content { - margin-top: $lsx-to-gap; - - .facilities-list:not(.dropdown-menu) { - align-items: flex-start; - display: flex; - flex-flow: row wrap; - justify-content: flex-start; - list-style: none; - margin-bottom: 0; - padding-left: 0; - } -} - -.facilities-title { - border-bottom-style: solid; - border-bottom-width: 1px; - padding-bottom: 1.2rem; -} - -.facility-item { - display: inline-block; - font-size: 13px; - padding-right: 15px; - position: relative; - width: 100%; - - @include media('>=tablet') { width: 33.33333%; } -} - -.travel-info-wrapper { - margin-top: -1 * $lsx-to-gap-half; - - @include media('>=phone') { - align-items: flex-start; - display: flex; - flex-flow: row wrap; - justify-content: flex-start; - } -} - -.travel-info-content { - margin-top: $lsx-to-gap; - overflow: hidden; - padding: $lsx-to-gap-half $lsx-to-gap-half 0; -} - -.rooms-wrapper { - margin-top: -1 * $lsx-to-gap-half; - - @include media('>=phone') { - align-items: flex-start; - display: flex; - flex-flow: row wrap; - justify-content: flex-start; - } -} - -.rooms-content { - align-items: stretch; - display: flex; - flex-flow: row nowrap; - justify-content: flex-start; - margin-top: $lsx-to-gap; - overflow: hidden; -} - -.rooms-thumbnail-wrap { - flex-shrink: 0; - width: 33.33333%; -} - -.rooms-thumbnail { - background-color: transparent; - background-position: center center; - background-repeat: no-repeat; - background-size: cover; - - // square image - display: block; - height: 0; - overflow: hidden; - // padding: 0 0 65.714285%; // lsx-thumbnail-wide (350x350) - padding: 0 0 100%; // square - position: relative; -} - -.rooms-info { - flex-grow: 1; - padding: $lsx-to-gap-half $lsx-to-gap-half 0; -} - -.lsx-to-team-thumb { - border-radius: 50%; - display: block; - height: 32rem; - margin: 0 auto 20px; - overflow: hidden; - width: 32rem; - - & > img { width: 100%; } -} - -.lsx-to-review-thumb { - border-radius: 50%; - display: block; - height: 17rem; - margin: 0 auto 20px; - overflow: hidden; - width: 17rem; - - & > img { width: 100%; } -} - -.lsx-to-team-socials-header { - display: block; - margin: 0 auto; - padding-bottom: 5px; - position: relative; - text-align: center; - - &:after { - border-bottom: 1px solid; - bottom: 0; - content: ''; - height: 0; - left: 50%; - position: absolute; - transform: translateX(-50%); - width: 80px; - } -} - -.lsx-to-team-socials { - align-items: center; - display: flex; - flex-flow: row nowrap; - justify-content: center; - margin: 2rem 0 0; - padding: 0; - - & > a { - align-items: center; - border-radius: 50%; - display: flex; - height: 30px; - justify-content: center; - margin: 0 10px; - transition: background 300ms ease; - width: 30px; - } -} - -.lsx.single-lsx-to-team { - &:not(.page-has-banner) { - .banner-single { - margin-top: 49px; - .archive-header { - display: none; - } - } - } - .lsx-to-team-name { margin-bottom: 1.2rem; } - - .lsx-to-team-contact:not(.dropdown) { - margin-bottom: 0; - margin-left: 0; - margin-top: $lsx-to-gap; - padding-left: 0; - - & > li { - display: block; - padding-left: 0; - padding-right: 0; - - & + li { margin-top: 1.2rem; } - - @include media('>=tablet') { - display: inline-block; - - & + li { - margin-left: $lsx-to-gap-half; - margin-top: 0; - } - } - - } - - & .fa { - font-size: 22px; - margin-right: 5px; - vertical-align: middle; - } - } -} - -body.single-tour-operator { - #gallery { - .gallery { - margin: 0 auto; - - .gallery-item { - float: left; - margin-top: 0; - text-align: center; - width: 100%; - - @include media('>=phone') { width: 33%; } - } - - &.gallery-columns-2 { - @include media('>=phone') { - .gallery-item { width: 50%; } - - .attachment-medium { - max-width: 92%; - height: auto; - } - } - } - - &.gallery-columns-4 { - @include media('>=phone') { - .gallery-item { width: 25%; } - - .attachment-thumbnail { - max-width: 84%; - height: auto; - } - } - } - - .gallery-icon { border: none; } - - img { - padding: 8px; - - &:hover { background: #FFF; } - } - - .gallery-caption { - font-size: 12px; - margin: 0 0 12px; - } - - dl, dt { margin: 0; } - br + br { display: none; } - - @include media(' .wp-block-group .wp-block-group:first-child { + display: flex; + align-items: flex-start; + /* Align content in this group to the top */ + gap: 5px; + /* Space between icon and text */ + flex-shrink: 0; + /* Prevent group from shrinking */ +} + +/* Style the image icon */ +.fast-facts-wrapper > .wp-block-group .wp-block-image img { + width: 20px; + /* Fixed width */ + height: 20px; + /* Fixed height */ + display: flex; + -o-object-fit: contain; + object-fit: contain; + /* Ensure image doesn't stretch or distort */ +} + +/* Styling for the label (e.g., "Special Interests:") */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:first-child p { + margin: 0; + white-space: nowrap; + /* Prevent wrapping for label */ + vertical-align: middle; + /* Align text with the middle of the icon */ + line-height: 1.2; + /* Improve readability */ + display: inline-block; + /* Keep text inline */ +} + +/* Styling for the flowing text */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child { + display: flex; + flex-wrap: nowrap; + /* Keep the text flowing inline */ + white-space: normal; + /* Allow wrapping for text if it overflows */ + overflow-wrap: break-word; + /* Ensure long words wrap correctly */ + word-break: break-word; + /* Break long words when needed */ + flex: 1; + /* Allow the container to use available space */ + align-items: flex-start; + /* Ensure text starts at the top */ +} + +/* Specific styling for the text content */ +.fast-facts-wrapper > .wp-block-group .wp-block-group:last-child p { + white-space: normal; + /* Allow wrapping for long text */ + overflow-wrap: break-word; + /* Break words when needed */ + word-break: break-word; + /* Break words on legacy browsers */ + line-height: 1.4; + /* Improve readability */ + text-transform: capitalize; + /* Capitalize text */ + padding: 0; + /* Ensure no unnecessary padding */ + margin: 0; + /* Remove extra margins */ + display: inline; + /* Ensure the text flows inline with the label */ +} + +/* Facilities List */ +.facilities-list li::marker { + display: none; +} + +.facilities-list { + padding-left: 0 !important; +} + +.facilities-list li { + margin-left: 10px; + list-style: none; + /* Remove default list marker */ + position: relative; + /* Position for pseudo-element */ +} + +.facilities-list li::before { + content: ""; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + /* Center the icon vertically */ + width: 20px; + /* Adjust the size of the tick icon */ + height: 20px; + background-image: url("../img/tick.svg"); + /* Replace with the path to your tick.svg */ + background-size: contain; + background-repeat: no-repeat; + left: -28px; +} + +/* Additional Info */ +.additional-info .wp-block-group.content .read-more-btn, .additional-info .wp-block-group.content .read-less-btn { + color: #0073aa; + cursor: pointer; + font-weight: bold; +} + +.additional-info .wp-block-group.content .read-more-btn:hover { + text-decoration: underline; +} + +.additional-info .wp-block-group.content .read-less-btn { + display: none; +} + +/* FacetWP --------------------------------------------- */ +.facetwp-facet input.facetwp-search { + border: 1px solid #757575; + padding: 8px 14px 10px; + font-size: 18px; + min-width: 85%; +} + +.facetwp-icon { + background: #a29f9f; + padding: 0 4px; +} + +.facetwp-icon:hover { + background-color: #4F4F4F; +} + +.facetwp-facet select { + -webkit-appearance: none; + -moz-appearance: none; + background: transparent; + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position-x: 100%; + background-position-y: 5px; + border-radius: 4px; + color: var(--wp--preset--color--contrast); + font-family: var(--wp--preset--font-family--primary); + font-size: var(--wp--preset--font-size--x-small); + font-weight: var(--wp--custom--font-weight--regular); + padding: 12px 22px 12px 12px; + text-overflow: ellipsis; + white-space: nowrap; + overflow: hidden; + position: relative; + background-color: #fff; + border: 1px solid #757575 !important; + cursor: default; +} + +body .fs-label-wrap .fs-label { + padding: 12px 22px 12px 12px !important; +} + +body .fs-arrow { + right: 12px !important; +} + +.archive .fs-label-wrap { + border: 1px solid #757575 !important; + border-radius: 4px; +} + +.fs-wrap .fs-search input::-moz-placeholder { + font-size: var(--wp--preset--font-size--x-small); +} + +.fs-wrap .fs-search input::placeholder { + font-size: var(--wp--preset--font-size--x-small); +} + +.facetwp-selections { + max-width: 27%; +} + +.facet-row .wp-block-group { + width: 100%; +} + +button.facetwp-reset { + background-color: var(--wp--preset--color--primary); + border-width: 0; + color: var(--wp--preset--color--base); + font-family: inherit; + font-size: var(--wp--preset--font-size--x-small); + font-weight: 500; + line-height: inherit; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; + padding-top: 9px; + padding-right: 8px; + padding-bottom: 10px; + padding-left: 8px; + text-decoration: none; + width: 150px; + border-radius: 4px; +} + +@media only screen and (min-width: 1240px) { + body .facetwp-facet .facetwp-dropdown, body .facetwp-facet .facetwp-checkboxes, body .facetwp-facet .facetwp-range, body .facetwp-facet .facetwp-radio { + min-width: 220px; + /* Adjust this value as needed */ + } + .archive .facetwp-facet { + margin-top: 4px !important; + } + .archive .facetwp-type-reset { + margin-top: -2px !important; + } + .archive .fs-wrap { + width: 292px; + } +} +@media only screen and (min-width: 768px) and (max-width: 1199px) { + .archive .fs-wrap { + width: auto !important; + } + body .facetwp-facet .facetwp-dropdown, body .facetwp-facet .facetwp-checkboxes, body .facetwp-facet .facetwp-range, body .facetwp-facet .facetwp-radio { + min-width: 220px; + /* Adjust this value as needed */ + } +} +@media only screen and (max-width: 480px) { + .facet-row .wp-block-group { + flex-wrap: wrap !important; + } + .facet-row .wp-block-group p { + width: 100% !important; + } + .facet-row .wp-block-group .facetwp-facet { + width: 100% !important; + } + body .facetwp-facet .facetwp-dropdown, body .facetwp-facet .facetwp-checkboxes, body .facetwp-facet .facetwp-range, body .facetwp-facet .facetwp-radio { + min-width: 100% !important; + /* Adjust this value as needed */ + } + .facet-row { + flex-wrap: wrap !important; + margin-left: -20px !important; + margin-right: -20px !important; + } + .facetwp-selections { + max-width: 100% !important; + } + .facetwp-input-wrap, .fs-wrap { + width: 100% !important; + } + .facetwp-facet input.facetwp-search { + min-width: 88% !important; + } + .facetwp-selections ul li { + margin-left: 0 !important; + } + button.facetwp-reset { + background-color: var(--wp--preset--color--primary); + border-width: 0; + color: var(--wp--preset--color--base); + font-family: inherit; + font-size: var(--wp--preset--font-size--x-small); + font-weight: 500; + line-height: inherit; + margin-top: 0px; + margin-right: 0px; + margin-bottom: 0px; + margin-left: 0px; + padding-top: 7px; + padding-right: 8px; + padding-bottom: 7px; + padding-left: 8px; + text-decoration: none; + width: 100%; + border-radius: 4px; + } +} +.lsx-to-slider.lsx-travel-information-wrapper .slick-list { + max-width: 100% !important; + width: 100% !important; +} +.lsx-to-slider.lsx-travel-information-wrapper .slick-slide { + padding: 0 !important; + margin: 0 10px !important; +} + +.wp-block-query.lsx-to-slider, +.lsx-travel-information-wrapper.lsx-to-slider { + gap: var(--wp--preset--spacing--small) var(--wp--preset--spacing--small); + position: relative; +} +.wp-block-query.lsx-to-slider .slick-arrow, +.lsx-travel-information-wrapper.lsx-to-slider .slick-arrow { + cursor: pointer; + border-color: #000 !important; + height: 30px; + width: 30px; +} +.wp-block-query.lsx-to-slider .slick-arrow:before, +.lsx-travel-information-wrapper.lsx-to-slider .slick-arrow:before { + border-color: #000 !important; + height: 30px; + width: 30px; +} +.wp-block-query.lsx-to-slider .slick-arrow.slick-prev:before, +.lsx-travel-information-wrapper.lsx-to-slider .slick-arrow.slick-prev:before { + background: url("../img/left-arrow-dark.svg") no-repeat center center; + width: 20px; + left: 3px; + height: 20px; +} +.wp-block-query.lsx-to-slider .slick-arrow.slick-next:before, +.lsx-travel-information-wrapper.lsx-to-slider .slick-arrow.slick-next:before { + background: url("../img/right-arrow-dark.svg") no-repeat center center; + width: 20px; + left: 3px; + height: 20px; +} + +.wp-block-query.lsx-to-slider .slick-slide { + padding: 15px !important; } .slick-lightbox-close { - right: 32px; - top: 32px; + right: 52px; + top: 35px; +} +.slick-lightbox-close:before { + font-size: 40px; } .lsx-to-slider .slick-arrow, .slick-lightbox-inner .slick-arrow { background: transparent; border-radius: 50%; + position: absolute; + top: 50%; border-style: solid; + border-color: #fff; border-width: 2px; font: 0/0 a; height: 4rem; @@ -179,11 +519,13 @@ transition: border 300ms ease; width: 4rem; z-index: 3; + color: white; } .lsx-to-slider .slick-arrow:before, .slick-lightbox-inner .slick-arrow:before { display: block; - font-family: "FontAwesome"; + font-family: "slick"; + color: white; font-size: 3rem; line-height: 1; position: absolute; @@ -194,19 +536,45 @@ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } +.lsx-to-slider .slick-arrow.slick-prev:before, +.slick-lightbox-inner .slick-arrow.slick-prev:before { + background: url("../img/left-arrow.svg") no-repeat center center; + width: 20px; + left: 3px; + height: 20px; +} +.lsx-to-slider .slick-arrow.slick-next:before, +.slick-lightbox-inner .slick-arrow.slick-next:before { + background: url("../img/right-arrow.svg") no-repeat center center; + width: 20px; + left: 3px; + height: 20px; +} + +.slick-prev svg, +.slick-next svg { + color: white; +} + .lsx-to-slider .slick-arrow.slick-disabled, .slick-lightbox-inner .slick-arrow.slick-disabled { cursor: not-allowed; } .lsx-to-slider .slick-arrow.slick-prev:before, .slick-lightbox-inner .slick-arrow.slick-prev:before { - content: "\f104"; - left: 1.1rem; + content: ""; /* Remove font icon */ + width: 40px; + height: 40px; + display: inline-block; + left: 10px; } .lsx-to-slider .slick-arrow.slick-next:before, .slick-lightbox-inner .slick-arrow.slick-next:before { - content: "\f105"; - left: 1.5rem; + content: ""; /* Remove font icon */ + width: 40px; + height: 40px; + display: inline-block; + left: 12px; } .lsx-to-slider .slick-dots:not(.dropdown-menu) { @@ -216,21 +584,26 @@ height: auto; justify-content: center; list-style: none; - margin: 2rem 0 0; + margin: 1rem 0 0; padding: 0; } .lsx-to-slider .slick-dots:not(.dropdown-menu) > li { line-height: 1; padding: 5px; + margin-left:15px; } .lsx-to-slider .slick-dots:not(.dropdown-menu) > li > button { background: transparent; - border-style: solid; - border-width: 1px; - font: 0/0 a; - height: 12px; - transition: all 300ms ease-in-out; - width: 4rem; + border-style: solid; + border-width: 1px; + font: 0/0 a; + height: 12px; + border-radius:50%; + transition: all 300ms ease-in-out; + width: 12px; +} +.lsx-to-slider .slick-dots:not(.dropdown-menu) > li.slick-active > button { + background: #000; } .lsx-to-slider .slick-arrow.slick-prev { left: -4rem; @@ -238,10 +611,12 @@ .lsx-to-slider .slick-arrow.slick-next { right: -4rem; } - .lsx-to-slider.slider-disabled { overflow: hidden; } +.lsx-to-slider .slick-slide .lazy-hidden { + max-height: 154px; +} .slick-lightbox-inner .slick-arrow { opacity: 0.75; @@ -254,11 +629,54 @@ display: inline-block; } -.lsx-to-slider .slick-slide .lazy-hidden, .lsx-post-carousel-items .slick-slide .lazy-hidden { max-height: 154px; } +.lsx-itinerary-wrapper .hidden, +.lsx-units-wrapper .hidden { + display: none; +} + +@media (min-width: 800px) { + .single-tour-operator .toggle-button { + display: none; + } +} +/* Optional: Responsive adjustments for smaller screens */ +@media (max-width: 768px) { + .single-tour-operator { + /* Styling for the toggle button */ + /* Styling for the SVG icons */ + /* Collapsed state for the second wp-block-group */ + } + .single-tour-operator .toggle-button { + display: inline-flex; + align-items: center; + padding: 5px; + background: none; + border: none; + cursor: pointer; + font-size: 14px; + color: var(--wp--preset--color--contrast); + } + .single-tour-operator .toggle-icon { + width: 16px; + height: 16px; + fill: var(--wp--preset--color--contrast); + margin-left: 5px; + } + .single-tour-operator section.wp-block-group .wp-block-group.collapsed, .single-tour-operator section.wp-block-cover .wp-block-group.collapsed { + display: none; /* Hide the content */ + } + .fast-facts-wrapper > .wp-block-group { + flex-wrap: wrap; /* Allow wrapping for better readability */ + gap: 5px; + } + .fast-facts-wrapper > .wp-block-group .wp-block-group.is-layout-flex:last-child { + flex-wrap: wrap; /* Allow text to wrap on smaller screens */ + } +} .lsx-itinerary-wrapper .hidden, .lsx-units-wrapper .hidden { display: none; diff --git a/assets/css/style.css.map b/assets/css/style.css.map index d51116f1..fcd375f9 100644 --- a/assets/css/style.css.map +++ b/assets/css/style.css.map @@ -1 +1 @@ -{"version":3,"sources":["style.css","style.scss","scss/_icons.scss","scss/_slider.scss"],"names":[],"mappings":"AAAA,gBAAgB;ACAhB;;EAAA;ACEE;;;EACC,gBAAA;EACA,iBAAA;AFKH;AEKG;;;;;;;;;;;;;;;EAAU,YAAA;AFYb;AERG;;;EAAU,YAAA;AFab;AETG;;;EAAU,YAAA;AFcb;AEVG;;;EAAU,YAAA;AFeb;AEXG;;;EAAU,aAAA;AFgBb;AEZG;;;EAAU,YAAA;AFiBb;AEZG;;;;;EAAU,YAAA;AFmBb;AEfG;;;EAAU,YAAA;AFoBb;AEhBG;;;EAAU,YAAA;AFqBb;AEjBG;;;EAAU,YAAA;AFsBb;AElBG;;;EAAU,YAAA;AFuBb;AEnBG;;;EAAU,YAAA;AFwBb;AEpBG;;;EAAU,aAAA;AFyBb;AErBG;;;EAAU,aAAA;AF0Bb;AEtBG;;;EAAU,aAAA;AF2Bb;AEtBG;;;;;EAAU,aAAA;AF6Bb;AEzBG;;;EAAU,cAAA;AF8Bb;AE1BG;;;EAAU,cAAA;AF+Bb;AE3BG;;;EAAU,cAAA;AFgCb;AE5BG;;;EAAU,cAAA;AFiCb;AE7BG;;;EAAU,aAAA;AFkCb;AE9BG;;;EAAU,aAAA;AFmCb;;AE7BA;;;;;;;;;;EAAA;AAYA;;;EAGC;;IAAA;AFiCD;AEzBG;;;EAAU,iBAAA;AF8Bb;;AG/JA;EACC,WAAA;EACA,SAAA;AHkKD;;AG3JC;;EACC,uBAAA;EACA,kBAAA;EACA,mBAAA;EACA,iBAAA;EACA,WAAA;EACA,YAAA;EACA,sCAAA;EACA,UAAA;EACA,iBAAA;EACA,2BAAA;EACA,6BAAA;EACA,WAAA;EACA,UAAA;AH+JF;AG7JE;;EACC,cAAA;EACA,0BAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,QAAA;EACA,2BAAA;EACA,4BAAA;EAEA,mCAAA;EACA,kCAAA;AH+JH;AG5JE;;EAAmB,mBAAA;AHgKrB;AG7JG;;EACC,gBAAA;EACA,YAAA;AHgKJ;AG3JG;;EACC,gBAAA;EACA,YAAA;AH8JJ;;AGvJC;EACC,mBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;EACA,uBAAA;EACA,gBAAA;EACA,gBAAA;EACA,UAAA;AH0JF;AGxJE;EACC,cAAA;EACA,YAAA;AH0JH;AGxJG;EACC,uBAAA;EACA,mBAAA;EACA,iBAAA;EACA,WAAA;EACA,YAAA;EACA,iCAAA;EACA,WAAA;AH0JJ;AGpJE;EAAe,WAAA;AHuJjB;AGtJE;EAAe,YAAA;AHyJjB;;AGpJC;EAAoB,gBAAA;AHwJrB;;AGpJC;EACC,aAAA;AHuJF;AGrJE;EAAU,UAAA;AHwJZ;;AGpJA;EAAgC,qBAAA;AHwJhC;;AGnJE;;EACC,iBAAA;AHuJH;;ACzPC;;EACC,aAAA;AD6PF","file":"style.css"} \ No newline at end of file +{"version":3,"sources":["style.css","style.scss","scss/_icons.scss","scss/_additional.scss","scss/_slider.scss","scss/_collapse.scss"],"names":[],"mappings":"AAAA,gBAAgB;ACAhB;;EAAA;ACEE;;;EACC,gBAAA;EACA,iBAAA;AFKH;AEKG;;;;;;;;;;;;;;;EAAU,YAAA;AFYb;AERG;;;EAAU,YAAA;AFab;AETG;;;EAAU,YAAA;AFcb;AEVG;;;EAAU,YAAA;AFeb;AEXG;;;EAAU,aAAA;AFgBb;AEZG;;;EAAU,YAAA;AFiBb;AEZG;;;;;EAAU,YAAA;AFmBb;AEfG;;;EAAU,YAAA;AFoBb;AEhBG;;;EAAU,YAAA;AFqBb;AEjBG;;;EAAU,YAAA;AFsBb;AElBG;;;EAAU,YAAA;AFuBb;AEnBG;;;EAAU,YAAA;AFwBb;AEpBG;;;EAAU,aAAA;AFyBb;AErBG;;;EAAU,aAAA;AF0Bb;AEtBG;;;EAAU,aAAA;AF2Bb;AEtBG;;;;;EAAU,aAAA;AF6Bb;AEzBG;;;EAAU,cAAA;AF8Bb;AE1BG;;;EAAU,cAAA;AF+Bb;AE3BG;;;EAAU,cAAA;AFgCb;AE5BG;;;EAAU,cAAA;AFiCb;AE7BG;;;EAAU,aAAA;AFkCb;AE9BG;;;EAAU,aAAA;AFmCb;;AE7BA;;;;;;;;;;EAAA;AAmBE;;;EACC,6BAAA;AF0BH;AEtBG;;;EAAU,iBAAA;EAAkB,gBAAA;AF4B/B;;AG9JA,2CAAA;AACA,uBAAA;AACA;EACC,aAAA;EACA,uBAAA;EACA,2CAAA;EACA,QAAA;EACA,gCAAA;EACA,cAAA;EACA,iCAAA;AHiKD;;AG/JA,yBAAA;AACA;EACC,WAAA;EACA,gBAAA;EACA,YAAA;EACA,iBAAA;EACA,qBAAA;EACA,sBAAA;KAAA,mBAAA;EACA,4CAAA;AHkKD;;AGhKA,uDAAA;AACA;EACC,SAAA;EACA,mBAAA;EACA,+BAAA;EACA,sBAAA;EACA,2CAAA;EACA,gBAAA;EACA,wBAAA;EACA,qBAAA;EACA,qBAAA;AHmKD;;AGjKA,iCAAA;AACA;EACC,aAAA;EACA,iBAAA;EACA,iCAAA;EACA,mBAAA;EACA,4CAAA;EACA,yBAAA;EACA,qCAAA;EACA,sBAAA;EACA,iCAAA;EACA,OAAA;EACA,+CAAA;EACA,uBAAA;EACA,kCAAA;AHoKD;;AGlKA,0CAAA;AACA;EACC,mBAAA;EACA,iCAAA;EACA,yBAAA;EACA,4BAAA;EACA,sBAAA;EACA,mCAAA;EACA,gBAAA;EACA,wBAAA;EACA,0BAAA;EACA,oBAAA;EACA,UAAA;EACA,kCAAA;EACA,SAAA;EACA,yBAAA;EACA,eAAA;EACA,gDAAA;AHqKD;;AGnKA,oBAAA;AACA;EACC,aAAA;AHsKD;;AGpKA;EACC,0BAAA;AHuKD;;AGrKA;EACC,iBAAA;EACA,gBAAA;EACA,+BAAA;EACA,kBAAA;EACA,gCAAA;AHwKD;;AGtKA;EACC,WAAA;EACA,kBAAA;EACA,OAAA;EACA,QAAA;EACA,2BAAA;EACA,+BAAA;EACA,WAAA;EACA,qCAAA;EACA,YAAA;EACA,2CAAA;EACA,2CAAA;EACA,wBAAA;EACA,4BAAA;EACA,WAAA;AHyKD;;AGvKA,oBAAA;AACA;EACC,cAAA;EACA,eAAA;EACA,iBAAA;AH0KD;;AGxKA;EACC,0BAAA;AH2KD;;AGzKA;EACC,aAAA;AH4KD;;AG1KA,0DAAA;AACA;EACC,yBAAA;EACA,sBAAA;EACA,eAAA;EACA,cAAA;AH6KD;;AG3KA;EACC,mBAAA;EACA,cAAA;AH8KD;;AG5KA;EACC,yBAAA;AH+KD;;AG7KA;EACC,wBAAA;EACA,qBAAA;EACA,uBAAA;EACA,sNAAA;EACA,4BAAA;EACA,2BAAA;EACA,0BAAA;EACA,kBAAA;EACA,yCAAA;EACA,oDAAA;EACA,gDAAA;EACA,oDAAA;EACA,4BAAA;EACA,uBAAA;EACA,mBAAA;EACA,gBAAA;EACA,kBAAA;EACA,sBAAA;EACA,oCAAA;EACA,eAAA;AHgLD;;AG9KA;EACC,uCAAA;AHiLD;;AG/KA;EACC,sBAAA;AHkLD;;AGhLA;EACC,oCAAA;EACA,kBAAA;AHmLD;;AGjLA;EACC,gDAAA;AHoLD;;AGrLA;EACC,gDAAA;AHoLD;;AGlLA;EACC,cAAA;AHqLD;;AGnLA;EACC,WAAA;AHsLD;;AGpLA;EACC,mDAAA;EACA,eAAA;EACA,qCAAA;EACA,oBAAA;EACA,gDAAA;EACA,gBAAA;EACA,oBAAA;EACA,eAAA;EACA,iBAAA;EACA,kBAAA;EACA,gBAAA;EACA,gBAAA;EACA,kBAAA;EACA,oBAAA;EACA,iBAAA;EACA,qBAAA;EACA,YAAA;EACA,kBAAA;AHuLD;;AGrLA;EACC;IACC,gBAAA;IACA,gCAAA;EHwLA;EGtLD;IACC,0BAAA;EHwLA;EGtLD;IACC,2BAAA;EHwLA;EGtLD;IACC,YAAA;EHwLA;AACF;AGtLA;EACC;IACC,sBAAA;EHwLA;EGtLD;IACC,gBAAA;IACA,gCAAA;EHwLA;AACF;AGtLA;EACC;IACC,0BAAA;EHwLA;EGtLD;IACC,sBAAA;EHwLA;EGtLD;IACC,sBAAA;EHwLA;EGtLD;IACC,0BAAA;IACA,gCAAA;EHwLA;EGtLD;IACC,0BAAA;IACA,6BAAA;IACA,8BAAA;EHwLA;EGtLD;IACC,0BAAA;EHwLA;EGtLD;IACC,sBAAA;EHwLA;EGtLD;IACC,yBAAA;EHwLA;EGtLD;IACC,yBAAA;EHwLA;EGtLD;IACC,mDAAA;IACA,eAAA;IACA,qCAAA;IACA,oBAAA;IACA,gDAAA;IACA,gBAAA;IACA,oBAAA;IACA,eAAA;IACA,iBAAA;IACA,kBAAA;IACA,gBAAA;IACA,gBAAA;IACA,kBAAA;IACA,mBAAA;IACA,iBAAA;IACA,qBAAA;IACA,WAAA;IACA,kBAAA;EHwLA;AACF;AIzbG;EACD,0BAAA;EACA,sBAAA;AJ2bF;AIxbG;EACD,qBAAA;EACA,yBAAA;AJ0bF;;AInbC;;EACC,wEAAA;EACA,kBAAA;AJubF;AIrbE;;EACC,eAAA;EACA,6BAAA;EACA,YAAA;EACA,WAAA;AJwbH;AItbG;;EACC,6BAAA;EACA,YAAA;EACA,WAAA;AJybJ;AItbG;;EACC,qEAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;AJybJ;AItbG;;EACC,sEAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;AJybJ;;AIjbE;EACC,wBAAA;AJobH;;AI/aA;EACE,WAAA;EACA,SAAA;AJkbF;AIhbE;EACD,eAAA;AJkbD;;AI5aE;;EACD,uBAAA;EACA,kBAAA;EACA,kBAAA;EACA,QAAA;EACA,mBAAA;EACA,kBAAA;EACA,iBAAA;EACA,WAAA;EACA,YAAA;EACA,sCAAA;EACA,UAAA;EACA,iBAAA;EACA,2BAAA;EACA,6BAAA;EACA,WAAA;EACA,UAAA;EACA,YAAA;AJgbD;AI9aC;;EACE,cAAA;EACA,oBAAA;EACA,YAAA;EACA,eAAA;EACA,cAAA;EACA,kBAAA;EACA,oBAAA;EACA,QAAA;EACA,2BAAA;EACA,4BAAA;EACA,mCAAA;EACA,kCAAA;AJibH;AI/aC;;EACC,gEAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;AJkbF;AI/aC;;EACC,iEAAA;EACA,WAAA;EACA,SAAA;EACA,YAAA;AJkbF;;AI7aA;;EAEE,YAAA;AJgbF;;AI1aI;;EACE,mBAAA;AJ8aN;AI1aM;;EACE,WAAA,EAAA,qBAAA;EACA,WAAA;EACA,YAAA;EACA,qBAAA;EACA,UAAA;AJ6aR;AIxaM;;EACE,WAAA,EAAA,qBAAA;EACA,WAAA;EACA,YAAA;EACA,qBAAA;EACA,UAAA;AJ2aR;;AIpaC;EACE,mBAAA;EACA,aAAA;EACA,mBAAA;EACA,YAAA;EACA,uBAAA;EACA,gBAAA;EACA,gBAAA;EACA,UAAA;AJuaH;AIraG;EACD,cAAA;EACA,YAAA;AJuaF;AIraE;EACE,uBAAA;EACA,mBAAA;EACA,iBAAA;EACA,WAAA;EACA,YAAA;EACA,iCAAA;EACA,WAAA;AJuaJ;AIjaG;EACD,WAAA;AJmaF;AIhaG;EACD,YAAA;AJkaF;AI9ZC;EACE,gBAAA;AJgaH;AI5ZG;EACD,iBAAA;AJ8ZF;;AIxZC;EACC,aAAA;AJ2ZF;AIzZE;EACA,UAAA;AJ2ZF;;AItZA;EACC,qBAAA;AJyZD;;AIpZE;EACC,iBAAA;AJuZH;;AIhZC;;EACC,aAAA;AJoZF;;AKpnBA;EACC;IAAsC,aAAA;ELwnBrC;AACF;AKtnBA,yDAAA;AACA;EAEC;IACC,kCAAA;IAYA,8BAAA;IAQA,kDAAA;ELqmBA;EKxnBA;IACC,oBAAA;IACA,mBAAA;IACA,YAAA;IACA,gBAAA;IACA,YAAA;IACA,eAAA;IACA,eAAA;IACA,yCAAA;EL0nBD;EKtnBA;IACC,WAAA;IACA,YAAA;IACA,wCAAA;IACA,gBAAA;ELwnBD;EKjnBE;IACC,aAAA,EAAA,qBAAA;ELmnBH;EK7mBD;IACC,eAAA,EAAA,0CAAA;IACA,QAAA;EL+mBA;EK5mBD;IACC,eAAA,EAAA,0CAAA;EL8mBA;AACF;ACjpBC;;EACC,aAAA;ADopBF","file":"style.css"} \ No newline at end of file diff --git a/assets/css/style.scss b/assets/css/style.scss index 047822cb..62b87d86 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -3,8 +3,9 @@ */ @import 'scss/icons'; +@import 'scss/additional'; @import 'scss/slider'; - +@import 'scss/collapse'; .lsx-itinerary-wrapper, .lsx-units-wrapper { @@ -12,4 +13,3 @@ display: none; } } - \ No newline at end of file diff --git a/assets/img/TO-accommodation-rooms-icon-black-52px.png b/assets/img/TO-accommodation-rooms-icon-black-52px.png new file mode 100644 index 00000000..7a1c58b1 Binary files /dev/null and b/assets/img/TO-accommodation-rooms-icon-black-52px.png differ diff --git a/assets/img/Typeaccommodation-icon.png b/assets/img/Typeaccommodation-icon.png new file mode 100644 index 00000000..e3b4f2ef Binary files /dev/null and b/assets/img/Typeaccommodation-icon.png differ diff --git a/assets/img/Typecalendar-icon.png b/assets/img/Typecalendar-icon.png new file mode 100644 index 00000000..5ad6902d Binary files /dev/null and b/assets/img/Typecalendar-icon.png differ diff --git a/assets/img/Typelocation-icon.png b/assets/img/Typelocation-icon.png new file mode 100644 index 00000000..948e5c7c Binary files /dev/null and b/assets/img/Typelocation-icon.png differ diff --git a/assets/img/Typetours-icon.png b/assets/img/Typetours-icon.png new file mode 100644 index 00000000..3418240e Binary files /dev/null and b/assets/img/Typetours-icon.png differ diff --git a/assets/img/Typetype-icon.png b/assets/img/Typetype-icon.png new file mode 100644 index 00000000..e88da5c9 Binary files /dev/null and b/assets/img/Typetype-icon.png differ diff --git a/assets/img/accommodation-type-TO-icon-black-20px-2.png b/assets/img/accommodation-type-TO-icon-black-20px-2.png new file mode 100644 index 00000000..2c2a1ce4 Binary files /dev/null and b/assets/img/accommodation-type-TO-icon-black-20px-2.png differ diff --git a/assets/img/accommodation-type-TO-icon-black-20px.png b/assets/img/accommodation-type-TO-icon-black-20px.png new file mode 100644 index 00000000..7aa41452 Binary files /dev/null and b/assets/img/accommodation-type-TO-icon-black-20px.png differ diff --git a/assets/img/best-months-to-travel-TO-icon-black-20px-1-1.png b/assets/img/best-months-to-travel-TO-icon-black-20px-1-1.png new file mode 100644 index 00000000..e49b3cf7 Binary files /dev/null and b/assets/img/best-months-to-travel-TO-icon-black-20px-1-1.png differ diff --git a/assets/img/best-months-to-travel-TO-icon-black-20px.png b/assets/img/best-months-to-travel-TO-icon-black-20px.png new file mode 100644 index 00000000..a525f987 Binary files /dev/null and b/assets/img/best-months-to-travel-TO-icon-black-20px.png differ diff --git a/assets/img/icons/destinations-icon.webp b/assets/img/blocks/Typelocation-icon.png similarity index 100% rename from assets/img/icons/destinations-icon.webp rename to assets/img/blocks/Typelocation-icon.png diff --git a/assets/img/blocks/accommodation-rooms-icon.png b/assets/img/blocks/accommodation-rooms-icon.png new file mode 100644 index 00000000..0ce88ae7 Binary files /dev/null and b/assets/img/blocks/accommodation-rooms-icon.png differ diff --git a/assets/img/blocks/accommodation-type.png b/assets/img/blocks/accommodation-type.png new file mode 100644 index 00000000..545786b7 Binary files /dev/null and b/assets/img/blocks/accommodation-type.png differ diff --git a/assets/img/blocks/booking-validity.svg b/assets/img/blocks/booking-validity.svg new file mode 100644 index 00000000..5ed05937 --- /dev/null +++ b/assets/img/blocks/booking-validity.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/blocks/check-in-check-out-time.svg b/assets/img/blocks/check-in-check-out-time.svg new file mode 100644 index 00000000..d708d063 --- /dev/null +++ b/assets/img/blocks/check-in-check-out-time.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/blocks/drinks.png b/assets/img/blocks/drinks.png new file mode 100644 index 00000000..3c9797b2 Binary files /dev/null and b/assets/img/blocks/drinks.png differ diff --git a/assets/img/blocks/duration.png b/assets/img/blocks/duration.png new file mode 100644 index 00000000..90de8e61 Binary files /dev/null and b/assets/img/blocks/duration.png differ diff --git a/assets/img/blocks/friendly-TO-icon.png b/assets/img/blocks/friendly-TO-icon.png new file mode 100644 index 00000000..09f8c7d3 Binary files /dev/null and b/assets/img/blocks/friendly-TO-icon.png differ diff --git a/assets/img/blocks/group-size.svg b/assets/img/blocks/group-size.svg new file mode 100644 index 00000000..127325ca --- /dev/null +++ b/assets/img/blocks/group-size.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/blocks/itinerary-accommodation.png b/assets/img/blocks/itinerary-accommodation.png new file mode 100644 index 00000000..c3b4d650 Binary files /dev/null and b/assets/img/blocks/itinerary-accommodation.png differ diff --git a/assets/img/blocks/location.png b/assets/img/blocks/location.png new file mode 100644 index 00000000..ecb659ca Binary files /dev/null and b/assets/img/blocks/location.png differ diff --git a/assets/img/blocks/map-TO-icon.png b/assets/img/blocks/map-TO-icon.png new file mode 100644 index 00000000..cfd5b5bd Binary files /dev/null and b/assets/img/blocks/map-TO-icon.png differ diff --git a/assets/img/blocks/minimum-child-age-icon.svg b/assets/img/blocks/minimum-child-age-icon.svg new file mode 100644 index 00000000..8a4a5e12 --- /dev/null +++ b/assets/img/blocks/minimum-child-age-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/blocks/placeholder.png b/assets/img/blocks/placeholder.png new file mode 100644 index 00000000..fabf2f75 Binary files /dev/null and b/assets/img/blocks/placeholder.png differ diff --git a/assets/img/blocks/rating-icon-TO.png b/assets/img/blocks/rating-icon-TO.png new file mode 100644 index 00000000..ae095f88 Binary files /dev/null and b/assets/img/blocks/rating-icon-TO.png differ diff --git a/assets/img/blocks/rooms.png b/assets/img/blocks/rooms.png new file mode 100644 index 00000000..1b4f7116 Binary files /dev/null and b/assets/img/blocks/rooms.png differ diff --git a/assets/img/blocks/single-supplement-icon.svg b/assets/img/blocks/single-supplement-icon.svg new file mode 100644 index 00000000..257addba --- /dev/null +++ b/assets/img/blocks/single-supplement-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/blocks/special-interests-icon.svg b/assets/img/blocks/special-interests-icon.svg new file mode 100644 index 00000000..2c4d8676 --- /dev/null +++ b/assets/img/blocks/special-interests-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/blocks/spoken-languages.png b/assets/img/blocks/spoken-languages.png new file mode 100644 index 00000000..3c11ea6b Binary files /dev/null and b/assets/img/blocks/spoken-languages.png differ diff --git a/assets/img/blocks/tour-operator-black.svg b/assets/img/blocks/tour-operator-black.svg new file mode 100644 index 00000000..837c5df4 --- /dev/null +++ b/assets/img/blocks/tour-operator-black.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/img/blocks/tour-operator-white.svg b/assets/img/blocks/tour-operator-white.svg new file mode 100644 index 00000000..0c9f5f25 --- /dev/null +++ b/assets/img/blocks/tour-operator-white.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/assets/img/blocks/travel-styles.png b/assets/img/blocks/travel-styles.png new file mode 100644 index 00000000..3c4f383c Binary files /dev/null and b/assets/img/blocks/travel-styles.png differ diff --git a/assets/img/blocks/unit-price.png b/assets/img/blocks/unit-price.png new file mode 100644 index 00000000..ea208fc4 Binary files /dev/null and b/assets/img/blocks/unit-price.png differ diff --git a/assets/img/blocks/unit-type.png b/assets/img/blocks/unit-type.png new file mode 100644 index 00000000..af10771f Binary files /dev/null and b/assets/img/blocks/unit-type.png differ diff --git a/assets/img/blocks/wetu-map-figme-prototype-image.png b/assets/img/blocks/wetu-map-figme-prototype-image.png new file mode 100644 index 00000000..cef1b012 Binary files /dev/null and b/assets/img/blocks/wetu-map-figme-prototype-image.png differ diff --git a/assets/img/booking-validity-icon-black-52px-1.svg b/assets/img/booking-validity-icon-black-52px-1.svg new file mode 100644 index 00000000..5ed05937 --- /dev/null +++ b/assets/img/booking-validity-icon-black-52px-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/check-in-check-out-time-icon-black-52px-1.svg b/assets/img/check-in-check-out-time-icon-black-52px-1.svg new file mode 100644 index 00000000..d708d063 --- /dev/null +++ b/assets/img/check-in-check-out-time-icon-black-52px-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/dates-travelled-icon-black-20px.png b/assets/img/dates-travelled-icon-black-20px.png new file mode 100644 index 00000000..8c53e3bd Binary files /dev/null and b/assets/img/dates-travelled-icon-black-20px.png differ diff --git a/assets/img/destinations-icon-black-20px.png b/assets/img/destinations-icon-black-20px.png new file mode 100644 index 00000000..85f5aa25 Binary files /dev/null and b/assets/img/destinations-icon-black-20px.png differ diff --git a/assets/img/duration-TO-black-20px-icon.png b/assets/img/duration-TO-black-20px-icon.png new file mode 100644 index 00000000..f3898d78 Binary files /dev/null and b/assets/img/duration-TO-black-20px-icon.png differ diff --git a/assets/img/duration-icon-black-20px.png b/assets/img/duration-icon-black-20px.png new file mode 100644 index 00000000..d0da9d63 Binary files /dev/null and b/assets/img/duration-icon-black-20px.png differ diff --git a/assets/img/friendly-TO-icon-black-20px-1.png b/assets/img/friendly-TO-icon-black-20px-1.png new file mode 100644 index 00000000..04eda5fd Binary files /dev/null and b/assets/img/friendly-TO-icon-black-20px-1.png differ diff --git a/assets/img/from-price-TO-icon-black-20px-1.png b/assets/img/from-price-TO-icon-black-20px-1.png new file mode 100644 index 00000000..84b0123d Binary files /dev/null and b/assets/img/from-price-TO-icon-black-20px-1.png differ diff --git a/assets/img/from-price-TO-icon-black-20px.png b/assets/img/from-price-TO-icon-black-20px.png new file mode 100644 index 00000000..968d537c Binary files /dev/null and b/assets/img/from-price-TO-icon-black-20px.png differ diff --git a/assets/img/group-size-icon-black-52px-1.svg b/assets/img/group-size-icon-black-52px-1.svg new file mode 100644 index 00000000..127325ca --- /dev/null +++ b/assets/img/group-size-icon-black-52px-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/icons/price-icon.png b/assets/img/icons/price-icon.png deleted file mode 100644 index 323ad47b..00000000 Binary files a/assets/img/icons/price-icon.png and /dev/null differ diff --git a/assets/img/image-1.png b/assets/img/image-1.png new file mode 100644 index 00000000..e88da5c9 Binary files /dev/null and b/assets/img/image-1.png differ diff --git a/assets/img/left-arrow-dark.svg b/assets/img/left-arrow-dark.svg new file mode 100644 index 00000000..24b52a97 --- /dev/null +++ b/assets/img/left-arrow-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/left-arrow-new.svg b/assets/img/left-arrow-new.svg new file mode 100644 index 00000000..486ed234 --- /dev/null +++ b/assets/img/left-arrow-new.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/left-arrow.svg b/assets/img/left-arrow.svg new file mode 100644 index 00000000..486ed234 --- /dev/null +++ b/assets/img/left-arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/map-TO-black-20px-icon.png b/assets/img/map-TO-black-20px-icon.png new file mode 100644 index 00000000..c073c18e Binary files /dev/null and b/assets/img/map-TO-black-20px-icon.png differ diff --git a/assets/img/map-TO-icon-black-20px.png b/assets/img/map-TO-icon-black-20px.png new file mode 100644 index 00000000..46e01b2e Binary files /dev/null and b/assets/img/map-TO-icon-black-20px.png differ diff --git a/assets/img/minimum-child-age-icon-black-52px-1.svg b/assets/img/minimum-child-age-icon-black-52px-1.svg new file mode 100644 index 00000000..8a4a5e12 --- /dev/null +++ b/assets/img/minimum-child-age-icon-black-52px-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/placeholders/placeholder-post-750x350 copy.jpg b/assets/img/placeholders/placeholder-post-750x350 copy.jpg deleted file mode 100644 index 6001631c..00000000 Binary files a/assets/img/placeholders/placeholder-post-750x350 copy.jpg and /dev/null differ diff --git a/assets/img/rating-icon-TO-black-20px-1.png b/assets/img/rating-icon-TO-black-20px-1.png new file mode 100644 index 00000000..8355e89f Binary files /dev/null and b/assets/img/rating-icon-TO-black-20px-1.png differ diff --git a/assets/img/review-testominal-quote-mark-TO-tertiary-32px.png b/assets/img/review-testominal-quote-mark-TO-tertiary-32px.png new file mode 100644 index 00000000..52ff4fee Binary files /dev/null and b/assets/img/review-testominal-quote-mark-TO-tertiary-32px.png differ diff --git a/assets/img/right-arrow-dark.svg b/assets/img/right-arrow-dark.svg new file mode 100644 index 00000000..e4eb09b8 --- /dev/null +++ b/assets/img/right-arrow-dark.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/right-arrow.svg b/assets/img/right-arrow.svg new file mode 100644 index 00000000..a362bc51 --- /dev/null +++ b/assets/img/right-arrow.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/single-supplement-icon-black-52px-1.svg b/assets/img/single-supplement-icon-black-52px-1.svg new file mode 100644 index 00000000..257addba --- /dev/null +++ b/assets/img/single-supplement-icon-black-52px-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/special-interests-icon-black-52px-1.svg b/assets/img/special-interests-icon-black-52px-1.svg new file mode 100644 index 00000000..2c4d8676 --- /dev/null +++ b/assets/img/special-interests-icon-black-52px-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/spoken-languages-TO-icon-black-20px-1.png b/assets/img/spoken-languages-TO-icon-black-20px-1.png new file mode 100644 index 00000000..2460aba7 Binary files /dev/null and b/assets/img/spoken-languages-TO-icon-black-20px-1.png differ diff --git a/assets/img/tick.svg b/assets/img/tick.svg new file mode 100644 index 00000000..4f5503de --- /dev/null +++ b/assets/img/tick.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/type-icon-black-20px.png b/assets/img/type-icon-black-20px.png new file mode 100644 index 00000000..019894ba Binary files /dev/null and b/assets/img/type-icon-black-20px.png differ diff --git a/assets/js/blocks/accommodation.js b/assets/js/blocks/accommodation.js index 16f7844c..0048e002 100644 --- a/assets/js/blocks/accommodation.js +++ b/assets/js/blocks/accommodation.js @@ -29,7 +29,8 @@ wp.domReady(() => { bottom: 0 } } - } + }, + tagName: "section" }, innerBlocks: [ ['core/group', @@ -73,21 +74,37 @@ wp.domReady(() => { ] ] ], - [ - "core/paragraph", + ['core/group', { - placeholder: "Replace this with the Rooms block, and select a pattern.", - align: "center", + align: 'wide', + style: { + spacing: { + blockGap: 'var:preset|spacing|small' + } + }, + layout: { + type: 'constrained', + } }, + [ + ["core/paragraph", + { + placeholder: "Replace this with the Rooms block, and select a pattern.", + align: "center", + } + ] + ] ] ], - isDefault: false, + supports: { + renaming: false + } }); wp.blocks.registerBlockVariation("core/group", { name: "lsx-tour-operator/unit-rooms", title: "Rooms", - icon: "admin-multisite", + icon: "admin-home", category: "lsx-tour-operator", attributes: { metadata: { @@ -109,15 +126,17 @@ wp.domReady(() => { slug: 'lsx-tour-operator/room-card' }] ], - isDefault: false, - scope: ["inserter"], parent: ["lsx-tour-operator/units"], // Restricts to "lsx-tour-operator/units" block + supports: { + renaming: false + } }); // Rating Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/rating', title: 'Rating', + icon: "star-empty", category: 'lsx-tour-operator', attributes: { metadata: { @@ -155,7 +174,7 @@ wp.domReady(() => { ['core/image', { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/rating-icon-TO-black-20px-1.png', + url: lsxToEditor.assetsUrl + 'blocks/rating-icon-TO.png', alt: '' }], ['core/paragraph', { @@ -298,13 +317,17 @@ wp.domReady(() => { ] ] ] - ] + ], + supports: { + renaming: false + } }); // Number of Units Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/number-of-rooms', title: 'Number of Rooms', + icon: "admin-multisite", category: 'lsx-tour-operator', attributes: { metadata: { @@ -338,7 +361,7 @@ wp.domReady(() => { ['core/image', { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/TO-accommodation-rooms-icon-black-52px.png', + url: lsxToEditor.assetsUrl + 'blocks/accommodation-rooms-icon.png', alt: '' }], ['core/paragraph', { @@ -384,13 +407,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Check In Time Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/checkin-time', title: 'Check In Time', + icon: "clock", category: 'lsx-tour-operator', attributes: { metadata: { @@ -426,7 +453,7 @@ wp.domReady(() => { width: '20px', sizeSlug: 'large', linkDestination: 'none', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/check-in-check-out-time-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/check-in-check-out-time.svg', alt: '', className: 'wp-image-122720' }], @@ -474,13 +501,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Check Out Time Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/checkout-time', title: 'Check Out Time', + icon: "clock", category: 'lsx-tour-operator', attributes: { metadata: { @@ -516,7 +547,7 @@ wp.domReady(() => { width: '20px', sizeSlug: 'large', linkDestination: 'none', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/check-in-check-out-time-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/check-in-check-out-time.svg', alt: '', className: 'wp-image-122720' }], @@ -564,13 +595,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Minimum Child Age Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/minimum-child-age', title: 'Minimum Child Age', + icon: "id", category: 'lsx-tour-operator', attributes: { metadata: { @@ -606,7 +641,7 @@ wp.domReady(() => { width: '20px', sizeSlug: 'large', linkDestination: 'none', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/minimum-child-age-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/minimum-child-age.svg', alt: '', className: 'wp-image-122719' }], @@ -654,13 +689,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Spoken Languages Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/spoken-languages', title: 'Spoken Languages', + icon: "translation", category: 'lsx-tour-operator', attributes: { metadata: { @@ -693,7 +732,7 @@ wp.domReady(() => { ['core/image', { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/spoken-languages-TO-icon-black-20px-1.png', + url: lsxToEditor.assetsUrl + 'blocks/spoken-languages.png', alt: '' }], ['core/paragraph', { @@ -751,13 +790,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Accommodation Type Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/accommodation-type', title: 'Accommodation Type', + icon: "admin-multisite", category: 'lsx-tour-operator', attributes: { metadata: { @@ -790,7 +833,7 @@ wp.domReady(() => { ['core/image', { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/accommodation-type-TO-icon-black-20px-2.png', + url: lsxToEditor.assetsUrl + 'blocks/accommodation-type.png', alt: '' }], ['core/paragraph', { @@ -838,13 +881,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Suggested Visitor Types (Friendly) Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'llsx-tour-operator/suggested-visitor-types', title: 'Suggested Visitor Types', + icon: "yes-alt", category: 'lsx-tour-operator', attributes: { metadata: { @@ -877,7 +924,7 @@ wp.domReady(() => { ['core/image', { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/friendly-TO-icon-black-20px-1.png', + url: lsxToEditor.assetsUrl + 'blocks/friendly-TO-icon.png', alt: '' }], ['core/paragraph', { @@ -934,13 +981,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Special Interests Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/special-interests', title: 'Special Interests', + icon: "camera", category: 'lsx-tour-operator', attributes: { metadata: { @@ -974,7 +1025,7 @@ wp.domReady(() => { id: 122726, width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/special-interests-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/special-interests-icon.svg', alt: '', linkDestination: 'none' }], @@ -1032,13 +1083,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Facilities Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/facilities', title: 'Facilities', + icon: "food", category: 'lsx-tour-operator', attributes: { metadata: { @@ -1061,7 +1116,8 @@ wp.domReady(() => { }, layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ ['core/group', { @@ -1142,13 +1198,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Location Wrapper (Destination to Accommodation) wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/destination-to-accommodation', title: 'Destination to Accommodation', + icon: "admin-site-alt3", category: 'lsx-tour-operator', attributes: { metadata: { @@ -1185,7 +1245,7 @@ wp.domReady(() => { ['core/image', { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/Typelocation-icon.png', + url: lsxToEditor.assetsUrl + 'blocks/Typelocation-icon.png', alt: '' }], ['core/paragraph', { @@ -1250,6 +1310,9 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); }); \ No newline at end of file diff --git a/assets/js/blocks/destination.js b/assets/js/blocks/destination.js index 6bab1652..fa718b90 100644 --- a/assets/js/blocks/destination.js +++ b/assets/js/blocks/destination.js @@ -3,6 +3,7 @@ wp.domReady(() => { wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/additional-info', title: 'Additional Information', + icon: "info-outline", category: 'lsx-tour-operator', attributes: { metadata: { @@ -143,13 +144,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Electricity Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/electricity', title: 'Electricity', + icon: "admin-plugins", category: 'lsx-tour-operator', attributes: { metadata: { @@ -289,13 +294,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Banking Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/banking', title: 'Banking', + icon: "bank", category: 'lsx-tour-operator', attributes: { metadata: { @@ -453,13 +462,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Cuisine Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/cuisine', title: 'Cuisine', + icon: "food", category: 'lsx-tour-operator', attributes: { metadata: { @@ -599,13 +612,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Climate Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/climate', title: 'Climate', + icon: "cloud", category: 'lsx-tour-operator', attributes: { metadata: { @@ -745,13 +762,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Transport Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/transport', title: 'Transport', + icon: "car", category: 'lsx-tour-operator', attributes: { metadata: { @@ -891,13 +912,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Dress Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/dress', title: 'Dress', + icon: "admin-users", category: 'lsx-tour-operator', attributes: { metadata: { @@ -1037,13 +1062,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Health Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/health', title: 'Health', + icon: "insert", category: 'lsx-tour-operator', attributes: { metadata: { @@ -1183,7 +1212,10 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Travel Information - Safety Wrapper @@ -1191,6 +1223,7 @@ wp.domReady(() => { 'core/group', { name: 'lsx-tour-operator/safety', title: 'Safety', + icon: "shield", category: 'lsx-tour-operator', attributes: { metadata: { @@ -1339,6 +1372,9 @@ wp.domReady(() => { ], ], ], + supports: { + renaming: false + } } ); @@ -1347,6 +1383,7 @@ wp.domReady(() => { 'core/group', { name: 'lsx-tour-operator/visa', title: 'Visa', + icon: "id-alt", category: 'lsx-tour-operator', attributes: { metadata: { @@ -1495,6 +1532,9 @@ wp.domReady(() => { ], ], ], + supports: { + renaming: false + } } ); @@ -1502,6 +1542,8 @@ wp.domReady(() => { wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/facts-regions-wrapper', title: 'Regions List', + icon: "clipboard", + category: 'lsx-tour-operator', attributes: { metadata: { name: 'Regions List' @@ -1611,13 +1653,18 @@ wp.domReady(() => { ] ] ] - ] + ], + supports: { + renaming: false + } }); // Destination - Country List wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/facts-country-wrapper', title: 'Country', + icon: "admin-site-alt", + category: 'lsx-tour-operator', attributes: { metadata: { name: 'Country' @@ -1727,6 +1774,9 @@ wp.domReady(() => { ] ] ] - ] + ], + supports: { + renaming: false + } }); }); \ No newline at end of file diff --git a/assets/js/blocks/general.js b/assets/js/blocks/general.js index b768075c..cbd2b041 100644 --- a/assets/js/blocks/general.js +++ b/assets/js/blocks/general.js @@ -1,9 +1,124 @@ +// metadata.bindings not handle correctly + wp.domReady(() => { + + const svgElement = wp.element.createElement( + 'svg', + { + width: "52", + height: "52", + viewBox: "0 0 52 52", + fill: "none", + xmlns: "http://www.w3.org/2000/svg" + }, + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M25.8848 50.9803C39.6698 50.9803 50.8448 39.8053 50.8448 26.0203C50.8448 12.2353 39.6698 1.0603 25.8848 1.0603C12.0998 1.0603 0.924805 12.2353 0.924805 26.0203C0.924805 39.8053 12.0998 50.9803 25.8848 50.9803ZM25.9956 47.4606C37.8631 47.4606 47.4836 37.8401 47.4836 25.9726C47.4836 14.1051 37.8631 4.4846 25.9956 4.4846C14.1281 4.4846 4.50762 14.1051 4.50762 25.9726C4.50762 37.8401 14.1281 47.4606 25.9956 47.4606Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M24.375 10.2578C24.375 11.0992 25.0571 11.7812 25.8984 11.7812V11.7812C26.7398 11.7812 27.4219 11.0992 27.4219 10.2578V7.21094C27.4219 6.36957 26.7398 5.6875 25.8984 5.6875V5.6875C25.0571 5.6875 24.375 6.36957 24.375 7.21094V10.2578Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M13.4739 16.0447C14.0688 16.6396 15.0334 16.6396 15.6284 16.0447V16.0447C16.2233 15.4497 16.2233 14.4852 15.6284 13.8902L13.4739 11.7358C12.8789 11.1408 11.9144 11.1408 11.3194 11.7358V11.7358C10.7245 12.3307 10.7245 13.2953 11.3194 13.8902L13.4739 16.0447Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M36.4099 13.7583C35.815 14.3532 35.815 15.3178 36.4099 15.9128V15.9128C37.0048 16.5077 37.9694 16.5077 38.5644 15.9128L40.7188 13.7583C41.3138 13.1634 41.3138 12.1988 40.7188 11.6038V11.6038C40.1239 11.0089 39.1593 11.0089 38.5644 11.6038L36.4099 13.7583Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M9.95312 27.625C10.7945 27.625 11.4766 26.9429 11.4766 26.1016V26.1016C11.4766 25.2602 10.7945 24.5781 9.95312 24.5781H6.90625C6.06488 24.5781 5.38281 25.2602 5.38281 26.1016V26.1016C5.38281 26.9429 6.06488 27.625 6.90625 27.625H9.95312Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M44.9922 27.625C45.8336 27.625 46.5156 26.9429 46.5156 26.1016V26.1016C46.5156 25.2602 45.8336 24.5781 44.9922 24.5781H41.9453C41.1039 24.5781 40.4219 25.2602 40.4219 26.1016V26.1016C40.4219 26.9429 41.1039 27.625 41.9453 27.625H44.9922Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M11.9812 39.1257C11.3863 39.7207 11.3863 40.6853 11.9812 41.2802V41.2802C12.5761 41.8751 13.5407 41.8751 14.1357 41.2802L16.2901 39.1257C16.8851 38.5308 16.8851 37.5662 16.2901 36.9713V36.9713C15.6952 36.3763 14.7306 36.3763 14.1357 36.9713L11.9812 39.1257Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M38.2629 40.6555C38.8579 41.2505 39.8225 41.2505 40.4174 40.6555V40.6555C41.0124 40.0606 41.0124 39.096 40.4174 38.5011L38.2629 36.3466C37.668 35.7517 36.7034 35.7517 36.1085 36.3466V36.3466C35.5135 36.9415 35.5135 37.9061 36.1085 38.5011L38.2629 40.6555Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M24.8828 44.7891C24.8828 45.6304 25.5649 46.3125 26.4062 46.3125V46.3125C27.2476 46.3125 27.9297 45.6304 27.9297 44.7891V41.7422C27.9297 40.9008 27.2476 40.2188 26.4062 40.2188V40.2188C25.5649 40.2188 24.8828 40.9008 24.8828 41.7422V44.7891Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M28.6218 22.4428L28.6222 22.4426L28.6192 22.4407C28.3268 22.2199 28.0059 22.0334 27.6627 21.8875L13 13.4062L21.8155 27.8277C21.9285 28.0554 22.0616 28.2716 22.2115 28.4754L22.2174 28.4851L22.2181 28.4844C22.395 28.7237 22.5961 28.9449 22.8177 29.1446C22.9896 29.3271 23.1771 29.4954 23.3782 29.6475L23.3778 29.6477L23.3808 29.6495C23.6732 29.8704 23.9941 30.0569 24.3373 30.2028L39 38.684L30.1845 24.2626C30.0715 24.0349 29.9384 23.8187 29.7885 23.6149L29.7826 23.6052L29.7819 23.6058C29.605 23.3666 29.404 23.1454 29.1824 22.9457C29.0104 22.7632 28.8229 22.5949 28.6218 22.4428ZM24.3781 24.4125C23.9645 24.8126 23.7084 25.3675 23.7084 25.9808C23.7084 27.2003 24.7213 28.1889 25.9709 28.1889C26.5417 28.1889 27.0631 27.9826 27.4612 27.6422C27.8747 27.2421 28.1308 26.6872 28.1308 26.0739C28.1308 24.8544 27.118 23.8658 25.8685 23.8658C25.2976 23.8658 24.7762 24.0721 24.3781 24.4125Z", + fill: "#090909" + }), + wp.element.createElement('path', { + 'fillRule': "evenodd", + 'clipRule': "evenodd", + d: "M43.567 6.91088C43.3913 6.65906 43.2131 6.38092 43.0942 6.09685C42.6699 5.08228 42.7343 3.8416 43.1616 2.84063C43.1926 2.76922 43.2253 2.69875 43.2599 2.62913C43.2943 2.55942 43.3304 2.49059 43.3682 2.42266C43.4061 2.35473 43.4457 2.2878 43.4868 2.2217C43.5022 2.19713 43.5179 2.17271 43.5337 2.14836C43.5603 2.10759 43.5875 2.06721 43.6153 2.0272C43.6597 1.96332 43.7056 1.90064 43.7531 1.83904C43.8006 1.77739 43.8497 1.71711 43.9002 1.65803C43.9506 1.59885 44.0025 1.54098 44.056 1.48448C44.0751 1.46412 44.0945 1.44394 44.114 1.42386C44.1488 1.38829 44.1842 1.35331 44.22 1.31881C44.2761 1.26491 44.3336 1.21248 44.3923 1.16151C44.4509 1.11044 44.5109 1.0609 44.572 1.0129C44.6332 0.964895 44.6955 0.918498 44.7589 0.873496C44.8224 0.82852 44.8869 0.785151 44.9525 0.743478C44.9774 0.727538 45.0026 0.711935 45.0278 0.696495C45.069 0.671458 45.1104 0.646957 45.1523 0.62308C45.2198 0.584621 45.2883 0.547832 45.3578 0.512701C45.4271 0.477645 45.4973 0.444333 45.5684 0.412754C45.6394 0.381174 45.7113 0.351402 45.7838 0.323337C46.9073 -0.107222 48.1988 -0.125455 49.3033 0.375628C50.3912 0.869147 51.2751 1.85395 51.6838 2.97151C51.7096 3.04319 51.7337 3.11557 51.756 3.18855C51.7646 3.2165 51.7728 3.24452 51.7808 3.27261C51.7937 3.31778 51.8059 3.3632 51.8175 3.40885C51.8233 3.43194 51.829 3.45513 51.8345 3.47834C51.8466 3.52931 51.8579 3.58059 51.8682 3.6319C51.8834 3.70667 51.8966 3.78174 51.908 3.8571C51.9133 3.89208 51.9183 3.92719 51.9228 3.96231C51.9281 4.00289 51.9328 4.04346 51.937 4.08414C51.9447 4.15995 51.9506 4.23587 51.9546 4.31202C51.9587 4.38827 51.9609 4.46458 51.9612 4.54083C51.9616 4.61703 51.9601 4.69328 51.9567 4.76949C51.9534 4.84572 51.9482 4.92175 51.9411 4.99766C51.9388 5.02227 51.9363 5.04687 51.9337 5.07146C51.9281 5.12272 51.9216 5.17385 51.9143 5.22486C51.9107 5.25022 51.9068 5.27557 51.9028 5.30091C51.8949 5.35089 51.8861 5.40075 51.8765 5.45047C51.8621 5.52533 51.8458 5.5998 51.8279 5.67399C51.8098 5.74809 51.7899 5.82163 51.7683 5.89482C51.7467 5.96791 51.7232 6.04042 51.6981 6.11245C51.6729 6.18447 51.646 6.25582 51.6174 6.32646C51.5887 6.39709 51.5584 6.46709 51.5264 6.53637C51.0265 7.59911 50.0679 8.49389 48.9549 8.87753C47.5903 9.34807 46.3252 9.05145 45.0645 8.44598C45.0322 8.47617 44.9988 8.50644 44.9648 8.53711L44.9608 8.54076L44.9606 8.54093C44.7379 8.74234 44.4971 8.96006 44.4311 9.25287C44.4995 9.331 44.5707 9.36452 44.6414 9.39777L44.6415 9.39785C44.7261 9.43765 44.8097 9.47702 44.8869 9.59228C44.8499 10.0781 43.9245 10.8797 43.312 11.4103C43.2279 11.4832 43.1497 11.551 43.0805 11.6121C42.6465 11.1226 42.1952 10.6432 41.7265 10.1745C41.2678 9.71577 40.7988 9.27372 40.3203 8.84835C40.4071 8.75939 40.4938 8.67004 40.5806 8.5806L40.5806 8.58059C40.9383 8.21189 41.2975 7.84173 41.67 7.49145C41.6894 7.47332 41.7121 7.45102 41.7373 7.42615C41.8936 7.27233 42.149 7.02091 42.319 7.05068C42.5395 7.08935 42.6356 7.21956 42.7526 7.37811L42.7935 7.43314C43.0228 7.38867 43.2379 7.19892 43.4285 7.03071L43.4295 7.02979C43.4769 6.98793 43.5228 6.94742 43.567 6.91088ZM49.8764 4.49387C49.8764 5.83988 48.7852 6.93104 47.4392 6.93104C46.0932 6.93104 45.002 5.83988 45.002 4.49387C45.002 3.14785 46.0932 2.05669 47.4392 2.05669C48.7852 2.05669 49.8764 3.14785 49.8764 4.49387Z", + fill: "#090909" + }) + ); + + wp.blocks.updateCategory( 'lsx-tour-operator', { + icon: svgElement + } ); + + // Permalink Button Block + wp.blocks.registerBlockVariation('core/button', { + name: 'lsx-tour-operator/permalink-button', + title: 'Permalink', + description: 'Add a button with a link to the current item.', + category: "lsx-tour-operator", + attributes: { + className: 'lsx-to-link permalink', + metadata: { + name: 'Permalink' + }, + style: { + border: { + radius: { + topLeft: '0px 8px 8px 0px', + topRight: '0px 8px 8px 0px', + bottomLeft: '8px', + bottomRight: '8px' + } + } + }, + backgroundColor: 'primary', + width: 100, + text: 'View More', + url: '#permalink', + }, + supports: { + renaming: false + } + }); + // Gallery Block wp.blocks.registerBlockVariation("core/gallery", { name: "lsx-tour-operator/gallery", title: "TO Gallery", - icon: "gallery", + icon: "format-gallery", category: "lsx-tour-operator", attributes: { metadata: { @@ -21,19 +136,22 @@ wp.domReady(() => { [ "core/image", { - href: "https://tour-operator.lsx.design/wp-content/plugins/tour-operator/assets/img/placeholders/placeholder-general-350x350.jpg", + sizeSlug: 'large', + url: lsxToEditor.assetsUrl + "placeholders/placeholder-general-350x350.jpg", } ], [ "core/image", { - href: "https://tour-operator.lsx.design/wp-content/plugins/tour-operator/assets/img/placeholders/placeholder-general-350x350.jpg", + sizeSlug: 'large', + url: lsxToEditor.assetsUrl + "placeholders/placeholder-general-350x350.jpg", } ], [ "core/image", { - href: "https://tour-operator.lsx.design/wp-content/plugins/tour-operator/assets/img/placeholders/placeholder-general-350x350.jpg", + sizeSlug: 'large', + url: lsxToEditor.assetsUrl + "placeholders/placeholder-general-350x350.jpg", } ] ], @@ -45,7 +163,7 @@ wp.domReady(() => { name: "lsx-tour-operator/price", title: "Price", category: 'lsx-tour-operator', - icon: "bank", + icon: 'money-alt', attributes: { metadata: { name: "Price", @@ -103,12 +221,16 @@ wp.domReady(() => { ], ], isDefault: false, + supports: { + renaming: false + } }); // Travel Styles Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/travel-styles', title: 'Travel Styles', + icon: 'airplane', category: 'lsx-tour-operator', attributes: { metadata: { @@ -139,9 +261,9 @@ wp.domReady(() => { }, [ ['core/image', { - width: 20, + width: '20px', sizeSlug: 'large', - url: 'http://localhost:8883/wp-content/themes/lsx-tour-operator/assets/images/Typetype-icon.png', + url: lsxToEditor.assetsUrl + 'blocks/travel-styles.png', alt: '' }], ['core/paragraph', { @@ -207,13 +329,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Best Months to Visit Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/best-time-to-visit', title: 'Best Time to Visit', + icon: 'calendar-alt', category: 'lsx-tour-operator', attributes: { metadata: { @@ -244,9 +370,9 @@ wp.domReady(() => { }, [ ['core/image', { - width: 20, + width: '20px', sizeSlug: 'large', - url: 'http://localhost:8883/wp-content/themes/lsx-tour-operator/assets/images/best-months-to-travel-TO-icon-black-20px-1-1.png', + url: lsxToEditor.homeUrl + 'wp-content/uploads/2024/11/booking-validity-icon-black-52px-1.svg', alt: '' }], ['core/paragraph', { @@ -308,13 +434,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Included Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/included', title: 'Included Items', + icon: 'plus-alt', category: 'lsx-tour-operator', attributes: { metadata: { @@ -355,13 +485,17 @@ wp.domReady(() => { } } }] - ] + ], + supports: { + renaming: false + } }); // Not Included Wrapper wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/not-included', title: 'Excluded Items', + icon: 'dismiss', category: 'lsx-tour-operator', attributes: { metadata: { @@ -402,13 +536,17 @@ wp.domReady(() => { } } }] - ] + ], + supports: { + renaming: false + } }); // View More Button Block wp.blocks.registerBlockVariation('core/button', { name: 'lsx-tour-operator/more-link', title: 'More Button', + icon: 'insert-after', name: 'core/button', category: "lsx-tour-operator", attributes: { @@ -429,6 +567,9 @@ wp.domReady(() => { backgroundColor: 'primary', width: 100, text: 'View More', + }, + supports: { + renaming: false } }); }); diff --git a/assets/js/blocks/onsale-query.js b/assets/js/blocks/onsale-query.js new file mode 100644 index 00000000..e69de29b diff --git a/assets/js/blocks/query-loops.js b/assets/js/blocks/query-loops.js index 5d585f58..34f8e16c 100644 --- a/assets/js/blocks/query-loops.js +++ b/assets/js/blocks/query-loops.js @@ -3,6 +3,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/regions', title: 'Regions', + icon: 'admin-site-alt3', description: 'Display any regions attached to this destination.', category: 'lsx-tour-operator', attributes: { @@ -25,11 +26,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -39,46 +40,55 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Regions' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Regions Query' - }, - query: { - perPage: 8, - postType: 'destination', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-regions-query", - layout: { - type: 'grid', - columnCount: 4 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Regions Query' }, - [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + query: { + perPage: 8, + postType: 'destination', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' + }, [ + [ + 'core/post-template', + { + className: "lsx-regions-query", + layout: { + type: 'grid', + columnCount: 4 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] ] ] - ] + ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // DESTINATION - REGION - RELATED REGIONS wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/related-regions', title: 'Related Regions', + icon: 'admin-site-alt3', description: 'Display any regions from the parent country.', category: 'lsx-tour-operator', attributes: { @@ -101,11 +111,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -115,39 +125,46 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Regions' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Regions Query' - }, - query: { - perPage: 8, - postType: 'destination', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { - className: "lsx-related-regions-query", - layout: { - type: 'grid', - columnCount: 4 - } + metadata: { + name: 'Related Regions Query' + }, + query: { + perPage: 8, + postType: 'destination', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-related-regions-query", + layout: { + type: 'grid', + columnCount: 4 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] + ] ] }); @@ -155,6 +172,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/featured-accommodation', title: 'Featured Accommodation', + icon: 'admin-home', description: 'Displays Accommodation with the Featured tag.', category: 'lsx-tour-operator', attributes: { @@ -177,11 +195,12 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', + { align: 'wide', style: { spacing: { @@ -191,46 +210,56 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Featured Accommodation' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Featured Accommodation Query' - }, - query: { - perPage: 8, - postType: 'accommodation', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-featured-accommodation-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Featured Accommodation Query' + }, + query: { + perPage: 8, + postType: 'accommodation', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-featured-accommodation-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Featured Tours wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/featured-tours', title: 'Featured Tours', + icon: 'palmtree', description: 'Displays Tours with the Featured tag.', category: 'lsx-tour-operator', attributes: { @@ -253,11 +282,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -267,46 +296,56 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Featured Tours' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Featured Tours Query' - }, - query: { - perPage: 8, - postType: 'tour', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-featured-tours-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Featured Tours Query' + }, + query: { + perPage: 8, + postType: 'tour', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-featured-tours-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Featured Destinations wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/featured-destinations', title: 'Featured Destinations', + icon: 'admin-site', description: 'Displays Destinations with Featured tag.', category: 'lsx-tour-operator', attributes: { @@ -329,11 +368,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -343,40 +382,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Featured Destinations' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Featured Destination Query' - }, - query: { - perPage: 8, - postType: 'destination', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-featured-destinations-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Featured Destination Query' + }, + query: { + perPage: 8, + postType: 'destination', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-featured-destinations-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); /** @@ -388,6 +436,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/accommodation-related-tour', title: 'Related Accommodation - Tour', + icon: 'palmtree', description: 'Displays Accommodation related to this Tour via the destinations.', category: 'lsx-tour-operator', attributes: { @@ -410,11 +459,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -424,40 +473,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Accommodation' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Accommodation Query' - }, - query: { - perPage: 8, - postType: 'accommodation', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-accommodation-related-tour-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Accommodation Query' + }, + query: { + perPage: 8, + postType: 'accommodation', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-accommodation-related-tour-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Related Tours - Tour @@ -466,6 +524,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/tour-related-tour', title: 'Related Tours - Tour', + icon: 'palmtree', description: 'Displays tours related to this Tour via the destinations.', category: 'lsx-tour-operator', attributes: { @@ -488,12 +547,12 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { - align: 'wide', + [ 'core/group', { + align: 'wide', style: { spacing: { margin: { top: '0', bottom: '0' }, @@ -502,40 +561,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Tours' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Tours Query' - }, - query: { - perPage: 8, - postType: 'tour', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-tour-related-tour-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Tours Query' + }, + query: { + perPage: 8, + postType: 'tour', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-tour-related-tour-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); @@ -548,6 +616,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/tour-related-accommodation', title: 'Related Tours - Accommodation', + icon: 'admin-home', description: 'Displays Tours related to an Accommodation via the destination.', category: 'lsx-tour-operator', attributes: { @@ -570,11 +639,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -584,40 +653,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Tours' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Tours Query' - }, - query: { - perPage: 8, - postType: 'tour', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-tour-related-accommodation-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Tours Query' + }, + query: { + perPage: 8, + postType: 'tour', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-tour-related-accommodation-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Related Accommodation - Accommodation @@ -626,6 +704,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/accommodation-related-accommodation', title: 'Related Accommodation - Accommodation', + icon: 'admin-home', description: 'Displays other accommodation in the area.', category: 'lsx-tour-operator', attributes: { @@ -648,11 +727,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -662,40 +741,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Accommodation' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Accommodation Query' - }, - query: { - perPage: 8, - postType: 'accommodation', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-accommodation-related-accommodation-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Accommodation Query' + }, + query: { + perPage: 8, + postType: 'accommodation', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-accommodation-related-accommodation-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); /** @@ -708,6 +796,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/accommodation-related-destination', title: 'Related Accommodation - Destination', + icon: 'admin-site', description: 'Displays Accommodation related to a Destination.', category: 'lsx-tour-operator', attributes: { @@ -730,11 +819,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -744,40 +833,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Accommodation' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Accommodation Query' - }, - query: { - perPage: 8, - postType: 'accommodation', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-accommodation-related-destination-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Accommodation Query' + }, + query: { + perPage: 8, + postType: 'accommodation', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-accommodation-related-destination-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Related Tours - Destination @@ -785,6 +883,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/tour-related-destination', title: 'Related Tours - Destinations', + icon: 'admin-site', description: 'Displays Tours related to a Destination.', category: 'lsx-tour-operator', attributes: { @@ -807,11 +906,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -821,40 +920,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Related Tours' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Tours Query' - }, - query: { - perPage: 8, - postType: 'tour', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-tour-related-destination-query", - layout: { - type: 'grid', - columnCount: 3 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Tours Query' + }, + query: { + perPage: 8, + postType: 'tour', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-tour-related-destination-query", + layout: { + type: 'grid', + columnCount: 3 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); /** @@ -866,6 +974,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/review-related-destination', title: 'Related Reviews - Destinations', + icon: 'admin-site', description: 'Displays Reviews related to an Destination.', category: 'lsx-tour-operator', attributes: { @@ -888,11 +997,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -902,40 +1011,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Reviews' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Review Query - Destination' - }, - query: { - perPage: 8, - postType: 'review', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-review-related-destination-query", - layout: { - type: 'grid', - columnCount: 2 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Review Query - Destination' }, - [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + query: { + perPage: 8, + postType: 'review', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' + }, + [ + [ + 'core/post-template', + { + className: "lsx-review-related-destination-query", + layout: { + type: 'grid', + columnCount: 2 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] ] ] - ] + ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Related Reviews - Tours @@ -943,6 +1061,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/review-related-tour', title: 'Related Reviews - Tour', + icon: 'palmtree', description: 'Displays Reviews related to a Tour.', category: 'lsx-tour-operator', attributes: { @@ -965,11 +1084,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -979,40 +1098,49 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Reviews' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Reviews Query - Tour' - }, - query: { - perPage: 8, - postType: 'review', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-review-related-tour-query", - layout: { - type: 'grid', - columnCount: 2 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Reviews Query - Tour' + }, + query: { + perPage: 8, + postType: 'review', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-review-related-tour-query", + layout: { + type: 'grid', + columnCount: 2 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); // Related Reviews - Accommodation @@ -1020,6 +1148,7 @@ wp.domReady( function() { wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/review-related-accommodation', title: 'Related Reviews - Accommodation', + icon: 'admin-home', description: 'Displays Reviews related to an Accommodation.', category: 'lsx-tour-operator', attributes: { @@ -1042,11 +1171,11 @@ wp.domReady( function() { backgroundColor: 'primary-200', layout: { type: 'constrained' - } + }, + tagName: "section" }, innerBlocks: [ - [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, [ - [ 'core/group', { + [ 'core/group', { align: 'wide', style: { spacing: { @@ -1056,39 +1185,48 @@ wp.domReady( function() { } }, layout: { type: 'flex', flexWrap: 'nowrap' } - }, [ + }, + [ [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ], [ 'core/heading', { textAlign: 'center', content: 'Reviews' } ], [ 'core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' } ] - ] ], - [ 'core/query', { - metadata: { - name: 'Related Review Query - Accommodation' - }, - query: { - perPage: 8, - postType: 'review', - order: 'asc', - orderBy: 'date' - }, - align: 'wide' - }, [ - [ - 'core/post-template', - { - className: "lsx-review-related-accommodation-query", - layout: { - type: 'grid', - columnCount: 2 - } + ] + ], + [ 'core/group', { align: 'wide', layout: { type: 'constrained' } }, + [ + [ 'core/query', { + metadata: { + name: 'Related Review Query - Accommodation' + }, + query: { + perPage: 8, + postType: 'review', + order: 'asc', + orderBy: 'date' + }, + align: 'wide' }, [ - [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + [ + 'core/post-template', + { + className: "lsx-review-related-accommodation-query", + layout: { + type: 'grid', + columnCount: 2 + } + }, + [ + [ 'core/pattern', { slug: 'lsx-tour-operator/destination-card' } ] + ] + ] ] ] - ] ] - ]] - ] + ] + ], + supports: { + renaming: false + } }); }); diff --git a/assets/js/blocks/slider-query.js b/assets/js/blocks/slider-query.js index 76bf5ac3..807de78c 100644 --- a/assets/js/blocks/slider-query.js +++ b/assets/js/blocks/slider-query.js @@ -1,53 +1,95 @@ (function (blocks, element, editor, components) { - var el = element.createElement; - var InspectorControls = editor.InspectorControls; - var PanelBody = components.PanelBody; - var CheckboxControl = components.CheckboxControl; - - var withInspectorControls = wp.compose.createHigherOrderComponent(function (BlockEdit) { - return function (props) { - if (props.name !== 'core/query') { - return el(BlockEdit, props); - } - - var hasCustomClass = props.attributes.hasCustomClass || false; - - return el( - element.Fragment, - {}, - el(BlockEdit, props), - el(InspectorControls, {}, - el(PanelBody, { title: 'Slider', initialOpen: true }, - el(CheckboxControl, { - label: 'Enable Slider', - checked: hasCustomClass, - onChange: function (value) { - props.setAttributes({ - hasCustomClass: value - }); - } - }) - ) - ) - ); - }; - }, 'withInspectorControls'); - - wp.hooks.addFilter( - 'editor.BlockEdit', - 'lsx-tour-operator/slider-panel', - withInspectorControls - ); - - wp.hooks.addFilter( - 'blocks.getSaveContent.extraProps', - 'lsx-tour-operator/save-slider-panel', - function (extraProps, blockType, attributes) { - if (blockType.name === 'core/query' && attributes.hasCustomClass) { - extraProps.className = (extraProps.className || '') + ' lsx-to-slider'; - } - return extraProps; - } - ); + var el = element.createElement; + var InspectorControls = editor.InspectorControls; + var PanelBody = components.PanelBody; + var CheckboxControl = components.CheckboxControl; + + var withInspectorControls = wp.compose.createHigherOrderComponent(function (BlockEdit) { + return function (props) { + if (props.name !== 'core/query') { + return el(BlockEdit, props); + } + + var hasCustomClass = props.attributes.hasCustomClass || false; + if ( undefined === props.attributes.hasCustomClass ) { + if ( props.attributes.className && props.attributes.className.includes( 'lsx-to-slider' ) ) { + hasCustomClass = true; + } + } else { + hasCustomClass = props.attributes.hasCustomClass; + } + + var filterByOnsale = props.attributes.filterByOnsale || false; + if ( undefined === props.attributes.filterByOnsale ) { + if ( props.attributes.className && props.attributes.className.includes( 'on-sale' ) ) { + filterByOnsale = true; + } + } else { + filterByOnsale = props.attributes.filterByOnsale; + } + + return el( + element.Fragment, + {}, + el(BlockEdit, props), + el(InspectorControls, {}, + el(PanelBody, { title: 'Tour Operator', initialOpen: true }, + el(CheckboxControl, { + label: 'Enable Slider', + checked: hasCustomClass, + onChange: function (value) { + console.log(value); + props.setAttributes({ + hasCustomClass: value + }); + } + }), + el(CheckboxControl, { + label: 'Filter by On Sale', + checked: filterByOnsale, + onChange: function (value) { + props.setAttributes({ + filterByOnsale: value + }); + } + }) + ) + ) + ); + }; + }, 'withInspectorControls'); + + wp.hooks.addFilter( + 'editor.BlockEdit', + 'lsx-tour-operator/settings-panel', + withInspectorControls + ); + + wp.hooks.addFilter( + 'blocks.getSaveContent.extraProps', + 'lsx-tour-operator/save-settings-panel', + function (extraProps, blockType, attributes) { + if ( blockType.name === 'core/query' ) { + + console.log(attributes.hasCustomClass); + + if ( true === attributes.hasCustomClass ) { + extraProps.className = (extraProps.className || '') + ' lsx-to-slider'; + console.log('adding'); + } else if ( false === attributes.hasCustomClass && extraProps.className ) { + extraProps.className = extraProps.className.replace(/\blsx-to-slider\b\s*/g, '').trim(); + console.log('removing'); + } + + if ( true === attributes.filterByOnsale ) { + extraProps.className = (extraProps.className || '') + ' on-sale'; + } else if ( false === attributes.filterByOnsale && extraProps.className ) { + extraProps.className = extraProps.className.replace(/\bon-sale\b\s*/g, '').trim(); + } + + } + return extraProps; + } + ); })(window.wp.blocks, window.wp.element, window.wp.blockEditor, window.wp.components); diff --git a/assets/js/blocks/tour.js b/assets/js/blocks/tour.js index 5b0c180b..556e4052 100644 --- a/assets/js/blocks/tour.js +++ b/assets/js/blocks/tour.js @@ -4,7 +4,7 @@ wp.domReady(() => { wp.blocks.registerBlockVariation("core/group", { name: "lsx-tour-operator/itinerary", title: "Itinerary", - icon: "list-view", + icon: "clipboard", category: "lsx-tour-operator", attributes: { metadata: { @@ -14,7 +14,8 @@ wp.domReady(() => { layout: { type: "constrained", }, - className: "lsx-itinerary-wrapper" + className: "lsx-itinerary-wrapper", + tagName: "section" }, innerBlocks: [ ['core/group', @@ -66,14 +67,16 @@ wp.domReady(() => { }, ] ], - isDefault: false, + supports: { + renaming: false + } }); // Itinerary Day by Day wp.blocks.registerBlockVariation("core/group", { name: "lsx-tour-operator/day-by-day", title: "Day by day", - icon: "list-view", + icon: "clipboard", category: "lsx-tour-operator", attributes: { metadata: { @@ -94,8 +97,9 @@ wp.domReady(() => { slug: 'lsx-tour-operator/itinerary-list' }] ], - isDefault: false, - scope: ["inserter"], + supports: { + renaming: false + }, parent: ["lsx-tour-operator/itinerary"], // Restricts to "lsx/itinerary" block }); @@ -103,7 +107,7 @@ wp.domReady(() => { wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/wetu-map', title: 'WETU Map', - icon: 'admin-site', + icon: 'admin-site-alt', category: 'lsx-tour-operator', attributes: { metadata: { @@ -148,7 +152,7 @@ wp.domReady(() => { { align: "full", sizeSlug: "large", - url: "https://tour-operator.lsx.design/wp-content/uploads/2024/09/wetu-map-figme-prototype-image.png", + url: lsxToEditor.assetsUrl + "blocks/wetu-map-figme-prototype-image.png", alt: "", } ] @@ -156,13 +160,17 @@ wp.domReady(() => { ] ], isDefault: false, - allowedPostTypes: ['tour'] + allowedPostTypes: ['tour'], + supports: { + renaming: false + } }); // Single Supplement wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/single-supplement-wrapper', title: 'Single Supplement', + icon: 'money-alt', category: 'lsx-tour-operator', attributes: { metadata: { @@ -198,7 +206,7 @@ wp.domReady(() => { width: '20px', sizeSlug: 'large', linkDestination: 'none', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/single-supplement-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/single-supplement-icon.svg', alt: '' }], ['core/paragraph', { @@ -259,13 +267,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Destination to Tour wp.blocks.registerBlockVariation("core/group", { name: "lsx-destination-to-tour", title: "Destination to Tour", + icon: 'location-alt', category: "lsx-tour-operator", attributes: { name: "Destination to Tour", @@ -300,7 +312,7 @@ wp.domReady(() => { { width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/Typelocation-icon.png', + url: lsxToEditor.assetsUrl + 'blocks/Typelocation-icon.png', alt: '' } ], @@ -372,13 +384,17 @@ wp.domReady(() => { ], ] ] - ] + ], + supports: { + renaming: false + } }); // Duration wp.blocks.registerBlockVariation("core/group", { name: "lsx-tour-operator/duration", title: "Duration", + icon: 'clock', category: "lsx-tour-operator", attributes: { metadata: { @@ -414,9 +430,9 @@ wp.domReady(() => { [ "core/image", { - width: 20, + width: '20px', sizeSlug: "large", - url: "https://tour-operator.lsx.design/wp-content/uploads/2024/09/duration-TO-black-20px-icon.png", + url: lsxToEditor.assetsUrl + 'blocks/duration.png', alt: "", }, ], @@ -510,12 +526,16 @@ wp.domReady(() => { ], ], ], + supports: { + renaming: false + } }); // Group Size wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/group-size', title: 'Group Size', + icon: 'groups', category: 'lsx-tour-operator', attributes: { metadata: { @@ -548,10 +568,10 @@ wp.domReady(() => { [ ['core/image', { id: 122731, - width: 20, + width: '20px', sizeSlug: 'large', linkDestination: 'none', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/group-size-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/group-size.svg', alt: '' }], ['core/paragraph', { @@ -611,13 +631,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Booking Validity wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/booking-validity-start', title: 'Booking Validity', + icon: 'calendar', category: 'lsx-tour-operator', attributes: { metadata: { @@ -650,10 +674,10 @@ wp.domReady(() => { [ ['core/image', { id: 122730, - width: 20, + width: '20px', sizeSlug: 'large', linkDestination: 'none', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/11/booking-validity-icon-black-52px-1.svg', + url: lsxToEditor.assetsUrl + 'blocks/booking-validity.svg', alt: '' }], ['core/paragraph', { @@ -747,13 +771,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Departs From wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/departs-from', title: 'Departs From', + icon: 'airplane', category: 'lsx-tour-operator', attributes: { metadata: { @@ -784,9 +812,9 @@ wp.domReady(() => { }, [ ['core/image', { - width: 20, + width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/map-TO-black-20px-icon.png', + url: lsxToEditor.assetsUrl + 'blocks/map-TO-icon.png', alt: '' }], ['core/paragraph', { @@ -850,13 +878,17 @@ wp.domReady(() => { }], ] ] - ] + ], + supports: { + renaming: false + } }); // Ends In wp.blocks.registerBlockVariation('core/group', { name: 'lsx-tour-operator/ends-in', title: 'Ends In', + icon: 'airplane', category: 'lsx-tour-operator', attributes: { metadata: { @@ -887,9 +919,9 @@ wp.domReady(() => { }, [ ['core/image', { - width: 20, + width: '20px', sizeSlug: 'large', - url: 'https://tour-operator.lsx.design/wp-content/uploads/2024/09/map-TO-black-20px-icon.png', + url: lsxToEditor.assetsUrl + 'blocks/map-TO-icon.png', alt: '' }], ['core/paragraph', { @@ -953,13 +985,17 @@ wp.domReady(() => { }] ] ] - ] + ], + supports: { + renaming: false + } }); // Price Included + Excluded wp.blocks.registerBlockVariation( 'core/group', { name: 'lsx-tour-operator/price-include-exclude', title: 'Price Include & Exclude', + icon: 'money-alt', category: 'lsx-tour-operator', attributes: { align: 'wide', @@ -1074,6 +1110,9 @@ wp.domReady(() => { ] ] ] - ] + ], + supports: { + renaming: false + } } ); }); diff --git a/assets/js/src/custom.js b/assets/js/src/custom.js index de2b1c5f..00cae974 100755 --- a/assets/js/src/custom.js +++ b/assets/js/src/custom.js @@ -51,7 +51,8 @@ if ( window.location.hash ) { lsx_to.readMoreText = $(this).contents().filter(function() { return this.nodeType === Node.TEXT_NODE; }).text(); - lsx_to.readMoreSet( $(this), $(this).closest( '.wp-block-group' ).find('.wp-block-post-content') ); + + lsx_to.readMoreSet( $(this), $(this).parent( '.wp-block-group' ).find('.wp-block-post-content') ); } ); $( '.single-tour-operator .wp-block-read-more' ).on( 'click', function( event ) { @@ -59,22 +60,18 @@ if ( window.location.hash ) { $( this ).hide(); if ( $( this ).hasClass( 'less-link' ) ) { - lsx_to.readMoreSet( $(this), $(this).closest( '.wp-block-group' ).find('.wp-block-post-content') ); + lsx_to.readMoreSet( $(this), $(this).parent( '.wp-block-group' ).find('.wp-block-post-content') ); } else { - lsx_to.readMoreOpen( $(this), $(this).closest( '.wp-block-group' ).find('.wp-block-post-content') ); + lsx_to.readMoreOpen( $(this), $(this).parent( '.wp-block-group' ).find('.wp-block-post-content') ); } $( this ).show(); } ); }; - lsx_to.readMoreSet = function( button, contentWrapper ) { - console.log(contentWrapper); - console.log(contentWrapper.length); + lsx_to.readMoreSet = function( button, contentWrapper, limit = 1 ) { if ( 0 < contentWrapper.length ) { if ( 1 < contentWrapper.children().length ) { - - var limit = 1; let counter = 0; contentWrapper.children().each( function() { @@ -118,17 +115,17 @@ if ( window.location.hash ) { $( '.single-tour-operator .additional-info .lsx-to-more-link' ).each( function() { lsx_to.readMoreTIText = $(this).find('a').text(); - lsx_to.readMoreSet( $(this), $(this).closest( '.additional-info' ).find('.content') ); + lsx_to.readMoreSet( $(this).find('a'), $(this).closest( '.additional-info' ).find('.content'), 2 ); } ); $( '.single-tour-operator .additional-info .lsx-to-more-link' ).on( 'click', function( event ) { event.preventDefault(); $( this ).hide(); - if ( $( this ).hasClass( 'less-link' ) ) { - lsx_to.readMoreSet( $(this), $(this).closest( '.additional-info' ).find('.content') ); + if ( $( this ).find('a').hasClass( 'less-link' ) ) { + lsx_to.readMoreSet( $(this).find('a'), $(this).closest( '.additional-info' ).find('.content'), 2 ); } else { - lsx_to.readMoreOpenTI( $(this), $(this).closest( '.additional-info' ).find('.content') ); + lsx_to.readMoreOpen( $(this).find('a'), $(this).closest( '.additional-info' ).find('.content') ); } $( this ).show(); @@ -197,109 +194,111 @@ if ( window.location.hash ) { * @subpackage scripts */ lsx_to.build_slider = function( window_width ) { + // First slider: .lsx-to-slider $( '.lsx-to-slider .wp-block-post-template:not(.slider-disabled)' ).each( function() { - var $this = $( this ), - interval = $this.data( 'interval' ), - currentSettings = $this.data( 'slick' ), - autoplay = false, - autoplay_speed = 0; - + var $this = $( this ); + lsx_to.pre_build_slider( $this ); - - if ( 'undefined' !== typeof interval && 'boolean' !== typeof interval ) { - interval = parseInt( interval ); - - if ( ! isNaN( interval ) ) { - autoplay = true; - autoplay_speed = interval; - } - } - - - let tabletSlidesToShow = lsx_to_params.slickSlider.tablet.slidesToShow; - let tabletSlidesToScroll = lsx_to_params.slickSlider.tablet.slidesToScroll; - - if ( 'undefined' !== typeof currentSettings && 'boolean' !== typeof currentSettings ) { - - // Tablet Settings. - if ( 'undefined' !== typeof currentSettings.tablet ) { - if ( 'undefined' !== typeof currentSettings.tablet.slidesToShow ) { - tabletSlidesToShow = currentSettings.tablet.slidesToShow; - } - if ( 'undefined' !== typeof currentSettings.tablet.slidesToShow ) { - tabletSlidesToScroll = currentSettings.tablet.slidesToScroll; - } - } - } - - if ( 1 < $this.children.length ) { - console.log($this); - + + if ( 1 < $this.children().length ) { $this.slick( { - draggable: lsx_to_params.slickSlider.desktop.draggable, - infinite: lsx_to_params.slickSlider.desktop.infinite, - swipe: lsx_to_params.slickSlider.desktop.swipe, - cssEase: lsx_to_params.slickSlider.desktop.cssEase, - dots: lsx_to_params.slickSlider.desktop.dots, - slidesToShow: lsx_to_params.slickSlider.desktop.slidesToShow, - slidesToScroll: lsx_to_params.slickSlider.desktop.slidesToScroll, - autoplay: autoplay, - autoplaySpeed: autoplay_speed, - appendArrows: $this.parent(), - appendDots: $this.parent(), + draggable: false, + infinite: true, + swipe: false, + dots: false, + slidesToShow: 3, // Show 3 items at a time + slidesToScroll: 1, // Scroll 1 item at a time + autoplay: false, + autoplaySpeed: 0, + appendArrows: $this.parent(), // Ensure arrows are appended correctly + appendDots: $this.parent(), // Append dots in the right container responsive: [ { - breakpoint: lsx_to_params.slickSlider.tablet.breakpoint, + breakpoint: 1228, settings: { - slidesToShow: tabletSlidesToShow, - slidesToScroll: tabletSlidesToScroll, - draggable: lsx_to_params.slickSlider.tablet.draggable, - arrows: lsx_to_params.slickSlider.tablet.arrows, - swipe: lsx_to_params.slickSlider.tablet.swipe, + slidesToShow: 3, + slidesToScroll: 1, + draggable: true, + arrows: false, + swipe: true, + dots: true, } }, { - breakpoint: lsx_to_params.slickSlider.mobile.breakpoint, + breakpoint: 1028, settings: { - slidesToShow: lsx_to_params.slickSlider.mobile.slidesToShow, - slidesToScroll: lsx_to_params.slickSlider.mobile.slidesToScroll, - draggable: lsx_to_params.slickSlider.mobile.draggable, - arrows: lsx_to_params.slickSlider.mobile.arrows, - swipe: lsx_to_params.slickSlider.mobile.swipe + slidesToShow: 2, + slidesToScroll: 1, + draggable: true, + arrows: false, + swipe: true, + dots: true, + } + }, + { + breakpoint: 782, + settings: { + slidesToShow: 1, + slidesToScroll: 1, + draggable: true, + arrows: false, + swipe: true, + dots: true, } } ] } ); } } ); - - if ( window_width < 768 ) { - $( '.gallery' ).not('.slick-initialized').slick( { - slide: 'dl', - arrows: false, - draggable: true, - infinite: true, - swipe: true, - cssEase: 'ease-out', - dots: true, - autoplay: false, - responsive: [ - { - breakpoint: 99999, - settings: 'unslick' - }, - { - breakpoint: 768, - setting: { - slidesToShow: 1, - slidesToScroll: 1 + + // Second slider: .lsx-to-slider.travel-information + $( '.lsx-travel-information-wrapper.lsx-to-slider .travel-information:not(.slider-disabled)' ).each( function() { + var $this = $( this ); + + lsx_to.pre_build_slider( $this ); + + // Ensure the second slider has 4 slides showing + if ( 1 < $this.children().length ) { + $this.slick( { + draggable: false, + infinite: true, + swipe: false, + dots: false, + slidesToShow: 4, // Show 4 items at a time + slidesToScroll: 1, // Scroll 1 item at a time + autoplay: false, + autoplaySpeed: 0, + appendArrows: $this.parent(), // Ensure arrows are appended correctly for this slider + appendDots: $this.parent(), // Append dots in the correct place + responsive: [ + { + breakpoint: 1028, + settings: { + slidesToShow: 3, + slidesToScroll: 1, + draggable: true, + arrows: true, + swipe: true, + dots: true, + } + }, + { + breakpoint: 782, + settings: { + slidesToShow: 1, + slidesToScroll: 1, + draggable: true, + arrows: true, + swipe: true, + dots: true, + } } - } - ] - } ); - } + ] + } ); + } + } ); }; - + /** * Slider Lightbox. * @@ -351,6 +350,7 @@ if ( window.location.hash ) { * @subpackage scripts */ $document.ready( function() { + lsx_to.readMoreText = 'Read more'; lsx_to.set_read_more(); lsx_to.set_read_more_travel_info(); lsx_to.set_read_more_itinerary(); @@ -368,4 +368,89 @@ if ( window.location.hash ) { lsx_to.build_slider_lightbox(); } ); + /*document.addEventListener('DOMContentLoaded', function () { + const paragraphs = document.querySelectorAll('.additional-info .wp-block-group.content p'); + + paragraphs.forEach(function (p) { + const text = p.innerText.trim(); + + if (text.split(' ').length > 30) { // Check if paragraph exceeds 30 words + const fullText = p.innerText.trim(); + const truncatedText = fullText.split(' ').slice(0, 30).join(' ') + '...'; + p.innerHTML = `${truncatedText}`; + + // Create Read More button + const readMoreBtn = document.createElement('span'); + readMoreBtn.textContent = ' Read More'; + readMoreBtn.classList.add('read-more-btn'); + p.appendChild(readMoreBtn); + + // Create Read Less button + const readLessBtn = document.createElement('span'); + readLessBtn.textContent = ' Read Less'; + readLessBtn.classList.add('read-less-btn'); + p.appendChild(readLessBtn); + + // Add functionality to toggle text + readMoreBtn.addEventListener('click', function () { + p.querySelector('.truncated-text').style.display = 'none'; + p.querySelector('.full-text').style.display = 'inline'; + readMoreBtn.style.display = 'none'; + readLessBtn.style.display = 'inline'; + }); + + readLessBtn.addEventListener('click', function () { + p.querySelector('.truncated-text').style.display = 'inline'; + p.querySelector('.full-text').style.display = 'none'; + readMoreBtn.style.display = 'inline'; + readLessBtn.style.display = 'none'; + }); + } + }); + });*/ + + document.addEventListener('DOMContentLoaded', function () { + // Select all sections within `.single-tour-operator` + const sections = document.querySelectorAll('.single-tour-operator section.wp-block-group, .single-tour-operator section.wp-block-cover'); + + sections.forEach(section => { + // Locate the first

within the section + const heading = section.querySelector('h2'); + // Locate the second div with the class wp-block-group + const toggleTarget = section.querySelectorAll('.wp-block-group')[1]; + + if (heading && toggleTarget) { + // Create a toggle button + const toggleButton = document.createElement('button'); + toggleButton.classList.add('toggle-button'); + toggleButton.innerHTML = ` + + + + + `; + + // Insert the button after the heading + heading.insertAdjacentElement('afterend', toggleButton); + + // Add click event listener to toggle visibility of the second wp-block-group + toggleButton.addEventListener('click', function () { + toggleTarget.classList.toggle('collapsed'); // Add or remove the collapsed class + + // Toggle the display of the up/down icons + const iconDown = toggleButton.querySelector('.icon-down'); + const iconUp = toggleButton.querySelector('.icon-up'); + + if (toggleTarget.classList.contains('collapsed')) { + iconDown.style.display = 'none'; + iconUp.style.display = 'inline'; + } else { + iconDown.style.display = 'inline'; + iconUp.style.display = 'none'; + } + }); + } + }); + }); + } )( jQuery, window, document ); diff --git a/includes/classes/admin/class-admin.php b/includes/classes/admin/class-admin.php index 526b7249..ca02c079 100644 --- a/includes/classes/admin/class-admin.php +++ b/includes/classes/admin/class-admin.php @@ -42,6 +42,7 @@ public function allow_svgimg_types( $mimes ) { * feature images */ public function change_attachment_field_button( $html ) { + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['feature_image_text_button'] ) ) { $html = str_replace( 'value="Insert into Post"', sprintf( 'value="%s"', esc_html__( 'Select featured image', 'tour-operator' ) ), $html ); } diff --git a/includes/classes/admin/class-settings.php b/includes/classes/admin/class-settings.php index edf28680..ef908d51 100644 --- a/includes/classes/admin/class-settings.php +++ b/includes/classes/admin/class-settings.php @@ -45,8 +45,10 @@ class Settings { public function __construct() { $this->options = tour_operator()->options; + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['welcome-page'] ) ) { - $display_page = sanitize_text_field( $_GET['welcome-page'] ); + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended + $display_page = sanitize_text_field( wp_unslash( $_GET['welcome-page'] ) ); $display_page = ! empty( $display_page ) ? $display_page : ''; } @@ -479,6 +481,7 @@ public function image_field( $field_id, $args = array(), $post_type = '' ) { $field[] = ''; // Image Previews + // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage $field[] = '
'; // Action Buttons @@ -530,8 +533,9 @@ public function save_settings() { if ( 'post_types' !== $section ) { foreach ( $fields as $key => $field ) { $save = ''; + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_POST[ $key ] ) ) { - $save = $_POST[ $key ]; + $save = sanitize_text_field( wp_unslash( $_POST[ $key ] ) ); } else if ( isset( $field['default'] ) ) { $save = $field['default']; } @@ -551,8 +555,9 @@ public function save_settings() { //Loop through each of the fields in the section. foreach ( $fields as $key => $field ) { $save = ''; + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_POST[ $tab_index . '_' . $key ] ) ) { - $save = $_POST[ $tab_index . '_' . $key ]; + $save = sanitize_text_field( wp_unslash( $_POST[ $tab_index . '_' . $key ] ) ); } else if ( isset( $field['default'] ) ) { $save = $field['default']; } @@ -565,7 +570,8 @@ public function save_settings() { if ( ! empty( $settings_values ) ) { update_option( 'lsx_to_settings', $settings_values ); - wp_safe_redirect( $_POST[ '_wp_http_referer' ] ); + // @phpcs:ignore WordPress.Security + wp_safe_redirect( wp_unslash( $_POST[ '_wp_http_referer' ] ) ); exit; } } diff --git a/includes/classes/blocks/class-bindings.php b/includes/classes/blocks/class-bindings.php index 7b8c5cc5..4387fe4c 100644 --- a/includes/classes/blocks/class-bindings.php +++ b/includes/classes/blocks/class-bindings.php @@ -68,8 +68,14 @@ public function __construct() { add_filter( 'render_block', array( $this, 'render_units_block' ), 10, 3 ); add_filter( 'render_block', array( $this, 'render_gallery_block' ), 10, 3 ); add_filter( 'render_block', array( $this, 'render_map_block' ), 10, 3 ); + add_filter( 'render_block', array( $this, 'render_permalink_block' ), 10, 3 ); } + /** + * Registers the custom block bindings. + * + * @return void + */ public function register_block_bindings() { if ( ! function_exists( 'register_block_bindings_source' ) ) { return; @@ -77,7 +83,7 @@ public function register_block_bindings() { register_block_bindings_source( 'lsx/post-connection', array( - 'label' => __( 'Post Connection', 'lsx-wetu-importer' ), + 'label' => __( 'Post Connection', 'tour-operator' ), 'get_value_callback' => array( $this, 'post_connections_callback' ) ) ); @@ -85,7 +91,7 @@ public function register_block_bindings() { register_block_bindings_source( 'lsx/post-meta', array( - 'label' => __( 'Post Meta', 'lsx-wetu-importer' ), + 'label' => __( 'Post Meta', 'tour-operator' ), 'get_value_callback' => array( $this, 'post_meta_callback' ) ) ); @@ -93,7 +99,7 @@ public function register_block_bindings() { register_block_bindings_source( 'lsx/tour-itinerary', array( - 'label' => __( 'Itinerary', 'lsx-wetu-importer' ), + 'label' => __( 'Itinerary', 'tour-operator' ), 'get_value_callback' => array( $this, 'empty_callback' ) ) ); @@ -101,7 +107,7 @@ public function register_block_bindings() { register_block_bindings_source( 'lsx/accommodation-units', array( - 'label' => __( 'Units', 'lsx-wetu-importer' ), + 'label' => __( 'Units', 'tour-operator' ), 'get_value_callback' => array( $this, 'empty_callback' ) ) ); @@ -109,7 +115,7 @@ public function register_block_bindings() { register_block_bindings_source( 'lsx/gallery', array( - 'label' => __( 'Gallery', 'lsx-wetu-importer' ), + 'label' => __( 'Gallery', 'tour-operator' ), 'get_value_callback' => array( $this, 'empty_callback' ) ) ); @@ -117,12 +123,19 @@ public function register_block_bindings() { register_block_bindings_source( 'lsx/map', array( - 'label' => __( 'Map', 'lsx-wetu-importer' ), + 'label' => __( 'Map', 'tour-operator' ), 'get_value_callback' => array( $this, 'empty_callback' ) ) ); } + /** + * Registers the post connections callback. + * + * @param array $source_args + * @param object $block_instance + * @return string|int|array + */ public function post_connections_callback( $source_args, $block_instance ) { if ( 'core/image' === $block_instance->parsed_block['blockName'] ) { return 'test_image'; @@ -199,6 +212,13 @@ public function post_connections_callback( $source_args, $block_instance ) { } } + /** + * Register our post meta callback. + * + * @param array $source_args + * @param object $block_instance + * @return string|int|array + */ public function post_meta_callback( $source_args, $block_instance ) { if ( 'core/image' === $block_instance->parsed_block['blockName'] ) { return 'test_image'; @@ -408,6 +428,19 @@ public function build_image( $build = '', $classname = 'itinerary-image' ) { return $build; } + /** + * Renders the units block with custom content. + * + * This function processes the block content by checking if it belongs to a specific + * custom block variation and then iteratively builds the units content based on + * predefined fields and templates. It returns the final rendered block content. + * + * @param string $block_content The original content of the block. + * @param array $parsed_block Parsed data for the block, including type and attributes. + * @param object $block_obj Block object instance for the current block being processed. + * + * @return string Returns the modified block content after processing units data. + */ public function render_units_block( $block_content, $parsed_block, $block_obj ) { // Determine if this is the custom block variation. if ( ! isset( $parsed_block['blockName'] ) || ! isset( $parsed_block['attrs'] ) ) { @@ -474,7 +507,7 @@ public function build_unit_field( $build = '', $field = '', $count = 1 ) { switch ( $field ) { case 'title': - $value = strip_tags( $rooms->item_title( '', '', false ) ); + $value = wp_strip_all_tags( $rooms->item_title( '', '', false ) ); $pattern = '/(]*\bclass="[^"]*\bunit-title\b[^"]*"[^>]*>).*?(<\/h[1-6]>)/is'; break; @@ -499,15 +532,21 @@ public function build_unit_field( $build = '', $field = '', $count = 1 ) { break; case 'price': - $value = $rooms->item_price( '', '', false ); + $value = $rooms->item_price( '', '', false ); + $letter_code = ''; if ( is_object( $tour_operator ) && isset( $tour_operator->options['currency'] ) && ! empty( $tour_operator->options['currency'] ) ) { - $currency = $tour_operator->options['currency']; - $currency = '' . $currency . ''; + $letter_code = $tour_operator->options['currency']; + $currency = ''; } $value = $currency . $value; + // Get the currency settings + if ( is_object( $tour_operator ) && ( isset( $tour_operator->options['country_code_disabled'] ) && 0 === intval( $tour_operator->options['country_code_disabled'] ) || ! isset( $tour_operator->options['country_code_disabled'] ) ) ) { + $value = $letter_code . $value; + } + $pattern = '/(]*\bclass="[^"]*\bunit-price\b[^"]*"[^>]*>).*?(<\/p>)/is'; break; @@ -582,6 +621,19 @@ public function empty_callback( $source_args, $block_instance ) { } } + /** + * Renders the gallery block with custom content. + * + * This function processes the block content by checking if it belongs to a specific + * custom block variation and then iteratively builds the gallery content based on + * predefined fields and templates. It returns the final rendered block content. + * + * @param string $block_content The original content of the block. + * @param array $parsed_block Parsed data for the block, including type and attributes. + * @param object $block_obj Block object instance for the current block being processed. + * + * @return string Returns the modified block content after processing gallery data. + */ public function render_gallery_block( $block_content, $parsed_block, $block_obj ) { // Determine if this is the custom block variation. if ( ! isset( $parsed_block['blockName'] ) || ! isset( $parsed_block['attrs'] ) ) { @@ -641,6 +693,7 @@ public function render_gallery_block( $block_content, $parsed_block, $block_obj } $build = '
'; + // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage $build .= $link_prefix . '' . $link_suffix; $build .= '
'; $images[] = $build; @@ -674,6 +727,19 @@ public function find_gallery_classes( $content ) { return $classes; } + /** + * Renders the map block with custom content. + * + * This function processes the block content by checking if it belongs to a specific + * custom block variation and then iteratively builds the map content based on + * predefined fields and templates. It returns the final rendered block content. + * + * @param string $block_content The original content of the block. + * @param array $parsed_block Parsed data for the block, including type and attributes. + * @param object $block_obj Block object instance for the current block being processed. + * + * @return string Returns the modified block content after processing map data. + */ public function render_map_block( $block_content, $parsed_block, $block_obj ) { // Determine if this is the custom block variation. if ( ! isset( $parsed_block['blockName'] ) || ! isset( $parsed_block['attrs'] ) ) { @@ -738,4 +804,41 @@ public function prep_links( $items ) { } return implode( ', ', $item_links ); } + + /** + * Renders the p block with custom content. + * + * @param string $block_content The original content of the block. + * @param array $parsed_block Parsed data for the block, including type and attributes. + * @param object $block_obj Block object instance for the current block being processed. + * + * @return string Returns block with the permalink added. + */ + public function render_permalink_block( $block_content, $parsed_block, $block_obj ) { + // Determine if this is the custom block variation. + if ( ! isset( $parsed_block['blockName'] ) || ! isset( $parsed_block['attrs'] ) ) { + return $block_content; + } + $allowed_blocks = array( + 'core/button' + ); + + if ( ! in_array( $parsed_block['blockName'], $allowed_blocks, true ) ) { + return $block_content; + } + + if ( ! isset( $parsed_block['attrs']['metadata']['name'] ) ) { + return $block_content; + } + + if ( 'Permalink' !== $parsed_block['attrs']['metadata']['name'] ) { + return $block_content; + } + + $url = get_permalink(); + $pattern = '/#permalink/s'; + $block_content = preg_replace( $pattern, $url, $block_content ); + + return $block_content; + } } diff --git a/includes/classes/blocks/class-patterns.php b/includes/classes/blocks/class-patterns.php index 10c63f06..909dcc3b 100644 --- a/includes/classes/blocks/class-patterns.php +++ b/includes/classes/blocks/class-patterns.php @@ -35,7 +35,7 @@ public function __construct() { public function register_block_category( $categories ) { $categories[] = array( 'slug' => $this->category, - 'title' => __( 'LSX Tour Operator', 'lsx-tour-operator' ) + 'title' => __( 'Tour Operator', 'tour-operator' ) ); return $categories; } @@ -48,7 +48,7 @@ public function register_block_category( $categories ) { public function register_block_pattern_category() { register_block_pattern_category( $this->category, - array( 'label' => __( 'LSX Tour Operator', 'lsx-tour-operator' ) ) + array( 'label' => __( 'Tour Operator', 'tour-operator' ) ) ); } diff --git a/includes/classes/blocks/class-registration.php b/includes/classes/blocks/class-registration.php index 45f240ba..c7f490e3 100644 --- a/includes/classes/blocks/class-registration.php +++ b/includes/classes/blocks/class-registration.php @@ -11,8 +11,20 @@ class Registration { protected $disabled = []; + /** + * Holds the array of featured queries. + * + * @var array + */ protected $featured = []; + /** + * True if the current query outputting needs to be onsale. + * + * @var boolean + */ + protected $onsale = false; + /** * Initialize the plugin by setting localization, filters, and administration functions. * @@ -22,10 +34,12 @@ class Registration { */ public function __construct() { add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_block_variations_script' ), 10 ); - add_filter( 'query_loop_block_query_vars', array( $this, 'query_args_filter' ), 10, 2 ); + add_filter( 'query_loop_block_query_vars', array( $this, 'query_args_filter' ), 1, 2 ); add_filter( 'render_block', array( $this, 'maybe_hide_varitaion' ), 10, 3 ); add_filter( 'posts_pre_query', array( $this, 'posts_pre_query' ), 10, 2 ); + + add_filter( 'render_block_data', array( $this, 'save_onsale_queries' ), 10, 1 ); } /** @@ -36,11 +50,16 @@ public function __construct() { public function enqueue_block_variations_script() { $scripts = [ - 'general' => '', - 'tour' => '', - 'accommodation' => '', - 'destination' => '', - 'query-loops' => '', + 'general' => array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ), + 'tour' => array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post', 'lsx-to-block-general-variations' ), + 'accommodation' => array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post', 'lsx-to-block-general-variations' ), + 'destination' => array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post', 'lsx-to-block-general-variations' ), + 'query-loops' => array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post', 'lsx-to-block-general-variations' ), + ]; + + $additional_scripts = [ + 'linked-cover' => array( 'wp-blocks', 'wp-element', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-hooks' ), + 'slider-query' => array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components', 'wp-compose' ), ]; // Make sure the script is only enqueued in the block editor. @@ -52,25 +71,27 @@ public function enqueue_block_variations_script() { LSX_TO_URL . 'assets/js/blocks/' . $slug . '.js', // Path to your JavaScript file. array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post' ), // Dependencies. filemtime( LSX_TO_PATH . 'assets/js/blocks/' . $slug . '.js' ), // Versioning with file modification time. - true // Enqueue in the footer. + [ 'in_footer' => true ] ); + if ( 'general' === $slug ) { + $param_array = array( + 'homeUrl' => trailingslashit( home_url() ), + 'assetsUrl' => LSX_TO_URL . 'assets/img/' + ); + $param_array = apply_filters( 'lsx_to_editor_params', $param_array ); + wp_localize_script( 'lsx-to-block-' . $slug . '-variations', 'lsxToEditor', $param_array ); + } } - // Enqueue linked-cover.js - wp_enqueue_script( - 'lsx-to-linked-cover', - LSX_TO_URL . 'assets/js/blocks/linked-cover.js', - array( 'wp-blocks', 'wp-element', 'wp-block-editor', 'wp-components', 'wp-compose', 'wp-data', 'wp-hooks' ), - filemtime( LSX_TO_PATH . 'assets/js/blocks/linked-cover.js' ) - ); - - // Enqueue linked-cover.js - wp_enqueue_script( - 'lsx-to-slider-query', - LSX_TO_URL . 'assets/js/blocks/slider-query.js', - array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' ), - filemtime( LSX_TO_PATH . 'assets/js/blocks/slider-query.js' ) - ); + foreach ( $additional_scripts as $slug => $dependancies ) { + wp_enqueue_script( + 'lsx-to-' . $slug, + LSX_TO_URL . 'assets/js/blocks/' . $slug . '.js', + $dependancies, + filemtime( LSX_TO_PATH . 'assets/js/blocks/' . $slug . '.js' ), + [ 'in_footer' => true ] + ); + } if ( array_key_exists( get_post_type(), tour_operator()->get_post_types() ) ) { wp_enqueue_script( @@ -78,7 +99,7 @@ public function enqueue_block_variations_script() { LSX_TO_URL . 'assets/js/blocks/slotfills.js', // Path to your JavaScript file. array( 'wp-plugins', 'wp-edit-post', 'wp-element', 'wp-components', 'wp-data' ), // Dependencies. filemtime( LSX_TO_PATH . 'assets/js/blocks/slotfills.js' ), // Versioning with file modification time. - true // Enqueue in the footer. + [ 'in_footer' => true ] ); } } @@ -107,6 +128,8 @@ public function query_args_filter( $query, $block ) { // We only restric this on the destination post type, in case the block is used on a landing page. if ( 'destination' === get_post_type() ) { $query['post_parent__in'] = [ get_the_ID() ]; + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in + $query['post__not_in'] = [ get_the_ID() ]; } break; @@ -115,6 +138,7 @@ public function query_args_filter( $query, $block ) { $parent = wp_get_post_parent_id(); if ( 'destination' === get_post_type() ) { $query['post_parent'] = $parent; + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in $query['post__not_in'] = [ get_the_ID() ]; } break; @@ -122,7 +146,7 @@ public function query_args_filter( $query, $block ) { case 'featured-accommodation': case 'featured-tours': case 'featured-destinations': - + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query $query['meta_query'] = array( 'relation' => 'OR', array( @@ -196,7 +220,7 @@ public function query_args_filter( $query, $block ) { if ( ! isset( $query['post__in'] ) ) { $this->disabled[ $key ] = true; } - + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in $query['post__not_in'] = $excluded_items; break; @@ -234,6 +258,22 @@ public function query_args_filter( $query, $block ) { break; } + // Look for the "on sale" CSS class. + if ( true === $this->onsale ) { + if ( isset( $query['meta_query']['relation'] ) ) { + $query['meta_query']['relation'] = 'AND'; + } + $query['meta_query'][] = array( + 'key' => 'sale_price', + 'compare' => 'EXISTS', + ); + + // reset this to false for the next query. + $this->onsale = false; + } + + do_action( 'qm/debug', $query ); + return $query; } @@ -263,12 +303,19 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj } $pattern = "/(lsx|facts)-(.*?)-wrapper/"; + //$pattern = "/(lsx|facts)-((?:\w+-?)+)-wrapper/"; preg_match( $pattern, $parsed_block['attrs']['className'], $matches ); if ( empty( $matches ) ) { return $block_content; } + do_action( 'qm/debug', $matches ); + + if ( in_array( 'travel-information', $matches ) ) { + return $block_content; + } + if ( ! empty( $matches ) && isset( $matches[0] ) ) { // Save the first match to a variable $key = str_replace( [ 'facts-', 'lsx-', '-wrapper' ], '', $matches[0] ); @@ -348,6 +395,8 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj foreach ( $key_array as $meta_key ) { $value = lsx_to_custom_field_query( $meta_key, '', '', false ); + + do_action( 'qm/debug', $value ); // we need to see if the posts exist before we can use them if ( stripos( $meta_key, '_to_' ) && 0 === $this->post_ids_exist( $value ) ) { @@ -368,17 +417,17 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj } /** - * Determines if a post exists based on the ID. - * - * - * @global wpdb $wpdb WordPress database abstraction object. - * - * @param string $title Post title. - * @param string $content Optional. Post content. - * @param string $date Optional. Post date. - * @param string $type Optional. Post type. - * @param string $status Optional. Post status. - * @return int Post ID if post exists, 0 otherwise. + * Determines if a post exists based on the ID. + * + * + * @global wpdb $wpdb WordPress database abstraction object. + * + * @param string $title Post title. + * @param string $content Optional. Post content. + * @param string $date Optional. Post date. + * @param string $type Optional. Post type. + * @param string $status Optional. Post status. + * @return int Post ID if post exists, 0 otherwise. */ protected function post_ids_exist( $ids ) { global $wpdb; @@ -388,14 +437,15 @@ protected function post_ids_exist( $ids ) { } $ids = wp_unslash( sanitize_post_field( 'id', $ids, 0, 'db' ) ); - + // phpcs:disable WordPress.DB -- Start ignoring $query = "SELECT COUNT(ID) FROM $wpdb->posts WHERE 1=1 AND ID IN (%s) AND post_status IN ('draft', 'publish')"; - - return (int) $wpdb->get_var( $wpdb->prepare( $query, $ids ) ); + $result = (int) $wpdb->get_var( $wpdb->prepare( $query, $ids ) ); + // phpcs:enable -- Stop ignoring + return $result; } /** @@ -426,4 +476,33 @@ public function find_featured_items( $query ) { } return $items; } + + /** + * This function looks at the query blocks CSS classes to determine if it is onsale. + * + * @param array $parsed_block + * @return array + */ + public function save_onsale_queries( $parsed_block ) { + if ( ! isset( $parsed_block['blockName'] ) || ! isset( $parsed_block['attrs'] ) ) { + return $parsed_block; + } + $allowed_blocks = array( + 'core/query', + ); + + if ( ! in_array( $parsed_block['blockName'], $allowed_blocks, true ) ) { + return $parsed_block; + } + if ( ! isset( $parsed_block['attrs']['className'] ) || '' === $parsed_block['attrs']['className'] || false === $parsed_block['attrs']['className'] ) { + return $parsed_block; + } + + $this->onsale = false; + + if ( false !== stripos( $parsed_block['attrs']['className'], 'on-sale' ) ) { + $this->onsale = true; + } + return $parsed_block; + } } diff --git a/includes/classes/class-metaboxes.php b/includes/classes/class-metaboxes.php deleted file mode 100644 index d39d1d09..00000000 --- a/includes/classes/class-metaboxes.php +++ /dev/null @@ -1,79 +0,0 @@ -object ); - } - - /** - * Register a taxonomy for the plugin. - * - * @since 1.1.0 - * - * @param string $slug The taxonomy slug. - * @param array $config The taxonomy config arguments. - */ - protected function register_object( $slug, $config ) { - $this->object[ $slug ] = $config; - } - - /** - * Remove Duplicate IDS from the post select fields. - * - * @param array $values - * @return array - */ - public function unique_arrays( $values ) { - - if ( ! empty( $values ) && is_array( $values ) ) { - $values = array_unique( $values ); - } - - return $values; - } -} diff --git a/includes/classes/class-post-connections.php b/includes/classes/class-post-connections.php new file mode 100644 index 00000000..13ab817d --- /dev/null +++ b/includes/classes/class-post-connections.php @@ -0,0 +1,462 @@ +get_cmb2_options(); + add_filter( 'facetwp_indexer_row_data', array( $this, 'facetwp_index_row_data' ), 10, 2 ); + add_filter( 'facetwp_index_row', array( $this, 'facetwp_index_row' ), 10, 2 ); + add_filter( 'facetwp_facet_html', array( $this, 'destination_facet_html' ), 10, 2 ); + } + + /** + * Gets the cmb2 options. + * + * @return void + */ + private function get_cmb2_options() { + $cmb2_options = get_option( 'lsx-search-settings' ); + if ( false !== $cmb2_options && ! empty( $cmb2_options ) ) { + $this->options['display'] = $cmb2_options; + foreach ( $this->options['display'] as $option_key => $option_value ) { + if ( is_array( $option_value ) && ! empty( $option_value ) ) { + $new_values = array(); + foreach ( $option_value as $empty_key => $key_value ) { + $new_values[ $key_value ] = 'on'; + } + $this->options['display'][ $option_key ] = $new_values; + } + } + } + } + + /** + * Return an instance of this class. + * + * @since 1.0.0 + * + * @return object \lsx\search\classes\facetwp\Post_Connections() A single instance of this class. + */ + public static function get_instance() { + // If the single instance hasn't been set, set it now. + if ( null === self::$instance ) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Alter the rows and include extra facets rows for the continents + */ + public function facetwp_index_row_data( $rows, $params ) { + switch ( $params['facet']['source'] ) { + case 'cf/destination_to_tour': + case 'cf/destination_to_accommodation': + $countries = array(); + + $new_rows = []; + // First lets process our new rows, depending of if its a serialized array or not. + foreach ( $rows as $r_index => $row ) { + + // first lets check if we have an array as the values. + if ( is_array( $row['facet_value'] ) ) { + foreach ( $row['facet_value'] as $r_index => $pid ) { + + $title = get_the_title( $pid ); + if ( '' === $title ) { + continue; + } + + $template_row = $row; + $template_row['facet_value'] = $pid; + $template_row['facet_display_value'] = $title; + $parent = wp_get_post_parent_id( $template_row['facet_value'] ); + $template_row['parent_id'] = $parent; + + + if ( 0 === $parent || '0' === $parent ) { + if ( ! isset( $countries[ $r_index ] ) ) { + $countries[ $r_index ] = $row['facet_value']; + } + + if ( ! empty( $this->options['display']['engine_search_continent_filter'] ) ) { + $template_row['depth'] = 1; + } else { + $template_row['depth'] = 0; + } + } else { + if ( ! empty( $this->options['display']['engine_search_continent_filter'] ) ) { + $template_row['depth'] = 2; + } else { + $template_row['depth'] = 1; + } + } + + $new_rows[ $r_index ] = $template_row; + } + + } else { + $parent = wp_get_post_parent_id( ); + $rows[ $r_index ]['parent_id'] = $parent; + + if ( 0 === $parent || '0' === $parent ) { + if ( ! isset( $countries[ $r_index ] ) ) { + $countries[ $r_index ] = $row['facet_value']; + } + + if ( ! empty( $this->options['display']['engine_search_continent_filter'] ) ) { + $rows[ $r_index ]['depth'] = 1; + } else { + $rows[ $r_index ]['depth'] = 0; + } + } else { + if ( ! empty( $this->options['display']['engine_search_continent_filter'] ) ) { + $rows[ $r_index ]['depth'] = 2; + } else { + $rows[ $r_index ]['depth'] = 1; + } + } + } + } + + // Replace the old rows with the new once used. + if ( ! empty( $new_rows ) ) { + $rows = $new_rows; + } + + if ( ! empty( $this->options['display']['enable_search_continent_filter'] ) ) { + if ( ! empty( $countries ) ) { + foreach ( $countries as $row_index => $country ) { + $continents = wp_get_object_terms( $country, 'continent' ); + $continent_id = 0; + + if ( ! is_wp_error( $continents ) ) { + $new_row = $params['defaults']; + if ( ! is_array( $continents ) ) { + $continents = array( $continents ); + } + + foreach ( $continents as $continent ) { + $new_row['facet_value'] = $continent->slug; + $new_row['facet_display_value'] = $continent->name; + $continent_id = $continent->term_id; + $new_row['depth'] = 0; + } + $rows[] = $new_row; + $rows[ $row_index ]['parent_id'] = $continent_id; + } + } + } + } + + break; + + default: + break; + } + + return $rows; + } + + /** + * Displays the destination specific settings + */ + public function facetwp_index_row( $params, $class ) { + $custom_field = false; + $meta_key = false; + + preg_match( '/cf\//', $class->facet['source'], $custom_field ); + preg_match( '/_to_/', $class->facet['source'], $meta_key ); + + if ( ! empty( $custom_field ) && ! empty( $meta_key ) ) { + + $values = (array) $params['facet_value']; + foreach ( $values as $val ) { + $params['facet_value'] = $val; + $params['facet_display_value'] = $val; + + $title = get_the_title( $params['facet_value'] ); + if ( '' !== $title ) { + $params['facet_display_value'] = $title; + } + if ( '' === $title && ! empty( $meta_key ) ) { + $params['facet_value'] = ''; + } + // Insert into the DB + $class->insert( $params ); + } + + return false; // skip default indexing + } + + // If its a price, save the value as a standard number. + if ( 'cf/price' === $class->facet['source'] ) { + $params['facet_value'] = preg_replace( '/[^0-9.]/', '', $params['facet_value'] ); + $params['facet_value'] = ltrim( $params['facet_value'], '.' ); + #$params['facet_value'] = number_format( (int) $params['facet_value'], 2 ); + $params['facet_display_value'] = $params['facet_value']; + } + + // If its a duration, save the value as a standard number. + if ( 'cf/duration' === $class->facet['source'] ) { + $params['facet_value'] = preg_replace( '/[^0-9 ]/', '', $params['facet_value'] ); + $params['facet_value'] = trim( $params['facet_value'] ); + $params['facet_value'] = explode( ' ', $params['facet_value'] ); + $params['facet_value'] = $params['facet_value'][0]; + #$params['facet_value'] = (int) $params['facet_value']; + $params['facet_display_value'] = $params['facet_value']; + } + + return $params; + } + + /** + * Checks the facet source value and outputs the destination facet HTML if needed. + * + * @param string $output + * @param array $params + * @return string + */ + public function destination_facet_html( $output, $params ) { + $possible_keys = array( + 'cf/destination_to_accommodation', + 'cf/destination_to_tour', + 'cf/destination_to_special', + 'cf/destination_to_activity', + 'cf/destination_to_review', + 'cf/destination_to_vehicle', + ); + if ( in_array( $params['facet']['source'], $possible_keys ) && 'checkboxes' === $params['facet']['type'] ) { + $output = $this->destination_facet_render( $params ); + } + return $output; + } + + /** + * Generate the facet HTML + */ + public function destination_facet_render( $params ) { + $facet = $params['facet']; + + if ( 'checkboxes' !== $params['facet']['type'] ) { + return; + } + + $output = ''; + $values = (array) $params['values']; + $selected_values = (array) $params['selected_values']; + $soft_limit = empty( $facet['soft_limit'] ) ? 0 : (int) $facet['soft_limit']; + $countries = array(); + $continents = array(); + + $continent_terms = get_terms( + array( + 'taxonomy' => 'continent', + ) + ); + + if ( ! is_wp_error( $continent_terms ) ) { + foreach ( $continent_terms as $continent ) { + $continents[ $continent->term_id ] = $continent->slug; + } + } + + //Create a relationship of the facet value and the their depths + $depths = array(); + $parents = array(); + foreach ( $values as $value ) { + $depths[ $value['facet_value'] ] = (int) $value['depth']; + $parents[ $value['facet_value'] ] = (int) $value['parent_id']; + } + + //Determine the current depth and check if the selected values parents are in the selected array. + $current_depth = 0; + $additional_values = array(); + if ( ! empty( $selected_values ) ) { + foreach ( $selected_values as $selected ) { + if ( $depths[ $selected ] > $current_depth ) { + $current_depth = $depths[ $selected ]; + } + } + $current_depth++; + } + + if ( ! empty( $additional_values ) ) { + $selected_values = array_merge( $selected_values, $additional_values ); + } + + // This is where the items are sorted by their depth + $sorted_values = array(); + $stored = $values; + + //sort the options so + foreach ( $values as $key => $result ) { + if ( ! empty( $this->options['display']['engine_search_continent_filter'] ) ) { + if ( in_array( $result['facet_value'], $continents ) ) { + $sorted_values[] = $result; + $destinations = $this->get_countries( $stored, $result['facet_value'], $continents, '1' ); + + if ( ! empty( $destinations ) ) { + foreach ( $destinations as $destination ) { + $sorted_values[] = $destination; + } + } + } + } else { + if ( '0' === $result['depth'] || 0 === $result['depth'] ) { + $sorted_values[] = $result; + $destinations = $this->get_regions( $stored, $result['facet_value'], '1' ); + + if ( ! empty( $destinations ) ) { + foreach ( $destinations as $destination ) { + $sorted_values[] = $destination; + } + } + } + } + } + $values = $sorted_values; + + $continent_class = ''; + $country_class = ''; + + // Run through each value and output the values. + foreach ( $values as $key => $facet ) { + $depth_type = ''; + + if ( ! empty( $this->options['display']['engine_search_continent_filter'] ) ) { + switch ( $facet['depth'] ) { + case '0': + $depth_type = ''; + $continent_class = in_array( $facet['facet_value'], $selected_values ) ? $depth_type .= ' continent-checked' : ''; + break; + + case '1': + $depth_type = 'country' . $continent_class; + $country_class = in_array( $facet['facet_value'], $selected_values ) ? $depth_type .= ' country-checked' : ''; + break; + + case '2': + $depth_type = 'region' . $continent_class . $country_class; + break; + } + } else { + switch ( $facet['depth'] ) { + case '0': + $depth_type = 'country continent-checked'; + $country_class = in_array( $facet['facet_value'], $selected_values ) ? $depth_type .= ' country-checked' : ''; + break; + + case '1': + $depth_type = 'region continent-checked' . $country_class; + break; + } + } + + if ( $facet['depth'] <= $current_depth ) { + if ( 'checkboxes' === $params['facet']['type'] ) { + $options[] = $this->format_checkbox_facet( $key, $facet, $selected_values, $depth_type ); + } else if ( 'fselect' === $params['facet']['type'] ) { + $options[] = $this->format_fselect_facet( $key, $facet, $selected_values, $depth_type ); + } + + } + } + + if ( ! empty( $options ) ) { + $output = implode( '', $options ); + } + + $output = '' . $output . ''; + + return $output; + } + + /** + * Gets the direct countries from the array. + */ + public function get_countries( $values, $parent, $continents, $depth ) { + $children = array(); + $stored = $values; + + foreach ( $values as $value ) { + if ( isset( $continents[ $value['parent_id'] ] ) && $continents[ $value['parent_id'] ] === $parent && $value['depth'] === $depth ) { + $children[] = $value; + + $destinations = $this->get_regions( $stored, $value['facet_value'], '2' ); + if ( ! empty( $destinations ) ) { + foreach ( $destinations as $destination ) { + $children[] = $destination; + } + } + } + } + return $children; + } + + /** + * Gets the direct regions from the array. + */ + public function get_regions( $values, $parent, $depth ) { + $children = array(); + foreach ( $values as $value ) { + if ( $value['parent_id'] === $parent && $value['depth'] === $depth ) { + $children[] = $value; + } + } + return $children; + } + + public function format_checkbox_facet( $key, $result, $selected_values, $region = '' ) { + $temp_html = ''; + + $selected = in_array( $result['facet_value'], $selected_values ) ? ' checked' : ''; + $selected .= ( 0 == $result['counter'] && '' == $selected ) ? ' disabled' : ''; + $selected .= ' ' . $region; + + $temp_html .= '
'; + $temp_html .= $result['facet_display_value'] . ' (' . $result['counter'] . ')'; + $temp_html .= '
'; + + return $temp_html; + } + + public function format_fselect_facet( $key, $result, $selected_values, $region = '' ) { + $temp_html = ''; + + $selected = in_array( $result['facet_value'], $selected_values ) ? ' checked' : ''; + $selected .= ( 0 == $result['counter'] && '' == $selected ) ? ' disabled' : ''; + $selected .= ' ' . $region; + + $temp_html .= '
+ +
' . $result['facet_display_value'] . ' (' . $result['counter'] . ')
+
'; + + return $temp_html; + } +} diff --git a/includes/classes/class-share.php b/includes/classes/class-share.php deleted file mode 100644 index 42be9d70..00000000 --- a/includes/classes/class-share.php +++ /dev/null @@ -1,100 +0,0 @@ -active_styles .= $styles; - } - - /** - * Runs after active assets have been set. - * - * @since 1.1.0 - * @access protected - */ - public function render_active_styles() { - - if ( ! empty( $this->active_styles ) ) { - echo ''; - } - } - - /** - * Return an instance of this class. - * - * @codeCoverageIgnore - * @since 1.1.0 - * @return self A single instance of the share class. - */ - public static function init() { - - // If the single instance hasn't been set, set it now. - if ( ! isset( self::$instance ) ) { - self::$instance = new self(); - } - - return self::$instance; - - } - - /** - * Constructor. Sets up action to render styles. - * - * @since 1.1.0 - */ - public function __construct() { - add_action( 'admin_enqueue_scripts', array( - $this, - 'render_active_styles', - ), 100 ); - add_action( 'wp_print_styles', array( - $this, - 'render_active_styles', - ), 100 ); - } -} diff --git a/includes/classes/class-tour-operator.php b/includes/classes/class-tour-operator.php index ae846eed..66fabc90 100644 --- a/includes/classes/class-tour-operator.php +++ b/includes/classes/class-tour-operator.php @@ -10,6 +10,7 @@ use lsx\blocks\Patterns; use lsx\blocks\Registration; use lsx\blocks\Templates; +use lsx\integrations\facetwp\Post_Connections; /** * LSX Tour Operator Main Class @@ -214,7 +215,6 @@ private function build_asset_args( $asset ) { * @uses "init" action */ public function setup() { - load_plugin_textdomain( 'tour-operator', false, LSX_TO_CORE . '/languages' ); $this->pages = Pages::init(); $this->taxonomies = Taxonomies::init(); $this->admin = new Admin(); @@ -224,5 +224,10 @@ public function setup() { $this->registration = new Registration(); $this->patterns = new Patterns(); $this->templates = new Templates(); + + + // Files that wont load with the badly written spl_autoregister function. + require_once LSX_TO_PATH . 'includes/classes/class-post-connections.php'; + $this->post_connections = new Post_Connections(); } } diff --git a/includes/classes/legacy/class-accommodation.php b/includes/classes/legacy/class-accommodation.php index 3d3af61f..becc9e16 100644 --- a/includes/classes/legacy/class-accommodation.php +++ b/includes/classes/legacy/class-accommodation.php @@ -73,16 +73,11 @@ private function __construct() { 'villa' => esc_html__( 'Villa', 'tour-operator' ), ); - add_filter( 'lsx_to_entry_class', array( $this, 'entry_class' ) ); - add_filter( 'lsx_to_custom_field_query', array( $this, 'price_filter' ), 5, 10 ); add_filter( 'lsx_to_custom_field_query', array( $this, 'rating' ), 5, 10 ); include( 'class-unit-query.php' ); - - add_action( 'lsx_to_map_meta', 'lsx_to_accommodation_meta' ); - add_action( 'lsx_to_modal_meta', 'lsx_to_accommodation_meta' ); } /** @@ -101,19 +96,6 @@ public static function get_instance() { return self::$instance; } - /** - * A filter to set the content area to a small column on single - */ - function entry_class( $classes ) { - global $post; - - if ( is_main_query() && is_singular( $this->slug ) ) { - $classes[] = 'col-xs-12 col-sm-12 col-md-7'; - } - - return $classes; - } - /** * Adds in additional info for the price custom field */ @@ -123,8 +105,6 @@ public function price_filter( $html = '', $meta_key = false, $value = false, $be 'single_supplement' ]; - do_action( 'qm/debug', [ get_post_type(), $meta_key ] ); - if ( get_post_type() === 'accommodation' && in_array( $meta_key, $currency_fields ) ) { $price_type = get_post_meta( get_the_ID(), 'price_type', true ); $value = preg_replace( '/[^0-9,.]/', '', $value ); @@ -133,14 +113,23 @@ public function price_filter( $html = '', $meta_key = false, $value = false, $be $value = number_format( (int) $value, 2 ); $tour_operator = tour_operator(); $currency = ''; + $letter_code = ''; if ( is_object( $tour_operator ) && isset( $tour_operator->options['currency'] ) && ! empty( $tour_operator->options['currency'] ) ) { - $currency = $tour_operator->options['currency']; - $currency = '' . $currency . ''; + $letter_code = $tour_operator->options['currency']; + $currency = ''; } $value = apply_filters( 'lsx_to_accommodation_price', $value, $price_type, $currency ); + // Get the Sale Price + if ( 'price' === $meta_key ) { + $sale_price = get_post_meta( get_the_ID(), 'sale_price', true ); + if ( false !== $sale_price && ! empty( $sale_price ) && 0 !== intval( $sale_price ) ) { + $value = number_format( intval( $sale_price ) , 2 ); + } + } + switch ( $price_type ) { case 'per_person_per_night': case 'per_person_sharing': @@ -159,6 +148,11 @@ public function price_filter( $html = '', $meta_key = false, $value = false, $be break; } + // Get the currency settings + if ( is_object( $tour_operator ) && ( isset( $tour_operator->options['country_code_disabled'] ) && 0 === intval( $tour_operator->options['country_code_disabled'] ) || ! isset( $tour_operator->options['country_code_disabled'] ) ) ) { + $value = $letter_code . $value; + } + $html = $before . $value . $after; } @@ -176,6 +170,7 @@ public function rating( $html = '', $meta_key = false, $value = false, $before = if ( 0 !== (int) $value ) { while ( $counter > 0 ) { $ratings_array[] = '
'; + // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage $ratings_array[] = ''; } } else { @@ -276,14 +278,15 @@ public function save_meta( $term_id = 0, $taxonomy = '' ) { if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return; } - + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! isset( $_POST['thumbnail'] ) || ! isset( $_POST['tagline'] ) ) { return; } if ( check_admin_referer( 'lsx_to_save_term_thumbnail', 'lsx_to_term_thumbnail_nonce' ) ) { + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_POST['thumbnail'] ) && ! empty( $_POST['thumbnail'] ) ) { - $thumbnail_meta = sanitize_text_field( $_POST['thumbnail'] ); + $thumbnail_meta = sanitize_text_field( wp_unslash( $_POST['thumbnail'] ) ); $thumbnail_meta = ! empty( $thumbnail_meta ) ? $thumbnail_meta : ''; if ( empty( $thumbnail_meta ) ) { @@ -293,8 +296,9 @@ public function save_meta( $term_id = 0, $taxonomy = '' ) { } } + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_POST['tagline'] ) && ! empty( $_POST['tagline'] ) ) { - $meta = sanitize_text_field( $_POST['tagline'] ); + $meta = sanitize_text_field( wp_unslash( $_POST['tagline'] ) ); $meta = ! empty( $meta ) ? $meta : ''; if ( empty( $meta ) ) { diff --git a/includes/classes/legacy/class-frontend.php b/includes/classes/legacy/class-frontend.php index e0ebbe06..87b499e3 100644 --- a/includes/classes/legacy/class-frontend.php +++ b/includes/classes/legacy/class-frontend.php @@ -53,7 +53,6 @@ public function __construct() { $this->set_vars(); add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_stylescripts' ), 1 ); - add_action( 'wp_head', array( $this, 'wp_head' ), 10 ); add_filter( 'body_class', array( $this, 'body_class' ), 15, 1 ); if ( ! is_admin() ) { @@ -61,10 +60,6 @@ public function __construct() { add_filter( 'posts_orderby', array( $this, 'enable_continent_taxonomy_order' ), 10, 2 ); } - add_filter( 'lsx_to_connected_list_item', array( $this, 'add_modal_attributes' ), 10, 3 ); - add_action( 'wp_footer', array( $this, 'output_modals' ), 10 ); - add_filter( 'lsx_to_tagline', array( $this, 'get_tagline' ), 1, 3 ); - // add_filter( 'the_terms', array( $this, 'links_new_window' ), 10, 2 ); $this->maps = Maps::get_instance(); @@ -76,78 +71,6 @@ public function __construct() { add_filter( 'wpseo_breadcrumb_links', array( $this, 'wpseo_breadcrumb_links' ), 20 ); } - /** - * Initate some boolean flags - */ - public function wp_head() { - if ( ( is_singular( $this->active_post_types ) || is_post_type_archive( $this->active_post_types ) ) - && false !== $this->options - && isset( $this->options['display']['enable_modals'] ) - && 'on' === $this->options['display']['enable_modals'] - ) { - $this->enable_modals = true; - } - } - - /** - * a filter to overwrite the links with modal tags. - */ - public function add_modal_attributes( $html, $post_id, $link ) { - if ( true === $this->enable_modals && true === $link ) { - $html = '' . get_the_title( $post_id ) . ''; - - if ( ! in_array( $post_id, $this->modal_ids ) ) { - $this->modal_ids[] = $post_id; - } - } - - return $html; - } - - /** - * a filter to overwrite the links with modal tags. - */ - public function output_modals() { - global $lsx_to_archive, $post; - - if ( true === $this->enable_modals && ! empty( $this->modal_ids ) ) { - $temp = $lsx_to_archive; - $lsx_to_archive = 1; - - foreach ( $this->modal_ids as $post_id ) { - $post = get_post( $post_id ); - ?> - - - - post_types && is_singular( array_keys( $this->post_types ) ) ) { $classes[] = 'single-tour-operator'; } elseif ( false !== $this->post_types && is_post_type_archive( array_keys( $this->post_types ) ) ) { diff --git a/includes/classes/legacy/class-maps.php b/includes/classes/legacy/class-maps.php index d6ea76bc..7ee277ce 100644 --- a/includes/classes/legacy/class-maps.php +++ b/includes/classes/legacy/class-maps.php @@ -230,7 +230,7 @@ public function map_output( $post_id = false, $args = array() ) { $tooltip = $args['search']; if ( 'excerpt' === $args['content'] ) { - $tooltip = strip_tags( get_the_excerpt( $post_id ) ); + $tooltip = wp_strip_all_tags( get_the_excerpt( $post_id ) ); } $icon = $this->set_icon( $post_id ); @@ -257,7 +257,7 @@ public function map_output( $post_id = false, $args = array() ) { $tooltip = $location['address']; if ( 'excerpt' === $args['content'] ) { - $tooltip = strip_tags( get_the_excerpt( $connection ) ); + $tooltip = wp_strip_all_tags( get_the_excerpt( $connection ) ); } $icon = $this->set_icon( $connection ); @@ -583,10 +583,14 @@ public function is_a_bot() { 'newspaper', 'serpstatbot', ); + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( isset( $_GET['debug_bot'] ) ) { - $user_agent = sanitize_text_field( $_GET['debug_bot'] ); - } else { - $user_agent = sanitize_text_field( $_SERVER['HTTP_USER_AGENT'] ); + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended + $user_agent = sanitize_text_field( wp_unslash( $_GET['debug_bot'] ) ); + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended + } else if ( isset( $_GET['HTTP_USER_AGENT'] ) ) { + // @phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated + $user_agent = sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ); } foreach ( $user_agents as $agent ) { diff --git a/includes/classes/legacy/class-scpo-engine.php b/includes/classes/legacy/class-scpo-engine.php deleted file mode 100644 index 1c531c9e..00000000 --- a/includes/classes/legacy/class-scpo-engine.php +++ /dev/null @@ -1,486 +0,0 @@ -lsx_to_scporder_install(); - } - - add_action( 'admin_init', array( $this, 'refresh' ) ); - add_action( 'admin_init', array( $this, 'load_script_css' ) ); - - add_action( 'wp_ajax_update-menu-order', array( - $this, - 'update_menu_order', - ) ); - add_action( 'wp_ajax_update-menu-order-tags', array( - $this, - 'update_menu_order_tags', - ) ); - - add_action( 'pre_get_posts', array( - $this, - 'lsx_to_scporder_pre_get_posts', - ) ); - - add_filter( 'get_previous_post_where', array( - $this, - 'lsx_to_scporder_previous_post_where', - ) ); - add_filter( 'get_previous_post_sort', array( - $this, - 'lsx_to_scporder_previous_post_sort', - ) ); - add_filter( 'get_next_post_where', array( - $this, - 'lsx_to_scporder_next_post_where', - ) ); - add_filter( 'get_next_post_sort', array( - $this, - 'lsx_to_scporder_next_post_sort', - ) ); - - add_filter( 'get_terms_orderby', array( - $this, - 'lsx_to_scporder_get_terms_orderby', - ), 10, 3 ); - add_filter( 'wp_get_object_terms', array( - $this, - 'lsx_to_scporder_get_object_terms', - ), 10, 4 ); - add_filter( 'get_terms', array( - $this, - 'lsx_to_scporder_get_object_terms', - ), 10, 4 ); - } - - function lsx_to_scporder_install() { - global $wpdb; - $result = $wpdb->query( "DESCRIBE $wpdb->terms `lsx_to_term_order`" ); - - if ( ! $result ) { - $result = $wpdb->query( "ALTER TABLE $wpdb->terms ADD `lsx_to_term_order` INT(4) NULL DEFAULT '0'" ); - } - - update_option( 'lsx_to_scporder_install', 1 ); - } - - function _check_load_script_css() { - $active = false; - - $objects = $this->get_to_scporder_options_objects(); - $tags = $this->get_to_scporder_options_tags(); - - if ( empty( $objects ) && empty( $tags ) ) { - return false; - } - - if ( isset( $_GET['orderby'] ) || strstr( sanitize_text_field( $_SERVER['REQUEST_URI'] ), 'action=edit' ) || strstr( sanitize_text_field( $_SERVER['REQUEST_URI'] ), 'wp-admin/post-new.php' ) ) { - return false; - } - - if ( ! empty( $objects ) ) { - if ( isset( $_GET['post_type'] ) && ! isset( $_GET['taxonomy'] ) && array_key_exists( sanitize_text_field( $_GET['post_type'] ), $objects ) ) { // if page or custom post types - $active = true; - } - if ( ! isset( $_GET['post_type'] ) && strstr( sanitize_text_field( $_SERVER['REQUEST_URI'] ), 'wp-admin/edit.php' ) && array_key_exists( 'post', $objects ) ) { // if post - $active = true; - } - } - - if ( ! empty( $tags ) ) { - if ( isset( $_GET['taxonomy'] ) && array_key_exists( sanitize_text_field( $_GET['taxonomy'] ), $tags ) ) { - $active = true; - } - } - - return $active; - } - - function load_script_css() { - if ( $this->_check_load_script_css() ) { - wp_enqueue_script( 'scporderjs', LSX_TO_URL . '/assets/js/scporder.min.js', array( 'jquery', 'jquery-ui-sortable' ), null, true ); - - $scporderjs_params = array( - 'ajax_url' => admin_url( 'admin-ajax.php' ), - 'ajax_nonce' => wp_create_nonce( 'scporder' ), - ); - - wp_localize_script( 'scporderjs', 'scporderjs_params', $scporderjs_params ); - - wp_enqueue_style( 'scporder', LSX_TO_URL . '/assets/css/scporder.css', array(), null ); - wp_style_add_data( 'scporder', 'rtl', 'replace' ); - } - } - - function refresh() { - global $wpdb; - $objects = $this->get_to_scporder_options_objects(); - $tags = $this->get_to_scporder_options_tags(); - - if ( ! empty( $objects ) ) { - foreach ( $objects as $object => $object_data ) { - $result = $wpdb->get_results( $wpdb->prepare( " - SELECT count(*) as cnt, max(menu_order) as max, min(menu_order) as min - FROM $wpdb->posts - WHERE post_type = '%s' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future') - ", $object ) ); - - if ( 0 == $result[0]->cnt || $result[0]->cnt == $result[0]->max ) { - continue; - } - - $results = $wpdb->get_results( $wpdb->prepare( " - SELECT ID - FROM $wpdb->posts - WHERE post_type = '%s' AND post_status IN ('publish', 'pending', 'draft', 'private', 'future') - ORDER BY menu_order ASC - ", $object ) ); - - foreach ( $results as $key => $result ) { - $wpdb->update( - $wpdb->posts, - array( - 'menu_order' => $key + 1, - ), - array( - 'ID' => $result->ID, - ) - ); - } - } - } - - if ( ! empty( $tags ) ) { - foreach ( $tags as $taxonomy => $taxonomy_data ) { - $result = $wpdb->get_results( $wpdb->prepare( " - SELECT count(*) as cnt, max(lsx_to_term_order) as max, min(lsx_to_term_order) as min - FROM $wpdb->terms AS terms - INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id ) - WHERE term_taxonomy.taxonomy = '%s' - ", $taxonomy ) ); - - if ( 0 == $result[0]->cnt || $result[0]->cnt == $result[0]->max ) { - continue; - } - - $results = $wpdb->get_results( $wpdb->prepare( " - SELECT terms.term_id - FROM $wpdb->terms AS terms - INNER JOIN $wpdb->term_taxonomy AS term_taxonomy ON ( terms.term_id = term_taxonomy.term_id ) - WHERE term_taxonomy.taxonomy = '%s' - ORDER BY lsx_to_term_order ASC - ", $taxonomy ) ); - - foreach ( $results as $key => $result ) { - $wpdb->update( - $wpdb->terms, - array( - 'lsx_to_term_order' => $key + 1, - ), - array( - 'term_id' => $result->term_id, - ) - ); - } - } - } - } - - function update_menu_order() { - check_ajax_referer( 'scporder', 'security' ); - - global $wpdb; - - parse_str( sanitize_text_field( $_POST['order'] ), $data ); - - if ( ! is_array( $data ) ) { - return false; - } - - /*$id_arr = array(); - - foreach ( $data as $key => $values ) { - foreach ( $values as $position => $id ) { - $id_arr[] = $id; - } - } - - $menu_order_arr = array(); - - foreach ( $id_arr as $key => $id ) { - $results = $wpdb->get_results( "SELECT menu_order FROM $wpdb->posts WHERE ID = " . intval( $id ) ); - foreach ( $results as $result ) { - $menu_order_arr[] = $result->menu_order; - } - } - - sort( $menu_order_arr );*/ - - foreach ( $data as $key => $values ) { - foreach ( $values as $position => $id ) { - $wpdb->update( - $wpdb->posts, - array( - 'menu_order' => $position, - ), - array( - 'ID' => intval( $id ), - ) - ); - } - } - } - - function update_menu_order_tags() { - check_ajax_referer( 'scporder', 'security' ); - - global $wpdb; - - parse_str( sanitize_text_field( $_POST['order'] ), $data ); - - if ( ! is_array( $data ) ) { - return false; - } - - /*$current_user = wp_get_current_user(); - if ( false === $current_user || 'lightspeed' !== $current_user->data->user_login ) { - return false; - }*/ - - /*$id_arr = array(); - - foreach ( $data as $key => $values ) { - foreach ( $values as $position => $id ) { - $id_arr[] = $id; - } - } - - $menu_order_arr = array(); - - foreach ( $id_arr as $key => $id ) { - $results = $wpdb->get_results( "SELECT lsx_to_term_order FROM $wpdb->terms WHERE term_id = " . intval( $id ) ); - foreach ( $results as $result ) { - $menu_order_arr[] = $result->lsx_to_term_order; - } - } - - sort( $menu_order_arr );*/ - - foreach ( $data as $key => $values ) { - $term_ids = array(); - foreach ( $values as $position => $id ) { - $wpdb->update( - $wpdb->terms, - array( - 'lsx_to_term_order' => $position + 1, - ), - array( - 'term_id' => intval( $id ), - ) - ); - $term_ids[] = intval( $id ); - } - clean_term_cache( $term_ids ); - } - } - - function lsx_to_scporder_previous_post_where( $where ) { - global $post; - $objects = $this->get_to_scporder_options_objects(); - - if ( empty( $objects ) ) { - return $where; - } - - if ( isset( $post->post_type ) && array_key_exists( $post->post_type, $objects ) ) { - $current_menu_order = $post->menu_order; - $where = "WHERE p.menu_order > '" . $current_menu_order . "' AND p.post_type = '" . $post->post_type . "' AND p.post_status = 'publish'"; - } - - return $where; - } - - function lsx_to_scporder_previous_post_sort( $orderby ) { - global $post; - $objects = $this->get_to_scporder_options_objects(); - - if ( empty( $objects ) ) { - return $orderby; - } - - if ( isset( $post->post_type ) && array_key_exists( $post->post_type, $objects ) ) { - $orderby = 'ORDER BY p.menu_order ASC LIMIT 1'; - } - - return $orderby; - } - - function lsx_to_scporder_next_post_where( $where ) { - global $post; - $objects = $this->get_to_scporder_options_objects(); - - if ( empty( $objects ) ) { - return $where; - } - - if ( isset( $post->post_type ) && array_key_exists( $post->post_type, $objects ) ) { - $current_menu_order = $post->menu_order; - $where = "WHERE p.menu_order < '" . $current_menu_order . "' AND p.post_type = '" . $post->post_type . "' AND p.post_status = 'publish'"; - } - - return $where; - } - - function lsx_to_scporder_next_post_sort( $orderby ) { - global $post; - $objects = $this->get_to_scporder_options_objects(); - - if ( empty( $objects ) ) { - return $orderby; - } - - if ( isset( $post->post_type ) && array_key_exists( $post->post_type, $objects ) ) { - $orderby = 'ORDER BY p.menu_order DESC LIMIT 1'; - } - - return $orderby; - } - - function lsx_to_scporder_pre_get_posts( $wp_query ) { - $objects = $this->get_to_scporder_options_objects(); - - if ( empty( $objects ) ) { - return false; - } - - if ( is_admin() ) { - if ( isset( $wp_query->query['post_type'] ) && ! isset( $_GET['orderby'] ) ) { - if ( ! is_array( $wp_query->query['post_type'] ) ) { - if ( array_key_exists( $wp_query->query['post_type'], $objects ) ) { - $wp_query->set( 'orderby', 'menu_order' ); - $wp_query->set( 'order', 'ASC' ); - } - } - } - } else { - $active = false; - - if ( isset( $wp_query->query['post_type'] ) ) { - if ( ! is_array( $wp_query->query['post_type'] ) ) { - if ( array_key_exists( $wp_query->query['post_type'], $objects ) ) { - $active = true; - } - } - } else { - if ( array_key_exists( 'post', $objects ) ) { - $active = true; - } - } - - if ( ! $active ) { - return false; - } - - if ( isset( $wp_query->query['disabled_custom_post_order'] ) ) { - return false; - } - - if ( isset( $wp_query->query['suppress_filters'] ) ) { - if ( $wp_query->get( 'orderby' ) == 'date' ) { - $wp_query->set( 'orderby', 'menu_order' ); - } - if ( $wp_query->get( 'order' ) == 'DESC' ) { - $wp_query->set( 'order', 'ASC' ); - } - } else { - if ( ! $wp_query->get( 'orderby' ) ) { - $wp_query->set( 'orderby', 'menu_order' ); - } - if ( ! $wp_query->get( 'order' ) ) { - $wp_query->set( 'order', 'ASC' ); - } - } - } - } - - function lsx_to_scporder_get_terms_orderby( $orderby, $args ) { - - if ( is_admin() ) { - return $orderby; - } - - if ( isset( $args['disabled_custom_post_order'] ) ) { - return $orderby; - } - - $tags = $this->get_to_scporder_options_tags(); - - if ( ! isset( $args['taxonomy'] ) ) { - return $orderby; - } - - $taxonomy = $args['taxonomy']; - if ( is_array( $taxonomy ) && count( $taxonomy ) == 1 ) { - $taxonomy = $taxonomy[0]; - } - if ( ! is_array( $taxonomy ) && ! array_key_exists( $taxonomy, $tags ) ) { - return $orderby; - } - - $orderby = 't.lsx_to_term_order'; - - return $orderby; - } - - function lsx_to_scporder_get_object_terms( $terms, $not_used, $args_1, $args_2 = null ) { - $tags = $this->get_to_scporder_options_tags(); - - if ( is_admin() && isset( $_GET['orderby'] ) ) { - return $terms; - } - - $args = is_null( $args_2 ) || ! is_array( $args_2 ) ? $args_1 : $args_2; - - if ( isset( $args['disabled_custom_post_order'] ) ) { - return $terms; - } - - foreach ( $terms as $key => $term ) { - if ( is_object( $term ) && isset( $term->taxonomy ) ) { - $taxonomy = $term->taxonomy; - if ( ! array_key_exists( $taxonomy, $tags ) ) { - return $terms; - } - } else { - return $terms; - } - } - usort( $terms, array( $this, 'taxcmp' ) ); - return $terms; - } - - function taxcmp( $a, $b ) { - if ( $a->lsx_to_term_order == $b->lsx_to_term_order ) { - return 0; - } - - return ( $a->lsx_to_term_order < $b->lsx_to_term_order ) ? - 1 : 1; - } - - function get_to_scporder_options_objects() { - $tour_operator = tour_operator()->legacy; - - return apply_filters( 'lsx_to_scpo_engine_objects', $tour_operator->post_types ); - } - - function get_to_scporder_options_tags() { - $tour_operator = tour_operator()->legacy; - - return apply_filters( 'lsx_to_scpo_engine_taxonomies', $tour_operator->taxonomies ); - } - -} diff --git a/includes/classes/legacy/class-tour-operator.php b/includes/classes/legacy/class-tour-operator.php index c9c13988..37b4b835 100644 --- a/includes/classes/legacy/class-tour-operator.php +++ b/includes/classes/legacy/class-tour-operator.php @@ -166,9 +166,6 @@ private function __construct() { add_action( 'init', array( $this, 'disable_deprecated' ), 0 ); add_action( 'plugins_loaded', array( $this, 'trigger_schema' ), 10 ); - // Start sort engine. - new SCPO_Engine(); - // Set the options. $this->options = get_option( 'lsx_to_settings', array() ); $this->set_vars(); @@ -223,11 +220,11 @@ public function trigger_schema() { */ public static function register_activation_hook() { self::compatible_version_check_on_activation(); - + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! is_network_admin() && ! isset( $_GET['activate-multi'] ) ) { set_transient( '_tour_operators_flush_rewrite_rules', 1, 30 ); } - + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended if ( ! is_network_admin() && ! isset( $_GET['activate-multi'] ) ) { set_transient( '_tour_operators_welcome_redirect', 1, 30 ); } @@ -327,8 +324,6 @@ public function set_map_vars() { $this->map_post_types = array( 'accommodation', 'activity', 'destination' ); $this->markers = new \stdClass(); - do_action( 'qm/debug', $this->options['googlemaps_key'] ); - if ( ( false !== $this->options && isset( $this->options['googlemaps_key'] ) ) || defined( 'GOOGLEMAPS_API_KEY' ) ) { if ( ! defined( 'GOOGLEMAPS_API_KEY' ) ) { $this->google_api_key = $this->options['googlemaps_key']; @@ -472,162 +467,6 @@ public function taxonomies_filter( $taxonomies ) { return $taxonomies; } - /** - * A filter that outputs the tagline for the current page. - * - * @param string|bool $tagline Tagline to use or false to use internal. - * @param string $before Before code. - * @param string $after After code. - * - * @return string HTML tagline string. - */ - public function get_tagline( $tagline = false, $before = '', $after = '' ) { - $post_id = get_the_ID(); - - if ( ! empty( $post_id ) ) { - $post_id = get_the_ID(); - $tagline_value = get_post_meta( $post_id, 'banner_subtitle', true ); - - if ( false !== $tagline_value ) { - $tagline = $tagline_value; - } else { - $tagline_value = get_post_meta( $post_id, 'tagline', true ); - - if ( false !== $tagline_value ) { - $tagline = $tagline_value; - } - } - } else { - $post_type = get_query_var( 'post_type' ); - - if ( is_post_type_archive( $this->active_post_types ) && isset( $this->options[ $post_type ] ) && isset( $this->options[ $post_type ]['tagline'] ) ) { - $tagline = $this->options[ $post_type ]['tagline']; - } elseif ( is_tax( array_keys( $this->taxonomies ) ) ) { - $taxonomy_tagline = get_term_meta( get_queried_object_id(), 'tagline', true ); - if ( false !== $taxonomy_tagline && '' !== $taxonomy_tagline ) { - $tagline = $taxonomy_tagline; - } - } - } - - if ( false !== $tagline && '' !== $tagline ) { - $tagline = $before . $tagline . $after; - } - - return $tagline; - } - - /** - * checks which plugin is active, and grabs those forms. - */ - public function show_default_form() { - if ( class_exists( 'Caldera_Forms_Forms' ) || class_exists( 'GFForms' ) || class_exists( 'Ninja_Forms' ) || class_exists( 'WPForms' ) ) { - return true; - } else { - return false; - } - } - - /** - * checks which plugin is active, and grabs those forms. - */ - public function get_activated_forms() { - $all_forms = false; - - if ( class_exists( 'WPForms' ) ) { - $all_forms = $this->get_wpforms(); - } elseif ( class_exists( 'Ninja_Forms' ) ) { - $all_forms = $this->get_ninja_forms(); - } elseif ( class_exists( 'GFForms' ) ) { - $all_forms = $this->get_gravity_forms(); - } elseif ( class_exists( 'Caldera_Forms_Forms' ) ) { - $all_forms = $this->get_caldera_forms(); - } - - return $all_forms; - } - - /** - * gets the current wpforms - */ - public function get_wpforms() { - global $wpdb; - $forms = false; - - $args = array( - 'post_type' => 'wpforms', - 'orderby' => 'id', - 'order' => 'ASC', - 'no_found_rows' => true, - 'nopaging' => true, - ); - - $posts = get_posts( $args ); - - if ( ! empty( $posts ) ) { - foreach ( $posts as $post ) { - $forms[ $post->ID ] = $post->post_title; - } - } else { - $forms = false; - } - return $forms; - } - - /** - * gets the currenct ninja forms - */ - public function get_ninja_forms() { - global $wpdb; - - $results = $wpdb->get_results( "SELECT id,title FROM {$wpdb->prefix}nf3_forms" ); - $forms = false; - - if ( ! empty( $results ) ) { - foreach ( $results as $form ) { - $forms[ $form->id ] = $form->title; - } - } - - return $forms; - } - - /** - * gets the currenct gravity forms - */ - public function get_gravity_forms() { - global $wpdb; - - $results = \RGFormsModel::get_forms( null, 'title' ); - $forms = false; - - if ( ! empty( $results ) ) { - foreach ( $results as $form ) { - $forms[ $form->id ] = $form->title; - } - } - - return $forms; - } - - /** - * gets the currenct caldera forms - */ - public function get_caldera_forms() { - global $wpdb; - - $results = \Caldera_Forms_Forms::get_forms( true ); - $forms = false; - - if ( ! empty( $results ) ) { - foreach ( $results as $form => $form_data ) { - $forms[ $form ] = $form_data['name']; - } - } - - return $forms; - } - /** * Make TO last plugin to load. */ diff --git a/includes/classes/legacy/class-tour.php b/includes/classes/legacy/class-tour.php index e953be40..28bdb48f 100644 --- a/includes/classes/legacy/class-tour.php +++ b/includes/classes/legacy/class-tour.php @@ -73,7 +73,7 @@ private function __construct() { add_filter( 'lsx_to_custom_field_query', array( $this, 'rating' ), 10, 5 ); - add_action( 'lsx_to_modal_meta', array( $this, 'content_meta' ) ); + add_filter( 'body_class', array( $this, 'tour_classes' ), 10, 1 ); } /** @@ -141,16 +141,32 @@ public function price_filter( $html = '', $meta_key = false, $value = false, $be $value = preg_replace( '/[^0-9,.]/', '', $value ); $value = ltrim( $value, '.' ); $value = str_replace( ',', '', $value ); - $value = number_format( (int) $value, 2 ); $tour_operator = tour_operator(); $currency = ''; + $letter_code = ''; + $value = number_format( (int) $value, 2 ); + // Get the currency settings if ( is_object( $tour_operator ) && isset( $tour_operator->options['currency'] ) && ! empty( $tour_operator->options['currency'] ) ) { - $currency = $tour_operator->options['currency']; - $currency = '' . $currency . ''; + $letter_code = $tour_operator->options['currency']; + $currency = ''; } $value = $currency . $value; + + // Get the Sale Price + if ( 'price' === $meta_key ) { + $sale_price = get_post_meta( get_the_ID(), 'sale_price', true ); + if ( false !== $sale_price && ! empty( $sale_price ) && 0 !== intval( $sale_price ) ) { + $value = '' . $value . '' . ' ' . $currency . number_format( intval( $sale_price ) , 2 ); + } + } + + // Get the currency settings + if ( is_object( $tour_operator ) && ( isset( $tour_operator->options['country_code_disabled'] ) && 0 === intval( $tour_operator->options['country_code_disabled'] ) || ! isset( $tour_operator->options['country_code_disabled'] ) ) ) { + $value = $letter_code . $value; + } + $html = $before . $value . $after; } return $html; @@ -190,24 +206,20 @@ public function rating( $html = '', $meta_key = false, $value = false, $before = } /** - * Outputs the tour meta on the modal + * Adds in the onsale classes. + * + * @param array $classes + * @return array */ - public function content_meta() { - if ( 'tour' === get_post_type() ) { - ?> - ', '' ); - lsx_to_duration( ' ', '' ); - the_terms( get_the_ID(), 'travel-style', ' ', ', ', '' ); - lsx_to_connected_countries( ' ', '', true ); - - if ( function_exists( 'lsx_to_connected_activities' ) ) { - lsx_to_connected_activities( ' ', '' ); - } - ?> - esc_html__( 'AUD (australian dollar)', 'tour-operator' ), ), ), + 'country_code_disabled' => array( + 'label' => esc_html__( 'Disable Country Code', 'tour-operator' ), + 'desc' => esc_html__( 'This will disable the 3 letter code which outputs before the price.', 'tour-operator' ), + 'type' => 'checkbox', + 'default' => 0, + ), ), 'maps' => array( 'maps_disabled' => array( diff --git a/includes/pages/config-tour-operator.php b/includes/pages/config-tour-operator.php index b0675ab0..8a14c0c7 100644 --- a/includes/pages/config-tour-operator.php +++ b/includes/pages/config-tour-operator.php @@ -16,6 +16,9 @@ 'menu_position' => 6, 'capability' => 'edit_posts', 'icon' => 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IiB2aWV3Qm94PSIwIDAgMjAgMjAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDIwIDIwO2ZpbGw6IzgyODc4YzsiIHhtbDpzcGFjZT0icHJlc2VydmUiPjxnIGlkPSJYTUxJRF8xMV8iPjxwYXRoIGlkPSJYTUxJRF8xOF8iIGQ9Ik0xMCwwQzQuNSwwLDAsNC41LDAsMTBzNC41LDEwLDEwLDEwczEwLTQuNSwxMC0xMFMxNS41LDAsMTAsMHogTTEwLDE4LjNjLTQuNiwwLTguMy0zLjctOC4zLTguM2MwLTQuNiwzLjctOC4zLDguMy04LjNjNC42LDAsOC4zLDMuNyw4LjMsOC4zQzE4LjMsMTQuNiwxNC42LDE4LjMsMTAsMTguM3oiLz48cGF0aCBpZD0iWE1MSURfMTlfIiBkPSJNMTAuOCw4LjlMMTAuOCw4LjlMMTAuOCw4LjljLTAuMS0wLjEtMC4yLTAuMS0wLjMtMC4yTDYuMSw2LjFsMi43LDQuNWMwLDAuMSwwLjEsMC4xLDAuMSwwLjJsMCwwbDAsMGMwLjIsMC4zLDAuNiwwLjYsMS4xLDAuNmMwLjgsMCwxLjQtMC42LDEuNC0xLjRDMTEuNCw5LjYsMTEuMiw5LjIsMTAuOCw4Ljl6IE0xMCwxMC43Yy0wLjQsMC0wLjctMC4zLTAuNy0wLjdjMC0wLjQsMC4zLTAuNywwLjctMC43czAuNywwLjMsMC43LDAuN0MxMC43LDEwLjQsMTAuNCwxMC43LDEwLDEwLjd6Ii8+PGcgaWQ9IlhNTElEXzE2XyI+PHJlY3QgaWQ9IlhNTElEXzhfIiB4PSI5LjciIHk9IjIuOSIgd2lkdGg9IjAuNiIgaGVpZ2h0PSIxLjMiLz48cmVjdCBpZD0iWE1MSURfN18iIHg9IjUuMSIgeT0iNC44IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjcwNzEgLTAuNzA3MSAwLjcwNzEgMC43MDcxIC0yLjI1OTQgNS40MTg2KSIgd2lkdGg9IjAuNiIgaGVpZ2h0PSIxLjMiLz48cmVjdCBpZD0iWE1MSURfNl8iIHg9IjEzLjkiIHk9IjUuMSIgdHJhbnNmb3JtPSJtYXRyaXgoMC43MDcxIC0wLjcwNzEgMC43MDcxIDAuNzA3MSAwLjQxNjkgMTEuODc5NykiIHdpZHRoPSIxLjMiIGhlaWdodD0iMC42Ii8+PHJlY3QgaWQ9IlhNTElEXzVfIiB4PSIyLjkiIHk9IjkuNyIgd2lkdGg9IjEuMyIgaGVpZ2h0PSIwLjYiLz48cmVjdCBpZD0iWE1MSURfNF8iIHg9IjE1LjgiIHk9IjkuNyIgd2lkdGg9IjEuMyIgaGVpZ2h0PSIwLjYiLz48cmVjdCBpZD0iWE1MSURfM18iIHg9IjQuOCIgeT0iMTQuMyIgdHJhbnNmb3JtPSJtYXRyaXgoMC43MDcxIC0wLjcwNzEgMC43MDcxIDAuNzA3MSAtOC43MjE0IDguMDk1MikiIHdpZHRoPSIxLjMiIGhlaWdodD0iMC42Ii8+PHJlY3QgaWQ9IlhNTElEXzJfIiB4PSIxNC4yIiB5PSIxMy45IiB0cmFuc2Zvcm09Im1hdHJpeCgwLjcwNzEgLTAuNzA3MSAwLjcwNzEgMC43MDcxIC02LjA0NTEgMTQuNTU2MykiIHdpZHRoPSIwLjYiIGhlaWdodD0iMS4zIi8+PHJlY3QgaWQ9IlhNTElEXzFfIiB4PSI5LjciIHk9IjE1LjgiIHdpZHRoPSIwLjYiIGhlaWdodD0iMS4zIi8+PC9nPjxwYXRoIGlkPSJYTUxJRF80N18iIGQ9Ik0xMS4zLDkuNWMwLTAuMS0wLjEtMC4xLTAuMS0wLjJsMCwwbDAsMGMtMC4yLTAuMy0wLjYtMC42LTEuMS0wLjZjLTAuOCwwLTEuNCwwLjYtMS40LDEuNGMwLDAuNCwwLjIsMC44LDAuNSwxLjFsMCwwbDAsMGMwLjEsMC4xLDAuMiwwLjEsMC4zLDAuMmw0LjQsMi42TDExLjMsOS41eiBNMTAsMTAuN2MtMC40LDAtMC43LTAuMy0wLjctMC43YzAtMC40LDAuMy0wLjcsMC43LTAuN3MwLjcsMC4zLDAuNywwLjdDMTAuNywxMC40LDEwLjQsMTAuNywxMCwxMC43eiIvPjwvZz48L3N2Zz4=', + 'callback' => function () { + include( LSX_TO_PATH . 'includes/partials/welcome.php' ); + }, ); return $page; diff --git a/includes/partials/add-ons.php b/includes/partials/add-ons.php index 8ac00a67..323f7b8d 100644 --- a/includes/partials/add-ons.php +++ b/includes/partials/add-ons.php @@ -1,4 +1,5 @@
- + +

diff --git a/includes/partials/navigation.php b/includes/partials/navigation.php index 8d41ed68..c70dc7e4 100644 --- a/includes/partials/navigation.php +++ b/includes/partials/navigation.php @@ -4,8 +4,10 @@ '; - $return .= ''; - $return .= '
'; - } - } - $return .= '
'; - - if ( ! empty( $return ) ) { - $return = $before . $return . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } - } else { - return false; - } - } else { - return false; - } -} - -/** - * Outputs the Spoken Languages HTML - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category accommodation - */ -function lsx_to_accommodation_spoken_languages( $before = '', $after = '', $echo = true ) { - $spoken_languages = get_post_meta( get_the_ID(), 'spoken_languages', true ); - - if ( is_string( $spoken_languages ) && ! empty( $spoken_languages ) ) { - $spoken_languages = array( $spoken_languages ); - } - - $return = ''; - - if ( ! empty( $spoken_languages ) && ! is_wp_error( $spoken_languages ) ) { - foreach ( $spoken_languages as $i => $spoken_language ) { - $return .= ucwords( str_replace( '_', ' / ', str_replace( '-', ' ', str_replace( '-and-', ' & ', $spoken_language ) ) ) ); - - if ( ( $i + 1 ) < count( $spoken_languages ) ) { - $return .= ', '; - } - } - $return = $before . $return . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } else { - return false; - } -} - -/** - * Outputs the Special Interests HTML - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category accommodation - */ -function lsx_to_accommodation_special_interests( $before = '', $after = '', $echo = true, $post_id = false ) { - if ( false === $post_id ) { - $post_id = get_the_ID(); - } - - $special_interests = get_post_meta( $post_id, 'special_interests', true ); - - if ( is_string( $special_interests ) && ! empty( $special_interests ) ) { - $special_interests = array( $special_interests ); - } - - $return = ''; - - if ( ! empty( $special_interests ) && ! is_wp_error( $special_interests ) ) { - foreach ( $special_interests as $i => $special_interest ) { - $return .= ucwords( str_replace( '_', ' / ', str_replace( '-', ' ', str_replace( '-and-', ' & ', $special_interest ) ) ) ); - - if ( ( $i + 1 ) < count( $special_interests ) ) { - $return .= ', '; - } - } - $return = $before . $return . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } else { - return false; - } -} - -/** - * Outputs the Friendly HTML - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category accommodation - * @category activity - */ -function lsx_to_accommodation_activity_friendly( $before = '', $after = '', $echo = true ) { - $friendly = get_post_meta( get_the_ID(), 'suggested_visitor_types', true ); - - if ( is_string( $friendly ) && ! empty( $friendly ) ) { - $friendly = array( $friendly ); - } - - $return = ''; - - if ( ! empty( $friendly ) && ! is_wp_error( $friendly ) ) { - foreach ( $friendly as $i => $friendly_item ) { - $return .= ucwords( str_replace( '_', ' / ', str_replace( '-', ' ', str_replace( '-and-', ' & ', $friendly_item ) ) ) ); - - if ( ( $i + 1 ) < count( $friendly ) ) { - $return .= ', '; - } - } - $return = $before . $return . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } else { - return false; - } -} - -/** - * Outputs the accommodation meta - * - * @package tour-operator - * @subpackage template-tags - * @category accommodation - */ -function lsx_to_accommodation_meta() { - if ( 'accommodation' === get_post_type() ) { - $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; - - lsx_to_price( ' ', '' ); - lsx_to_accommodation_room_total( ' ', '' ); - lsx_to_accommodation_rating( ' ', '' ); - the_terms( get_the_ID(), 'travel-style', ' ', ', ', '' ); - the_terms( get_the_ID(), 'accommodation-brand', ' ', ', ', '' ); - the_terms( get_the_ID(), 'accommodation-type', ' ', ', ', '' ); - lsx_to_accommodation_spoken_languages( ' ', '' ); - lsx_to_accommodation_activity_friendly( ' ', '' ); - lsx_to_accommodation_special_interests( ' ', '' ); - lsx_to_connected_countries( ' ', '' ); - } -} - -/** - * Gets the current specials connected accommodation - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category connections - */ -function lsx_to_connected_accommodation( $before = '', $after = '', $echo = true ) { - lsx_to_connected_items_query( 'accommodation', get_post_type(), $before, $after, $echo ); -} diff --git a/includes/template-tags/addons.php b/includes/template-tags/addons.php deleted file mode 100644 index ced10d49..00000000 --- a/includes/template-tags/addons.php +++ /dev/null @@ -1,25 +0,0 @@ - 'post', - 'to' => 'destination', - 'column' => '3', - 'before' => '

' . esc_html__( 'Featured Posts', 'tour-operator' ) . '

', - 'after' => '
', - ); - - lsx_to_connected_panel_query( $args ); -} - -/** - * Outputs the connected accommodation only on a "region" - * - * @package tour-operator - * @subpackage template-tags - * @category destination - */ -function lsx_to_region_accommodation() { - global $lsx_to_archive; - - if ( post_type_exists( 'accommodation' ) && is_singular( 'destination' ) && ! lsx_to_item_has_children( get_the_ID(), 'destination' ) ) { - $args = array( - 'from' => 'accommodation', - 'to' => 'destination', - 'column' => '3', - 'before' => '

' . lsx_to_get_post_type_section_title( 'accommodation', '', esc_html__( 'Featured Accommodation', 'tour-operator' ) ) . '

', - 'after' => '
', - ); - - lsx_to_connected_panel_query( $args ); - } -} - -/** - * Outputs the destinations attached tours - * - * @package tour-operator - * @subpackage template-tags - * @category destination - */ -function lsx_to_destination_tours() { - global $lsx_to_archive, $wp_query; - - if ( post_type_exists( 'tour' ) && is_singular( 'destination' ) ) { - $args = array( - 'from' => 'tour', - 'to' => 'destination', - 'column' => '3', - 'before' => '

' . lsx_to_get_post_type_section_title( 'tour', '', esc_html__( 'Featured Tours', 'tour-operator' ) ) . '

', - 'after' => '
', - ); - - lsx_to_connected_panel_query( $args ); - } -} - -/** - * Outputs the destinations attached activites - * - * @package tour-operator - * @subpackage template-tags - * @category destination - */ -function lsx_to_destination_activities() { - global $lsx_to_archive; - - if ( post_type_exists( 'activity' ) && is_singular( 'destination' ) && ! lsx_to_item_has_children( get_the_ID(), 'destination' ) ) { - $args = array( - 'from' => 'activity', - 'to' => 'destination', - // 'content_part' => 'widget-activity', - 'column' => '3', - 'before' => '

' . lsx_to_get_post_type_section_title( 'activity', '', esc_html__( 'Featured Activities', 'tour-operator' ) ) . '

', - 'after' => '
', - ); - - lsx_to_connected_panel_query( $args ); - } -} - -/** - * Outputs the destination travel info - * - * @package tour-operator - * @subpackage template-tags - * @category destination - */ -function lsx_to_destination_travel_info() { - $electricity = get_post_meta( get_the_ID(), 'electricity', true ); - $banking = get_post_meta( get_the_ID(), 'banking', true ); - $cuisine = get_post_meta( get_the_ID(), 'cuisine', true ); - $climate = get_post_meta( get_the_ID(), 'climate', true ); - $transport = get_post_meta( get_the_ID(), 'transport', true ); - $dress = get_post_meta( get_the_ID(), 'dress', true ); - $health = get_post_meta( get_the_ID(), 'health', true ); - $safety = get_post_meta( get_the_ID(), 'safety', true ); - $visa = get_post_meta( get_the_ID(), 'visa', true ); - $general = get_post_meta( get_the_ID(), 'additional_info', true ); - - if ( ! empty( $electricity ) || ! empty( $banking ) || ! empty( $cuisine ) || ! empty( $climate ) || ! empty( $transport ) || ! empty( $dress ) || ! empty( $health ) || ! empty( $safety ) || ! empty( $visa ) || ! empty( $general ) ) : - $limit_words = 20; - $limit_chars = 150; - $more_button = "\n\n" . 'Read More' . "\n\n"; - - $items = array( - esc_html__( 'Electricity', 'tour-operator' ) => $electricity, - esc_html__( 'Banking', 'tour-operator' ) => $banking, - esc_html__( 'Cuisine', 'tour-operator' ) => $cuisine, - esc_html__( 'Climate', 'tour-operator' ) => $climate, - esc_html__( 'Transport', 'tour-operator' ) => $transport, - esc_html__( 'Dress', 'tour-operator' ) => $dress, - esc_html__( 'Health', 'tour-operator' ) => $health, - esc_html__( 'Safety', 'tour-operator' ) => $safety, - esc_html__( 'Visa', 'tour-operator' ) => $visa, - esc_html__( 'General', 'tour-operator' ) => $general, - ); - ?> -
-

>

- -
-
-
-
-
-
- $value ) : ?> - -
-
> - - -
-

- -

', ' - ', $value ); - $value = str_replace( array( '

', '

' ), '', $value ); - $value = str_replace( '
', ' - ', $value ); - - // if ( str_word_count( $value, 0 ) > $limit_chars ) { - // $tokens = array(); - // $value_output = ''; - // $has_more = false; - // $count = 0; - - // preg_match_all( '/(<[^>]+>|[^<>\s]+)\s*/u', $value, $tokens ); - - // foreach ( $tokens[0] as $token ) { - // if ( $count >= $limit_words ) { - // $value_output .= trim( $token ); - // $has_more = true; - // break; - // } - - // $count++; - // $value_output .= $token; - // } - - // $value = trim( force_balance_tags( $value_output . '...' ) ); - // } - - if ( strlen( $value ) > $limit_chars ) { - $position = strpos( $value, ' ', $limit_chars ); - $value_output = substr( $value, 0, $position ); - - $value = trim( force_balance_tags( $value_output . '...' ) ); - } - - $value = trim( force_balance_tags( $value . $more_button ) ); - - echo wp_kses_post( apply_filters( 'the_content', $value ) ); - ?> -

-
-
- - -
-
-
-
-
-
-
- $theid, - 'post_type' => 'destination', - ) ); - $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; - if ( $child->have_posts() ) { - $list_destinations = array(); - $final_list_destinations = ''; - echo ''; - while ( $child->have_posts() ) { - $child->the_post(); - $childtitle = get_the_title(); - $childlink = get_the_permalink(); - $list_destinations[] = ' ' . esc_attr( $childtitle ) . ''; - } - $final_list_destinations = implode( ', ', $list_destinations ); - echo wp_kses_post( $final_list_destinations ); - } else { - echo ''; - $parent_title = get_the_title( wp_get_post_parent_id( $theid ) ); - $parent_link = get_the_permalink( wp_get_post_parent_id( $theid ) ); - echo ' ' . esc_attr( $parent_title ) . ''; - } - echo ''; - wp_reset_postdata(); -} - -/** - * Gets the current best months to visit - * - * - * @package tour-operator - * @subpackage template-tags - * @category connections - */ - -function months_to_visit() { - $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; - $months = get_post_meta( get_the_ID(), 'best_time_to_visit', true ); - $month_list = array(); - - foreach ( (array) $months as $single_month ) { - $single_month = str_split( $single_month, 3 ); - $month_list[] = '' . $single_month[0] . - ''; - } - - if ( ! empty( $months ) ) { - echo ''; - echo ( implode( ', ', $month_list ) ); - echo ''; - } - -} diff --git a/includes/template-tags/general.php b/includes/template-tags/general.php index aeb27d07..2fc7605e 100644 --- a/includes/template-tags/general.php +++ b/includes/template-tags/general.php @@ -8,587 +8,188 @@ * @license GPL3 */ -/* ================== LAYOUT ================== */ - /** - * Returns the CSS class for the archive panels - * - * @package tour-operator - * @subpackage template-tags - * @category class - */ -function lsx_to_archive_class( $classes = array() ) { - $layout = tour_operator()->archive_layout; - - if ( ! is_array( $classes ) ) { - $classes = explode( ' ', $classes ); - } - - $new_classes = $classes; - - if ( 'grid' === $layout ) { - $new_classes[] = 'col-xs-12 col-sm-6 col-md-4'; - } else { - $new_classes[] = 'col-xs-12'; - } + * Used Functions + */ - $new_classes = apply_filters( 'lsx_to_archive_class', $new_classes, $classes, $layout ); - - return implode( ' ', $new_classes ); -} +// =============== Itinerary =================== /** - * Outputs the CSS class for the widget panels + * Outputs The current Itinerary connected destinations, can only be used in + * the itinerary loop. * - * @package tour-operator - * @subpackage template-tags - * @category class + * @package tour-operator + * @subpackage template-tags + * @category itinerary */ -function lsx_to_widget_class( $type = '', $return = false ) { - global $columns; - - $cols = 'col-xs-12 col-sm-'; - $cols .= '5' == $columns ? '15' : 12 / $columns; - - $class = 'lsx-to-widget-item-wrap lsx-' . $type . ' ' . $cols; - - if ( false === $return ) { - echo 'class="' . esc_attr( $class ) . '"'; - } else { - return 'class="' . $class . '"'; - } -} - -/** - * Outputs the 'content' class. - * - * @param $classes string or array - */ -function lsx_to_entry_class( $classes = false ) { - global $post; - - if ( false !== $classes ) { - if ( ! is_array( $classes ) ) { - $classes = explode( ' ', $classes ); - } - - $classes = apply_filters( 'lsx_to_entry_class', $classes, $post->ID ); - } - - echo wp_kses_post( 'class="' . implode( ' ', $classes ) . '"' ); -} - -/** - * Outputs the 'content' class. - * - * @param $classes string or array - */ -function lsx_to_column_class( $classes = false ) { - global $post; - - if ( false !== $classes ) { - if ( ! is_array( $classes ) ) { - $classes = explode( ' ', $classes ); +function lsx_to_itinerary_room_basis( $before = '', $after = '', $echo = true ) { + global $tour_itinerary; + if ( $tour_itinerary && $tour_itinerary->has_itinerary && ! empty( $tour_itinerary->itinerary ) ) { + if ( ! empty( $tour_itinerary->itinerary['room_basis'] ) && 'None' !== $tour_itinerary->itinerary['room_basis'] ) { + $label = lsx_to_room_basis_label( $tour_itinerary->itinerary['room_basis'] ); + if ( $echo ) { + echo wp_kses_post( $before . $label . $after ); + } else { + return $before . $label . $after; + } } - $classes = apply_filters( 'lsx_to_column_class', $classes, $post->ID ); } - - echo wp_kses_post( 'class="' . implode( ' ', $classes ) . '"' ); + return ''; } /** - * Returns the collapsible class if it is active. + * Return the Room basis Label. * - * @param bool $post_type - * @param bool $return + * @param string $index * @return string */ -function lsx_to_collapsible_class( $post_type = false, $return = true ) { - if ( false === $post_type ) { - $post_type = get_post_type(); +function lsx_to_room_basis_label( $index = '' ) { + $label = $index; + if ( isset( tour_operator()->legacy->tour->room_basis[ $index ] ) ) { + $label = tour_operator()->legacy->tour->room_basis[ $index ]; } - if ( ! lsx_to_is_collapsible( $post_type ) ) { - - $output = 'lsx-to-collapse-section'; - if ( false === $return ) { - echo esc_attr( $output ); - } else { - return $output; - } - } -} - -/** - * Returns the collapsible class if it is active. - * - * @param bool $target - * @param bool $post_type - * @param bool $return - * @return string - */ -function lsx_to_collapsible_attributes( $target = false, $post_type = false, $return = true ) { - if ( false === $post_type ) { - $post_type = get_post_type(); - } - if ( ! lsx_to_is_collapsible( $post_type ) ) { - $output = 'data-toggle="collapse" data-target="#' . $target . '"'; - if ( false === $return ) { - echo esc_attr( $output ); - } else { - return $output; - } - } -} - -function lsx_to_collapsible_attributes_not_post( $target = false, $return = true ) { - //$output = 'data-toggle="collapse" data-target="#' . $target . '"'; - $output = 'data-toggle='; - $output .= 'collapse'; - $output .= ' '; - $output .= 'data-target='; - $output .= '#' . $target; - echo esc_attr( $output ); -} - -/* ================== HEADER ================== */ - -/** - * Global header. - * - * @package tour-operator - * @subpackage template-tag - * @category header - */ -function lsx_to_global_header() { - $default_size = 'sm'; - $size = apply_filters( 'lsx_bootstrap_column_size', $default_size ); - ?> -
-
-

- -

- - ', '

' ); ?> -
- - -
-
', '
' ) ); + return $label; } - -/* ================== SINGLE ================== */ - /** - * Outputs the Single pages navigation + * Return the Drinks basis Label. * - * @param $echo + * @param string $index * @return string - * - * @package tour-operator - * @subpackage template-tag - * @category navigation */ -function lsx_to_page_navigation( $echo = true ) { - $page_links = array(); - - if ( is_single() ) { - $page_links['summary'] = esc_html__( 'Summary', 'tour-operator' ); - } - - // Allow 3rd party plugins and themes to disable the page links. - if ( apply_filters( 'lsx_to_page_navigation_disable', false, get_post_type() ) ) { - return false; - } - - $page_links = apply_filters( 'lsx_to_page_navigation', $page_links ); - - if ( ! empty( $page_links ) && count( $page_links ) > 1 ) { - $return = '
'; - $return .= ''; - $return .= '
'; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } +function lsx_to_drinks_basis_label( $index = '' ) { + $label = $index; + if ( isset( tour_operator()->legacy->tour->drinks_basis[ $index ] ) ) { + $label = tour_operator()->legacy->tour->drinks_basis[ $index ]; } + return $label; } /** - * outputs the sharing + * Outputs The current Itinerary connected destinations, can only be used in + * the itinerary loop. * - * @package tour-operator - * @subpackage setup - * @category helper + * @package tour-operator + * @subpackage template-tags + * @category itinerary */ -function lsx_to_sharing() { - echo '
'; - - if ( class_exists( 'LSX_Sharing' ) ) { - global $lsx_sharing; - echo wp_kses_post( $lsx_sharing->sharing_buttons() ); - } else { - if ( function_exists( 'sharing_display' ) ) { - sharing_display( '', true ); - } - - if ( class_exists( 'Jetpack_Likes' ) ) { - $custom_likes = new Jetpack_Likes(); - echo wp_kses_post( $custom_likes->post_likes( '' ) ); +function lsx_to_itinerary_drinks_basis( $before = '', $after = '', $echo = true ) { + global $tour_itinerary; + if ( $tour_itinerary && $tour_itinerary->has_itinerary && ! empty( $tour_itinerary->itinerary ) ) { + if ( ! empty( $tour_itinerary->itinerary['drinks_basis'] ) && 'None' !== $tour_itinerary->itinerary['drinks_basis'] ) { + $label = lsx_to_drinks_basis_label( $tour_itinerary->itinerary['drinks_basis'] ); + if ( $echo ) { + echo wp_kses_post( $before . $label . $after ); + } else { + return $before . $label . $after; + } } } - - echo '
'; + return ''; } -/* ================== TAXONOMIES ================== */ - -/** - * Outputs the widget with some styling - * - * @package tour-operator - * @subpackage template-tags - * @category helper - */ -function lsx_to_safari_brands( $before = '', $after = '', $echo = true ) { - $args = array( - 'name' => 'Home', - 'id' => 'sidebar-home', - 'description' => '', - 'class' => '', - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - 'widget_id' => 'lsx_to_taxonomy_widget-6', - 'widget_name' => 'LSX Taxonomies', - ); - $instance = array( - 'title' => '', - 'title_link' => '', - 'columns' => '4', - 'orderby' => 'menu_order', - 'order' => 'ASC', - 'limit' => '100', - 'include' => '', - 'size' => '100', - 'buttons' => '', - 'button_text' => '', - 'responsive' => '1', - 'carousel' => '1', - 'taxonomy' => 'accommodation-brand', - 'class' => '', - 'interval' => '7000', - 'indicators' => '1', - ); - $safari_brands = new \lsx\legacy\Taxonomy_Widget(); - ob_start(); - $safari_brands->widget( $args, $instance ); - $return = ob_get_clean(); - $return = $before . $return . $after; - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } -} -/** - * Outputs the travel styles widget with some styling - * - * @package tour-operator - * @subpackage template-tags - * @category helper - */ -function lsx_to_travel_styles( $before = '', $after = '', $echo = true ) { - $args = array( - 'name' => 'Home', - 'id' => 'sidebar-home', - 'description' => '', - 'class' => '', - 'before_widget' => '', - 'before_title' => '

', - 'after_title' => '

', - 'widget_id' => 'lsx_to_taxonomy_widget-6', - 'widget_name' => 'LSX Taxonomies', - ); - $instance = array( - 'title' => '', - 'title_link' => '', - 'columns' => '3', - 'orderby' => 'rand', - 'order' => 'DESC', - 'limit' => '100', - 'include' => '', - 'size' => '100', - 'buttons' => '', - 'button_text' => '', - 'responsive' => '1', - 'carousel' => '1', - 'taxonomy' => 'travel-style', - 'class' => '', - 'interval' => '7000', - 'indicators' => '1', - ); - $travel_styles = new \lsx\legacy\Taxonomy_Widget(); - ob_start(); - $travel_styles->widget( $args, $instance ); - $return = ob_get_clean(); - $return = $before . $return . $after; - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } -} +// =============== Tours =================== -/* ================== ENQUIRE ================== */ /** - * Test if Enquire Contact exists + * Retrieves the accommodation ids from the itinerary, mostly for use in the map. + * the itinerary loop. * - * @return boolean - * @package tour-operator - */ -function lsx_to_has_enquiry_contact() { - $tour_operator = tour_operator(); - - $has_enquiry_contact = false; - - if ( function_exists( 'lsx_to_has_team_member' ) ) { - $has_enquiry_contact = lsx_to_has_team_member(); - } - - if ( false === $has_enquiry_contact && isset( $tour_operator->options['general'] ) ) { - if ( isset( $tour_operator->options['general']['enquiry_contact_name'] ) && '' !== $tour_operator->options['general']['enquiry_contact_name'] ) { - $has_enquiry_contact = true; - } - - // First set the general form - if ( isset( $tour_operator->options['general']['enquiry'] ) && '' !== $tour_operator->options['general']['enquiry'] ) { - $has_enquiry_contact = true; - } - } - - return $has_enquiry_contact; -} -/** - * Display Enquire Contact + * @package tour-operator + * @subpackage template-tags + * @category itinerary * - * @return void - * @package tour-operator + * @param string $meta_key + * @param string $supress_filters + * @return array */ -function lsx_to_enquiry_contact( $before = '', $after = '' ) { - $tour_operator = tour_operator(); - - $fields = array( - 'enquiry_contact_name' => '', - 'enquiry_contact_email' => '', - 'enquiry_contact_phone' => '', - 'enquiry_contact_image_id' => '', - 'enquiry_contact_image' => '', - ); +function lsx_to_get_tour_itinerary_ids( $meta_key = 'accommodation_to_tour', $supress_filters = false ) { + $tour_itinerary = new \lsx\legacy\Itinerary_Query(); + $itinerary_ids = array(); - foreach ( $fields as $key => $field ) { - if ( isset( $tour_operator->options['general'] ) && isset( $tour_operator->options['general'][ $key ] ) ) { - $fields[ $key ] = $tour_operator->options['general'][ $key ]; - } + if ( false === $supress_filters ) { + $meta_key = apply_filters( 'lsx_to_get_itinerary_ids_meta_key', $meta_key ); } + + if ( $tour_itinerary->has_itinerary() ) { + $itinerary_count = 1; + while ( $tour_itinerary->while_itinerary() ) { + $tour_itinerary->current_itinerary_item(); - if ( ! empty( $fields['enquiry_contact_image_id'] ) ) { - $temp_src_array = wp_get_attachment_image_src( $fields['enquiry_contact_image_id'], 'medium' ); - - if ( is_array( $temp_src_array ) && count( $temp_src_array ) > 0 ) { - $fields['enquiry_contact_image'] = $temp_src_array[0]; + if ( ! empty( $tour_itinerary->itinerary[ $meta_key ] ) && '' !== $tour_itinerary->itinerary[ $meta_key] ) { + if ( ! is_array( $tour_itinerary->itinerary[ $meta_key ] ) ) { + $d_ids = array( $tour_itinerary->itinerary[ $meta_key ] ); + } else { + $d_ids = $tour_itinerary->itinerary[ $meta_key ]; + } + $itinerary_ids = array_merge( $itinerary_ids, array_values( $d_ids ) ); + } } } - - echo wp_kses_post( $before ); - ?> -
> - -
- ' ); ?> -
- - -
- Your travel expert: -

-
- - -
- options['general'] ) && isset( $tour_operator->options['general']['enquiry'] ) && '' !== $tour_operator->options['general']['enquiry'] ) { - $form_id = $tour_operator->options['general']['enquiry']; - } - - if ( is_singular( $tour_operator->active_post_types ) ) { - if ( isset( $tour_operator->options[ get_post_type() ] ) && isset( $tour_operator->options[ get_post_type() ]['enquiry'] ) && '' !== $tour_operator->options[ get_post_type() ]['enquiry'] ) { - $form_id = $tour_operator->options[ get_post_type() ]['enquiry']; + * @category accommodation + */ +function lsx_to_accommodation_facilities( $before = '', $after = '', $echo = true ) { + $args = []; + $facilities = wp_get_object_terms( get_the_ID(), 'facility' ); + $main_facilities = []; + $child_facilities = []; + $return = ''; + + if ( ! empty( $facilities ) && ! is_wp_error( $facilities ) ) { + foreach ( $facilities as $facility ) { + if ( 0 === $facility->parent ) { + $main_facilities[] = $facility; + } else { + $child_facilities[ $facility->parent ][] = $facility; } } - if ( is_archive( $tour_operator->active_post_types ) ) { - if ( isset( $tour_operator->options[ get_post_type() ] ) && isset( $tour_operator->options[ get_post_type() ]['enquiry'] ) && '' !== $tour_operator->options[ get_post_type() ]['enquiry'] ) { - $form_id = $tour_operator->options[ get_post_type() ]['enquiry']; - } - } - } - $link = '#'; + //Output in the order we want + if ( count( $main_facilities ) > 0 && count( $child_facilities ) > 0 ) { + $return .= '
'; + foreach ( $main_facilities as $heading ) { + if ( isset( $child_facilities[ $heading->term_id ] ) ) { + $return .= '

'; + $return .= '
    '; - if ( isset( $tour_operator->options['general'] ) && isset( $tour_operator->options['general']['disable_enquire_modal'] ) && 'on' === $tour_operator->options['general']['disable_enquire_modal'] ) { - if ( isset( $tour_operator->options['general']['enquire_link'] ) && '' !== $tour_operator->options['general']['enquire_link'] ) { - $link = $tour_operator->options['general']['enquire_link']; - } - } + foreach ( $child_facilities[ $heading->term_id ] as $child_facility ) { + $return .= '
  • ' . esc_html( $child_facility->name ) . '
  • '; + } - if ( is_singular( $tour_operator->active_post_types ) ) { - if ( isset( $tour_operator->options[ get_post_type() ] ) && isset( $tour_operator->options[ get_post_type() ]['disable_enquire_modal'] ) && 'on' === $tour_operator->options[ get_post_type() ]['disable_enquire_modal'] ) { - $disable_modal = true; - if ( isset( $tour_operator->options[ get_post_type() ]['enquire_link'] ) && '' !== $tour_operator->options[ get_post_type() ]['enquire_link'] ) { - $link = $tour_operator->options[ get_post_type() ]['enquire_link']; + $return .= '
'; + $return .= ''; + } } - } - } + $return .= ''; - if ( false !== $form_id ) { - ?> -
- data-toggle="modal" data-target="#lsx-enquire-modal" target="_blank" > + if ( ! empty( $return ) ) { + $return = $before . $return . $after; - - - -
- 'post_type', - 'label' => __( 'Destinations', 'lsx' ), - 'heirarchy' => true, - ); - - return $sitemap_loops; + } else { + return false; + } + } else { + return false; } - add_filter( 'lsx_sitemap_loops_list', 'to_sitemap_loops', 1 ); } diff --git a/includes/template-tags/helpers.php b/includes/template-tags/helpers.php index af69f52c..1389c36d 100644 --- a/includes/template-tags/helpers.php +++ b/includes/template-tags/helpers.php @@ -95,6 +95,7 @@ function lsx_to_item_has_children( $post_id = false, $post_type = false ) { $post_type = 'page'; } + // phpcs:disable WordPress.DB -- Start ignoring $children = $wpdb->get_results( $wpdb->prepare( "SELECT ID @@ -103,9 +104,11 @@ function lsx_to_item_has_children( $post_id = false, $post_type = false ) { AND post_parent = %d ORDER BY post_title ASC LIMIT 100", - $post_type,$post_id + $post_type, + $post_id ) ); + // phpcs:enable -- Stop ignoring if ( count( $children ) > 0 ) { return $children; @@ -185,6 +188,7 @@ function lsx_to_get_term_thumbnail( $term_id = false, $size = 'lsx-thumbnail-sin $term_thumbnail_id = get_term_meta( $term_id, 'thumbnail', true ); $img = wp_get_attachment_image_src( $term_thumbnail_id,$size ); $image_url = $img[0]; + // phpcs:ignore PluginCheck.CodeAnalysis.ImageFunctions.NonEnqueuedImage $img = 'thumbnail'; $img = apply_filters( 'lsx_lazyload_slider_images', $img, $term_thumbnail_id, $size, false, $image_url ); return $img; @@ -308,297 +312,6 @@ function lsx_to_custom_field_query( $meta_key = false, $before = '', $after = '' } } -/** - * Gets the list of connections requested - * - * @param $from | string - * @param $to | string - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @param $parent | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category helper - */ -function lsx_to_connected_items_query( $from = false, $to = false, $before = '', $after = '', $echo = false, $parents = false, $extra = false ) { - if ( post_type_exists( $from ) && post_type_exists( $to ) ) { - $connected_ids = get_post_meta( get_the_ID(), $from . '_to_' . $to, false ); - - if ( $parents ) { - $connected_ids = apply_filters( 'lsx_to_parents_only', $connected_ids, $from . '_to_' . $to ); - } - - if ( false !== $connected_ids && '' !== $connected_ids && ! empty( $connected_ids ) ) { - if ( ! is_array( $connected_ids ) ) { - $connected_ids = array( $connected_ids ); - } - - $return = $before . lsx_to_connected_list( $connected_ids, $from, true, ', ' ) . $after; - - if ( false !== $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } else { - return false; - } - } -} - -/** - * Gets the list of connections items, and displays them using the the specified content part. - * - * @param $args | array - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category helper - */ -function lsx_to_connected_panel_query( $args = false ) { - global $lsx_to_archive, $columns; - - if ( false !== $args && is_array( $args ) ) { - $defaults = array( - 'from' => false, - 'to' => false, - 'content_part' => false, - 'id' => false, - 'column' => false, - 'before' => '', - 'after' => '', - 'featured' => false, - 'orderby' => false, - 'items' => array(), - ); - - $args = wp_parse_args( $args, $defaults ); - - if ( false === $args['content_part'] ) { - $args['content_part'] = $args['from']; - } - - if ( empty( $args['items'] ) ) { - $items_array = get_post_meta( get_the_ID(), $args['from'] . '_to_' . $args['to'], false ); - } else { - $items_array = $args['items']; - } - - if ( false !== $items_array && is_array( $items_array ) && ! empty( $items_array ) ) { - $items_query_args = array( - 'post_type' => $args['from'], - 'post_status' => 'publish', - 'post__in' => $items_array, - ); - - if ( false !== $args['orderby'] ) { - $items_query_args['orderby'] = $args['orderby']; - } - - if ( true === $args['featured'] || 'true' === $args['featured'] ) { - $items_query_args['meta_query'] = array( - 'relation' => 'OR', - array( - 'key' => 'featured', - 'value' => true, - 'compare' => '=', - ), - ); - - if ( 'accommodation' === $args['from'] ) { - $items_query_args['meta_query'][] = array( - 'key' => 'featured', - 'compare' => 'NOT EXISTS', - ); - $items_query_args['orderby'] = array( - 'meta_value' => 'DESC', - 'title' => 'RAND', - ); - } - } - - $items = new WP_Query( $items_query_args ); - - if ( $items->have_posts() ) : - $lsx_to_archive = 1; - - $carousel_id = rand( 20, 20000 ); - $columns = intval( esc_attr( $args['column'] ) ); - $interval = '6000'; - $post_type = $args['content_part']; - - echo wp_kses_post( $args['before'] ); - - if ( 1 < $items->post_count ) { - echo '
'; - echo '
'; - echo '
'; - echo '
'; - } - - while ( $items->have_posts() ) : - $items->the_post(); - - global $disable_placeholder, $disable_text; - - $disable_placeholder = apply_filters( 'lsx_to_widget_disable_placeholder', false, $args['to'], $post_type ); - $disable_text = apply_filters( 'lsx_to_widget_disable_text', false, $args['to'], $post_type ); - - $class = ''; - if ( 1 === $items->post_count ) { - $class = 'singular-item'; - } else if ( 2 === $items->post_count ) { - $class = 'dual-item'; - } - - echo '
'; - lsx_to_content( 'content-widget', $args['content_part'] ); - echo '
'; - endwhile; - - wp_reset_postdata(); - $lsx_to_archive = 0; - - if ( 1 < $items->post_count ) { - echo '
'; - } - do_action( 'lsx_to_connected_panel_query_bottom', $args ); - - if ( 1 < $items->post_count ) { - echo '
'; - echo '
'; - echo '
'; - } - - echo wp_kses_post( $args['after'] ); - - endif; - } - } -} - -/** - * Returns items tagged in the same terms for the taxonomy you select. - * - * @param $taxonomy | string - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category helper - */ -function lsx_to_related_items( $taxonomy = false, $before = '', $after = '', $echo = true, $post_type = false ) { - if ( false !== $taxonomy ) { - $return = false; - $filters = array(); - - if ( false === $post_type ) { - $post_type = get_post_type(); - } - - $filters['post_type'] = $post_type; - - if ( is_array( $taxonomy ) ) { - $filters['post__in'] = $taxonomy; - } else { - //Get the settings from the customizer options - $filters['posts_per_page'] = 15; - //Exclude the current post - $filters['post__not_in'] = array( get_the_ID() ); - //if its set to related then we need to check by the type. - $filters['orderby'] = 'rand'; - $terms = wp_get_object_terms( get_the_ID(), $taxonomy ); - - //only allow relation by 1 property type term - if ( is_array( $terms ) && ! empty( $terms ) ) { - $filters['tax_query'] = array( - array( - 'taxonomy' => $taxonomy, - 'field' => 'slug', - 'terms' => array(), - ), - ); - - foreach ( $terms as $term ) { - $filters['tax_query'][0]['terms'][] = $term->slug; - } - } - } - - $related_query = new WP_Query( $filters ); - - if ( $related_query->have_posts() ) : - global $wp_query, $columns; - - $wp_query->is_single = 0; - $wp_query->is_singular = 0; - $wp_query->is_post_type_archive = 1; - - if ( null === $columns || empty( $columns ) || '' === $columns ) { - $columns = 3; - } - - ob_start(); - - //Setting some carousel variables - $carousel_id = rand( 20, 20000 ); - $interval = '6000'; - $post_type = get_post_type(); - - $slider_atts = array( - 'slidesToShow' => esc_attr( $columns ), - 'slidesToScroll' => esc_attr( $columns ), - ); - $slider_atts = apply_filters( 'lsx_to_related_slider_attributes', $slider_atts ); - - echo '
'; - echo '
'; - echo '
'; - - //echo '
'; - echo "
"; - - while ( $related_query->have_posts() ) : - $related_query->the_post(); - - global $disable_placeholder, $disable_text; - - $disable_placeholder = apply_filters( 'lsx_to_widget_disable_placeholder', false, $post_type, false, $taxonomy ); - $disable_text = apply_filters( 'lsx_to_widget_disable_text', false, $post_type, false, $taxonomy ); - - echo '
'; - lsx_to_content( 'content-widget', $post_type ); - echo '
'; - endwhile; - - echo '
'; - echo '
'; - echo '
'; - echo '
'; - - $return = ob_get_clean(); - - $wp_query->is_single = 1; - $wp_query->is_singular = 1; - $wp_query->is_post_type_archive = 0; - - wp_reset_postdata(); - - $return = $before . $return . $after; - endif; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } -} - /** * Outputs a list of the ids you give it * @@ -763,7 +476,7 @@ function to_continent_region_label( $country_code = '' ) { * @return string */ function lsx_to_get_price_type_label( $label_index = '' ) { - $label = ''; + $label = ''; switch ( $label_index ) { case '': $label = ''; diff --git a/includes/template-tags/maps.php b/includes/template-tags/maps.php index 4f698bc0..0218fb58 100644 --- a/includes/template-tags/maps.php +++ b/includes/template-tags/maps.php @@ -152,6 +152,7 @@ function lsx_to_map( $before = '', $after = '', $echo = true ) { ); if ( isset( get_queried_object()->term_id ) ) { + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query $country_args['tax_query'] = array( array( 'taxonomy' => 'continent', diff --git a/includes/template-tags/tour.php b/includes/template-tags/tour.php deleted file mode 100644 index b5082698..00000000 --- a/includes/template-tags/tour.php +++ /dev/null @@ -1,414 +0,0 @@ - 'post', - 'to' => 'tour', - 'column' => '3', - 'before' => '

' . esc_html__( 'Featured Posts', 'tour-operator' ) . '

', - 'after' => '
', - ); - - lsx_to_connected_panel_query( $args ); -} - -/** - * Gets the current tours price - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_price( $before = '', $after = '', $echo = true ) { - lsx_to_custom_field_query( 'price', $before, $after, $echo ); -} - -/** - * Gets the current tours duration - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_duration( $before = '', $after = '', $echo = true ) { - lsx_to_custom_field_query( 'duration', $before, $after, $echo ); -} - -/** - * Gets the current tours included pricing field - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_included( $before = '', $after = '', $echo = true ) { - return lsx_to_custom_field_query( 'included', $before, $after, $echo ); -} - -/** - * Gets the current tours not included pricing field - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_not_included( $before = '', $after = '', $echo = true ) { - return lsx_to_custom_field_query( 'not_included', $before, $after, $echo ); -} - -/** - * Gets the current tours departure points - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_departure_point( $before = '', $after = '', $echo = true ) { - $departs_from = get_post_meta( get_the_ID(), 'departs_from', false ); - - $options = get_option( '_lsx-to_settings', false ); - if ( ! empty( $departs_from ) && is_array( $departs_from ) && count( $departs_from ) > 0 ) { - $connected_list = lsx_to_connected_list( $departs_from, 'destination', true, ', ' ); - if ( false !== $options && isset( $options[ 'destination' ] ) && isset( $options[ 'destination' ]['disable_single_region'] ) ) { - $connected_list = strip_tags( $connected_list ); - } - $return = $before . $connected_list . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } -} - -/** - * Gets the current tours end points - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_end_point( $before = '', $after = '', $echo = true ) { - $end_point = get_post_meta( get_the_ID(), 'ends_in', false ); - $options = get_option( '_lsx-to_settings', false ); - - if ( ! empty( $end_point ) && is_array( $end_point ) && count( $end_point ) > 0 ) { - $connected_list = lsx_to_connected_list( $end_point, 'destination', true, ', ' ); - if ( false !== $options && isset( $options[ 'destination' ] ) && isset( $options[ 'destination' ]['disable_single_region'] ) ) { - $connected_list = strip_tags( $connected_list ); - } - $return = $before . $connected_list . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } -} - -/** - * Outputs the tours included / not included block - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_included_block() { - $tour_included = lsx_to_included( '', '', false ); - $tour_not_included = lsx_to_not_included( '', '', false ); - - if ( null !== $tour_included || null !== $tour_not_included ) { - $class = 'col-xs-12 col-sm-6'; - - if ( ( null === $tour_included && null !== $tour_not_included ) || ( null !== $tour_included && null === $tour_not_included ) ) { - $class = 'col-xs-12'; - } - ?> -
- - -
-
-
- -
-

-
- -
-
- -
-

-
- -
-
- -
-
-
-
- ' . apply_filters( 'the_content', wpautop( $highlights ) ) . '
' . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } -} - -/** - * Outputs the Best Time to Visit HTML - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category tour - */ -function lsx_to_best_time_to_visit( $before = '', $after = '', $echo = true ) { - $best_time_to_visit = get_post_meta( get_the_ID(), 'best_time_to_visit', true ); - - if ( false !== $best_time_to_visit && '' !== $best_time_to_visit && is_array( $best_time_to_visit ) && ! empty( $best_time_to_visit ) ) { - $this_year = array( - 'january' => esc_html__( 'January', 'tour-operator' ), - 'february' => esc_html__( 'February', 'tour-operator' ), - 'march' => esc_html__( 'March', 'tour-operator' ), - 'april' => esc_html__( 'April', 'tour-operator' ), - 'may' => esc_html__( 'May', 'tour-operator' ), - 'june' => esc_html__( 'June', 'tour-operator' ), - 'july' => esc_html__( 'July', 'tour-operator' ), - 'august' => esc_html__( 'August', 'tour-operator' ), - 'september' => esc_html__( 'September', 'tour-operator' ), - 'october' => esc_html__( 'October', 'tour-operator' ), - 'november' => esc_html__( 'November', 'tour-operator' ), - 'december' => esc_html__( 'December', 'tour-operator ' ), - ); - - foreach ( $this_year as $month => $label ) { - $checked = ''; - $checked_class = ''; - - if ( in_array( $month, $best_time_to_visit ) ) { - $checked = ''; - $checked_class = 'lsx-to-month-check'; - } - - $shortname = str_split( $label, 3 ); - $best_times[] = '
' . $shortname[0] . '' . $checked . '
'; - }; - - $return = $before . implode( $best_times ) . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } -} - -/** - * Gets the current specials connected tours - * - * @param $before | string - * @param $after | string - * @param $echo | boolean - * @return string - * - * @package tour-operator - * @subpackage template-tags - * @category connections - */ -function lsx_to_connected_tours( $before = '', $after = '', $echo = true ) { - lsx_to_connected_items_query( 'tour', get_post_type(), $before, $after, $echo ); -} - -/** - * Return the Room basis Label. - * - * @param string $index - * @return string - */ -function lsx_to_room_basis_label( $index = '' ) { - $label = $index; - if ( isset( tour_operator()->legacy->tour->room_basis[ $index ] ) ) { - $label = tour_operator()->legacy->tour->room_basis[ $index ]; - } - return $label; -} - -/** - * Outputs The current Itinerary connected destinations, can only be used in - * the itinerary loop. - * - * @package tour-operator - * @subpackage template-tags - * @category itinerary - */ -function lsx_to_itinerary_room_basis( $before = '', $after = '', $echo = true ) { - global $tour_itinerary; - if ( $tour_itinerary && $tour_itinerary->has_itinerary && ! empty( $tour_itinerary->itinerary ) ) { - if ( ! empty( $tour_itinerary->itinerary['room_basis'] ) && 'None' !== $tour_itinerary->itinerary['room_basis'] ) { - $label = lsx_to_room_basis_label( $tour_itinerary->itinerary['room_basis'] ); - if ( $echo ) { - echo wp_kses_post( $before . $label . $after ); - } else { - return $before . $label . $after; - } - } - } - return ''; -} - -/** - * Return the Drinks basis Label. - * - * @param string $index - * @return string - */ -function lsx_to_drinks_basis_label( $index = '' ) { - $label = $index; - if ( isset( tour_operator()->legacy->tour->drinks_basis[ $index ] ) ) { - $label = tour_operator()->legacy->tour->drinks_basis[ $index ]; - } - return $label; -} - -/** - * Outputs The current Itinerary connected destinations, can only be used in - * the itinerary loop. - * - * @package tour-operator - * @subpackage template-tags - * @category itinerary - */ -function lsx_to_itinerary_drinks_basis( $before = '', $after = '', $echo = true ) { - global $tour_itinerary; - if ( $tour_itinerary && $tour_itinerary->has_itinerary && ! empty( $tour_itinerary->itinerary ) ) { - if ( ! empty( $tour_itinerary->itinerary['drinks_basis'] ) && 'None' !== $tour_itinerary->itinerary['drinks_basis'] ) { - $label = lsx_to_drinks_basis_label( $tour_itinerary->itinerary['drinks_basis'] ); - if ( $echo ) { - echo wp_kses_post( $before . $label . $after ); - } else { - return $before . $label . $after; - } - } - } - return ''; -} - -/** - * Retrieves the accommodation ids from the itinerary, mostly for use in the map. - * the itinerary loop. - * - * @package tour-operator - * @subpackage template-tags - * @category itinerary - * - * @param string $meta_key - * @param string $supress_filters - * @return array - */ -function lsx_to_get_tour_itinerary_ids( $meta_key = 'accommodation_to_tour', $supress_filters = false ) { - $tour_itinerary = new \lsx\legacy\Itinerary_Query(); - $itinerary_ids = array(); - - if ( false === $supress_filters ) { - $meta_key = apply_filters( 'lsx_to_get_itinerary_ids_meta_key', $meta_key ); - } - - if ( $tour_itinerary->has_itinerary() ) { - $itinerary_count = 1; - while ( $tour_itinerary->while_itinerary() ) { - $tour_itinerary->current_itinerary_item(); - - if ( ! empty( $tour_itinerary->itinerary[ $meta_key ] ) && '' !== $tour_itinerary->itinerary[ $meta_key] ) { - if ( ! is_array( $tour_itinerary->itinerary[ $meta_key ] ) ) { - $d_ids = array( $tour_itinerary->itinerary[ $meta_key ] ); - } else { - $d_ids = $tour_itinerary->itinerary[ $meta_key ]; - } - $itinerary_ids = array_merge( $itinerary_ids, array_values( $d_ids ) ); - } - } - } - return $itinerary_ids; -} diff --git a/includes/template-tags/videos.php b/includes/template-tags/videos.php deleted file mode 100644 index 1856639d..00000000 --- a/includes/template-tags/videos.php +++ /dev/null @@ -1,115 +0,0 @@ -'; - $content .= '
'; - $content .= '
'; - $content .= '
'; - - foreach ( $videos as $video ) { - $content .= '
'; - $content .= '
'; - - if ( isset( $video['url'] ) && '' !== $video['url'] ) { - $content .= '
'; - - $embed_key = 'to_videos_embed_' . sanitize_title( $video['url'] ); - $embed = get_transient( $embed_key ); - - if ( false === $embed ) { - $embed = wp_oembed_get( $video['url'], array( - 'class' => 'embed-responsive-item', - ) ); - - if ( ! empty( $embed ) ) { - set_transient( $embed_key, $embed, ( 24 * 60 * 60 ) ); - } - } - - $content .= $embed; - $content .= '
'; - - $has_content = ( isset( $video['title'] ) && '' !== $video['title'] ) || ( isset( $video['description'] ) && '' !== $video['description'] ); - - if ( $has_content ) { - $content .= '
'; - - if ( isset( $video['title'] ) && '' !== $video['title'] ) { - $content .= '

' . $video['title'] . '

'; - } - - if ( isset( $video['description'] ) && '' !== $video['description'] ) { - $content .= apply_filters( 'the_content', $video['description'] ); - } - - $content .= '
'; - } - } - - $content .= '
'; - $content .= '
'; - } - - $content .= '
'; - $content .= '
'; - $content .= '
'; - $content .= ''; - - $return = $content; - } - - $protocol = is_ssl() ? 'https' : 'http'; - $return = preg_replace( '/href="\/\//i', 'href="' . $protocol . '://', $return ); - - $return = $before . $return . $after; - - if ( $echo ) { - echo wp_kses_post( $return ); - } else { - return $return; - } - } - } -} diff --git a/includes/tour-operator.php b/includes/tour-operator.php index e742ad41..c021c715 100644 --- a/includes/tour-operator.php +++ b/includes/tour-operator.php @@ -19,11 +19,14 @@ */ function tour_operator_autoload_class( $class ) { $parts = explode( '\\', $class ); + if ( 'lsx' === $parts[0] ) { $path = LSX_TO_PATH . 'includes/classes/'; array_shift( $parts ); $name = array_shift( $parts ); + + if ( 'Settings' === $name ) { $name = 'admin\\' . $name; } diff --git a/readme.txt b/readme.txt index 4bb2d5d7..22262a1d 100644 --- a/readme.txt +++ b/readme.txt @@ -1,14 +1,15 @@ === LSX Tour Operator === -Contributors: feedmymedia, lightspeedwp, eleshar, krugazul +Contributors: lightspeedwp, wetudev Donate link: https://lsdev.biz/lsx/donate/ -Tags: lsx, tour operator, tours, travel, travel-agency -Requires at least: 6.1 +Tags: lsx, tour operator, travel, tourism, itinerary +Requires at least: 6.7 Tested up to: 6.7 -Requires PHP: 7.2 -Stable tag: 2.0-beta-2 +Requires PHP: 8.0 +Stable tag: 2.0.0 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.en.html + The LSX Tour Operator is plugin specially designed & developed for the tourism and travel industry. Build to showcase your tours and accommodation. == Description == diff --git a/templates/archive-accommodation.html b/templates/archive-accommodation.html index 0154ac30..300f5a03 100644 --- a/templates/archive-accommodation.html +++ b/templates/archive-accommodation.html @@ -1,9 +1,9 @@ -
+
- -
+ +
@@ -23,77 +23,16 @@
-

Discover a wide variety of accommodation options designed to suit every traveller’s needs and preferences. Whether you're seeking the indulgence of a five-star resort, the charm of a boutique hotel, or the simplicity of a rustic cabin, our collection has something for everyone. Each accommodation is carefully chosen to provide comfort, convenience, and a seamless blend with the local surroundings, ensuring that your stay is as memorable as the destinations themselves.

+

Discover a wide variety of accommodation options designed to suit every traveller’s needs and preferences. Whether you\'re seeking the indulgence of a five-star resort, the charm of a boutique hotel, or the simplicity of a rustic cabin, our collection has something for everyone. Each accommodation is carefully chosen to provide comfort, convenience, and a seamless blend with the local surroundings, ensuring that your stay is as memorable as the destinations themselves.

-
- -
+
+ - -
-
- - - -
-
-
-
- - - -

From:

-
- - - -

-
- - - -
-
-
- - - -

Type:

-
- - - -
-
- - - -
-
-
- - - -

Rooms:

-
- - - -

-
-
- - - - -
-
- @@ -114,4 +53,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/archive-destination.html b/templates/archive-destination.html index 86672b9f..eded0f9c 100644 --- a/templates/archive-destination.html +++ b/templates/archive-destination.html @@ -1,5 +1,5 @@ -
+
@@ -20,8 +20,8 @@
- -
+ +

Discover our diverse collection of destinations, each offering a unique escape. Browse through stunning locales, from exotic retreats to bustling metropolises, and find the perfect spot for your next adventure. With options to suit every traveller, our destinations archive is your gateway to endless possibilities.

@@ -29,8 +29,8 @@ -
-
+
+
@@ -42,7 +42,13 @@
-
+ + + + +
@@ -64,4 +70,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/archive-review.html b/templates/archive-review.html new file mode 100644 index 00000000..1f181449 --- /dev/null +++ b/templates/archive-review.html @@ -0,0 +1,113 @@ + +
+ + + +
+
+
+
+
+ + + + + + + +
+
+

Hear what our travellers have to say about their experiences with us. From breathtaking destinations to seamless service, our guests share their stories and insights to help you plan your next adventure. Read through reviews and discover why so many travellers choose us for their unforgettable journeys.

+
+
+ + + +
+
+ +
+ + +
+
+ + + +
+
+
+
+ + + +

Tours:

+
+ + + +

+
+ + + +
+
+
+ + + +

Rating:

+
+ + + +

+
+ + + +
+
+
+ + + +

Accommodation:

+
+ + + +

+
+
+ + + +
+
+
+ + + + + +

Unfortunately, there are no reviews listed at the moment. Please check back soon as we regularly update our offerings.

+ + + + +
+ + + + + +
+
+
+ + + \ No newline at end of file diff --git a/templates/archive-tour.html b/templates/archive-tour.html index 24ac74f1..6f7b85e9 100644 --- a/templates/archive-tour.html +++ b/templates/archive-tour.html @@ -1,9 +1,9 @@ -
+
- -
+ +
@@ -23,7 +23,7 @@
-

Browse through our extensive collection of tours and find the perfect journey for your next adventure. Whether you're drawn to historical explorations, nature-filled escapes, or vibrant cultural experiences, our range of tours has something to suit every interest. Start planning your next memorable trip with options tailored to every type of traveller.

+

Browse through our extensive collection of tours and find the perfect journey for your next adventure. Whether you\'re drawn to historical explorations, nature-filled escapes, or vibrant cultural experiences, our range of tours has something to suit every interest. Start planning your next memorable trip with options tailored to every type of traveller.

@@ -43,7 +43,7 @@
-
+
@@ -59,7 +59,7 @@
-
+
@@ -104,4 +104,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/archive-travel-style.html b/templates/archive-travel-style.html new file mode 100644 index 00000000..8c6bee64 --- /dev/null +++ b/templates/archive-travel-style.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/templates/archive.html b/templates/archive.html deleted file mode 100644 index 09289cc2..00000000 --- a/templates/archive.html +++ /dev/null @@ -1,65 +0,0 @@ - -
- - - -
-
-
- - - - -
-
- - - - - - - -
-
-
- - - -
-
- -
- - -
-
- - - - -
-
- - - - - -

Sorry, there are no results matching your search at the moment. Check back later for new updates and exciting options.

- - - - -
- - - - - -
-
-
- - - \ No newline at end of file diff --git a/templates/content-map-marker.php b/templates/content-map-marker.php deleted file mode 100644 index 0ce3ed02..00000000 --- a/templates/content-map-marker.php +++ /dev/null @@ -1,27 +0,0 @@ - -
> - - -
- -
-
diff --git a/templates/content-modal.php b/templates/content-modal.php deleted file mode 100644 index be8c8922..00000000 --- a/templates/content-modal.php +++ /dev/null @@ -1,29 +0,0 @@ - -
-
- - - -
- -

- - - -
- -
-
diff --git a/templates/content-widget-accommodation-brand.php b/templates/content-widget-accommodation-brand.php deleted file mode 100644 index b59e7023..00000000 --- a/templates/content-widget-accommodation-brand.php +++ /dev/null @@ -1,78 +0,0 @@ - - diff --git a/templates/content-widget-accommodation-type.php b/templates/content-widget-accommodation-type.php deleted file mode 100644 index dd1c02a8..00000000 --- a/templates/content-widget-accommodation-type.php +++ /dev/null @@ -1,78 +0,0 @@ - - diff --git a/templates/content-widget-accommodation.php b/templates/content-widget-accommodation.php deleted file mode 100644 index 00bbf27b..00000000 --- a/templates/content-widget-accommodation.php +++ /dev/null @@ -1,99 +0,0 @@ - - - - -
> - - - - -
- - - - - -
- - -
- - - -

- - - - - -

- - ', '

' ); - // } - ?> - - - - -

- - - - -
- - - -
- diff --git a/templates/content-widget-continent.php b/templates/content-widget-continent.php deleted file mode 100644 index 54cd573a..00000000 --- a/templates/content-widget-continent.php +++ /dev/null @@ -1,78 +0,0 @@ - - diff --git a/templates/content-widget-destination.php b/templates/content-widget-destination.php deleted file mode 100644 index 693ddb30..00000000 --- a/templates/content-widget-destination.php +++ /dev/null @@ -1,68 +0,0 @@ - -
> - -
- - - - - -
- - -
-

- - - - - -

- - ', '

' ); - // } - ?> - - -

- -
-
diff --git a/templates/content-widget-tour.php b/templates/content-widget-tour.php deleted file mode 100644 index 004fc93a..00000000 --- a/templates/content-widget-tour.php +++ /dev/null @@ -1,98 +0,0 @@ - - - - -
> - - - - -
- - - - - -
- - -
- - - -

- - - - - -

- - ', '

' ); - // } - ?> - - - -

- - - -
- - - -
- diff --git a/templates/content-widget-travel-style.php b/templates/content-widget-travel-style.php deleted file mode 100644 index 99005b50..00000000 --- a/templates/content-widget-travel-style.php +++ /dev/null @@ -1,78 +0,0 @@ - - diff --git a/templates/content-widget.php b/templates/content-widget.php deleted file mode 100644 index 02a6defe..00000000 --- a/templates/content-widget.php +++ /dev/null @@ -1,44 +0,0 @@ - -
> - -
- - - -
- - -
-

- - - -

- ' . strip_tags( ob_get_clean(), array( 'a' ) ) . '

'; - - if ( empty( $disable_text ) && ! empty( $excerpt ) ) { - echo wp_kses_post( $excerpt ); - lsx_to_tagline( '

', '

' ); - } elseif ( $has_single ) { - ?> -

- -
-
diff --git a/templates/content.php b/templates/content.php deleted file mode 100644 index 47760c14..00000000 --- a/templates/content.php +++ /dev/null @@ -1,55 +0,0 @@ - - - - -
> - - -
- - - -
- -
-
-

- - - -

- -
> - -
-
-
- - archive_layout ) : ?> - - - -
- - -
- - - -
-
-
-

Latest News

-
- - - - -
-
- - - - - - - -
-
-

Welcome to our blog, your gateway to the world of travel, exploration, and adventure. Here, we share captivating stories, expert travel tips, and inspiring experiences from our journeys. Whether you're seeking insights for your next trip or simply wish to explore new destinations from afar, our articles are designed to inform, inspire, and ignite your wanderlust. Dive into our latest posts below, and let your adventure begin.

-
- - - -
-
- -
- - -
-
- - - -
- - -

—

- - - -

by

- - - - -
- - - -
-
-
- - - - - -

Unfortunately, there are no blog posts listed at the moment. Please check back soon as we regularly update our offerings.

- - - - -
- - - - - -
-
-
-
- - - \ No newline at end of file diff --git a/templates/no-title.html b/templates/no-title.html deleted file mode 100644 index 72e96ff7..00000000 --- a/templates/no-title.html +++ /dev/null @@ -1,9 +0,0 @@ - -
- - - -
- - - \ No newline at end of file diff --git a/templates/pages.html b/templates/pages.html deleted file mode 100644 index c0f222cd..00000000 --- a/templates/pages.html +++ /dev/null @@ -1,13 +0,0 @@ - -
- - - -
-
- -
-
- - - \ No newline at end of file diff --git a/templates/search-results.html b/templates/search-results.html index 51a57e1a..10979b4c 100644 --- a/templates/search-results.html +++ b/templates/search-results.html @@ -1,9 +1,9 @@ -
+
- -
+ +
@@ -39,7 +39,7 @@

Search again
-
+
@@ -75,11 +75,11 @@

No Re -

Oops! It looks like we couldn't find any matches for your search. But don't worry, there's plenty more to explore! Try adjusting your search terms.

+

Oops! It looks like we couldn\'t find any matches for your search. But don\'t worry, there\'s plenty more to explore! Try adjusting your search terms.

- \ No newline at end of file + \ No newline at end of file diff --git a/templates/single-accommodation.html b/templates/single-accommodation.html index 6cdf0dad..96fde6f8 100644 --- a/templates/single-accommodation.html +++ b/templates/single-accommodation.html @@ -1,9 +1,9 @@ -
+
- -
+ +
@@ -20,25 +20,56 @@
- -
-
-
+ +
+
+
+
+ + +
+

From:

+ + + + +
+
+ + + +
+ + + +
+

Share this accommodation:

+ + + + +
+
- -
-
+ +
+

Fast Facts

-
-
+
+
+
-
+
@@ -47,116 +78,188 @@

Fast Facts

-
- +
+ -
- +
+ - - + + - - + +
- -
+ +
-
+
-

Location:

+

Number of units:

- -
- + +
+

- -
-
-
+ +
+
+
+ + + +

Single supplement:

+
+ + + +
+ +
+
+ + + +
+
+
+ + + +

Check in time:

+
+ + + +
+ +
+
+ + + +
+
+
-

Spoken Languages:

+

Check out time:

- -
- + +
+
- -
-
-
+ +
+
+
-

Travel Styles:

+

Minimum child age:

- -
+ +
+ +
- -
+ +
-
+
-

Accommodation Type:

+

Location:

- -
+ +
+ +
- -
+ +
-
+
-

Number of units:

+

Spoken
Languages:

- -
- + +
+ +
+
+ + + +
+
+
+ + + +

Travel Styles:

+ + + +
- -
+ +
-
+
+ + + +

Accommodation Type:

+
+ + + +
+
+ + + +
+
+
@@ -164,26 +267,45 @@

Fast Facts

- -
- + +
+
+ + + +
+
+
+ + + +

Special
interests:

+
+ + + +
+ +
+
+
-
-
+
- -
+ +

@@ -197,12 +319,13 @@

Units

- + +
-
-
+
+
@@ -216,8 +339,8 @@

-
-
+
+
@@ -228,10 +351,10 @@

Information

- -
+ +
-
+
@@ -239,29 +362,25 @@

Information

- - + +
- -
+ +
-
+
-

Price:

+

From:

-
- - - - - +
+
@@ -272,10 +391,11 @@

Information

+

- -
+ +

@@ -290,12 +410,14 @@

Facilities

-
-
+
+ +
+
- -
+ + - -
-
+ +
+

@@ -339,10 +463,10 @@

Rates

- -
-
-
+ +
+
+
@@ -351,18 +475,29 @@

Rates

- -
- + +
+
+ + + + -
+ + + +
+
+
-
-
+
+
@@ -371,8 +506,8 @@

Rates

- -
+ +
@@ -382,10 +517,11 @@

Rates

+
- -
+ +

@@ -398,13 +534,15 @@


+
- + +
-
+
@@ -413,17 +551,17 @@

-
+ + - -
-
-
- - - -

Rooms:

-
- + +
- + +

Related Accommodation

+ - - -
+ +
+

- - -
- + +
+
+
+
- \ No newline at end of file + \ No newline at end of file diff --git a/templates/single-country.html b/templates/single-country.html index d3341412..e29c44e3 100644 --- a/templates/single-country.html +++ b/templates/single-country.html @@ -1,5 +1,5 @@ -
+
@@ -21,24 +21,28 @@ -
+
-
+
+ + +
+
-
-
+
+

Fast Facts

-
-
+
+
-
+
@@ -47,16 +51,16 @@

Fast Facts

-
- +
+
- -
+ +
-
+
@@ -69,14 +73,14 @@

Fast Facts

- -
+ +
-
+
-

Best Months to Visit

+

Best Months to Visit:

@@ -87,8 +91,8 @@

Fast Facts

-
@@ -96,8 +100,9 @@

Fast Facts

- -
+ +
+

@@ -111,12 +116,8 @@

Regions

- - - - - -
+ +
@@ -132,6 +133,7 @@

Regions

+
@@ -155,96 +157,96 @@

Travel Information

-
-
-
-
-

General

+
+
+
+
+

General

- -
-

+ +
+

-
-
-
-
-
-

Electricity

+
+
+
+
+

Electricity

- -
-

+ +
+

-
-
-
-
-
-

Banking

+
+
+
+
+

Banking

- -
-

+ +
+

-
-
-
-
-
-

Cuisine

+
+
+
+
+

Cuisine

- -
-

+ +
+

-
@@ -253,65 +255,65 @@

Travel Information

-
-
-
-
-

Climate

+
+
+
+
+

Climate

- -
-

+ +
+

-
-
-
-
-
-

Transport

+
+
+
+
+

Transport

- -
-

+ +
+

-
-
-
-
-
-

Dress

+
+
+
+
+

Dress

- -
-

+ +
+

@@ -325,24 +327,24 @@

Travel Information

-
-
-
-
-

Health

+
+
+
+
+

Health

- -
-

+ +
+

-
@@ -351,48 +353,48 @@

Travel Information

-
-
-
-
-

Safety

+
+
+
+
+

Safety

- -
-

+ +
+

-
-
-
-
-
-

Visa

+
+
+
+
+

Visa

- -
-

+ +
+

-
@@ -408,8 +410,8 @@

Travel Information

- -
+ +