diff --git a/assets/css/scss/_maps.scss b/assets/css/scss/_maps.scss new file mode 100644 index 00000000..77e9219b --- /dev/null +++ b/assets/css/scss/_maps.scss @@ -0,0 +1,68 @@ +.lsx-map { + &.wp-block-group.hidden { + display: none; + } +} + +.lsx-to-map-marker { + -webkit-box-align: start; + -ms-flex-align: start; + align-items: flex-start; + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: horizontal; + -webkit-box-direction: normal; + -ms-flex-flow: row nowrap; + flex-flow: row nowrap; + height: auto; + -webkit-box-pack: start; + -ms-flex-pack: start; + justify-content: flex-start; + padding: 5px 0; + width: 100%; + + .lsx-to-map-marker-content { + -webkit-box-flex: 1; + -ms-flex-positive: 1; + flex-grow: 1; + color: var(--wp--preset--color--contrast); + + &.content-area { + margin: 0; + } + + .entry-content { + margin-top: 10px; + + p { + margin-bottom: 0; + margin-top: 1.2rem; + + > a.moretag:after { + color: inherit; + content: '\f178'; + display: inline-block; + font-family: 'FontAwesome'; + font-size: inherit; + margin-right: 5px; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + } + } + } + } + + .lsx-to-map-marker-img { + margin-right: 15px; + max-width: 100px; + -ms-flex-negative: 0; + flex-shrink: 0; + } + + .lsx-to-map-marker-title { + margin-bottom: 10px; + margin-top: 0; + } +} \ No newline at end of file diff --git a/assets/css/scss/_modals.scss b/assets/css/scss/_modals.scss new file mode 100644 index 00000000..15d3480e --- /dev/null +++ b/assets/css/scss/_modals.scss @@ -0,0 +1,49 @@ +/* The Modal (background) */ + + +.lsx-modal { + display: none; /* Hidden by default */ + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + left: 0; + top: 0; + width: 100%; /* Full width */ + height: 100%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + background-color: rgb(0,0,0); /* Fallback color */ + background-color: rgba(0,0,0,0.4); /* Black w/ opacity */ + + &.open { + display: block; + } + + /* Modal Content/Box */ + .modal-content { + background-color: #fefefe; + margin: 15% auto; /* 15% from the top and centered */ + padding: 10px 20px; + border: 3px solid var(--wp--preset--color--primary); + border-radius: 6px; + width: var(--wp--style--global--content-size); /* Could be more or less, depending on screen size */ + } + + /* The Close Button */ + .close { + color: #aaa; + float: right; + font-size: 32px; + font-weight: bold; + line-height: 0; + height: auto; + padding-top: 10px; + margin-right: -8px; + + &:hover, + &:focus { + color: black; + text-decoration: none; + cursor: pointer; + } + } +} + diff --git a/assets/css/style.css b/assets/css/style.css index c7a9dbc4..262151b8 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -566,7 +566,7 @@ button.facetwp-reset { width: 40px; height: 40px; display: inline-block; - left: 10px; + left: 8px; } .lsx-to-slider .slick-arrow.slick-next:before, .slick-lightbox-inner .slick-arrow.slick-next:before { @@ -590,21 +590,21 @@ button.facetwp-reset { .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; - border-radius:50%; - transition: all 300ms ease-in-out; - width: 12px; + margin-left: 15px; } .lsx-to-slider .slick-dots:not(.dropdown-menu) > li.slick-active > button { background: #000; } +.lsx-to-slider .slick-dots:not(.dropdown-menu) > li > 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; +} .lsx-to-slider .slick-arrow.slick-prev { left: -4rem; } @@ -677,6 +677,96 @@ button.facetwp-reset { flex-wrap: wrap; /* Allow text to wrap on smaller screens */ } } +/* The Modal (background) */ +.lsx-modal { + display: none; /* Hidden by default */ + position: fixed; /* Stay in place */ + z-index: 1; /* Sit on top */ + left: 0; + top: 0; + width: 100%; /* Full width */ + height: 100%; /* Full height */ + overflow: auto; /* Enable scroll if needed */ + background-color: rgb(0, 0, 0); /* Fallback color */ + background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */ + /* Modal Content/Box */ + /* The Close Button */ +} +.lsx-modal.open { + display: block; +} +.lsx-modal .modal-content { + background-color: #fefefe; + margin: 15% auto; /* 15% from the top and centered */ + padding: 10px 20px; + border: 3px solid var(--wp--preset--color--primary); + border-radius: 6px; + width: var(--wp--style--global--content-size); /* Could be more or less, depending on screen size */ +} +.lsx-modal .close { + color: #aaa; + float: right; + font-size: 32px; + font-weight: bold; + line-height: 0; + height: auto; + padding-top: 10px; + margin-right: -8px; +} +.lsx-modal .close:hover, .lsx-modal .close:focus { + color: black; + text-decoration: none; + cursor: pointer; +} + +.lsx-map.wp-block-group.hidden { + display: none; +} + +.lsx-to-map-marker { + align-items: flex-start; + display: flex; + flex-flow: row nowrap; + height: auto; + justify-content: flex-start; + padding: 5px 0; + width: 100%; +} +.lsx-to-map-marker .lsx-to-map-marker-content { + flex-grow: 1; + color: var(--wp--preset--color--contrast); +} +.lsx-to-map-marker .lsx-to-map-marker-content.content-area { + margin: 0; +} +.lsx-to-map-marker .lsx-to-map-marker-content .entry-content { + margin-top: 10px; +} +.lsx-to-map-marker .lsx-to-map-marker-content .entry-content p { + margin-bottom: 0; + margin-top: 1.2rem; +} +.lsx-to-map-marker .lsx-to-map-marker-content .entry-content p > a.moretag:after { + color: inherit; + content: "\f178"; + display: inline-block; + font-family: "FontAwesome"; + font-size: inherit; + margin-right: 5px; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +.lsx-to-map-marker .lsx-to-map-marker-img { + margin-right: 15px; + max-width: 100px; + flex-shrink: 0; +} +.lsx-to-map-marker .lsx-to-map-marker-title { + margin-bottom: 10px; + margin-top: 0; +} + .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 fcd375f9..4e0d3e50 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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;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 +{"version":3,"sources":["style.css","style.scss","scss/_icons.scss","scss/_additional.scss","scss/_slider.scss","scss/_collapse.scss","scss/_modals.scss","scss/_maps.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;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AA;AP0sBJ;AOxsBI;EACC,cAAA;EACA,gBAAA;EACA,qBAAA;EACA,0BAAA;EACA,kBAAA;EACA,iBAAA;EACA,oBAAA;EACA,mCAAA;EACA,kCAAA;AP0sBL;AOpsBC;EACC,kBAAA;EACA,gBAAA;EAEA,cAAA;APssBF;AOnsBC;EACC,mBAAA;EACA,aAAA;APqsBF;;ACzvBC;;EACC,aAAA;AD6vBF","file":"style.css"} \ No newline at end of file diff --git a/assets/css/style.scss b/assets/css/style.scss index 62b87d86..4611e68a 100644 --- a/assets/css/style.scss +++ b/assets/css/style.scss @@ -6,6 +6,8 @@ @import 'scss/additional'; @import 'scss/slider'; @import 'scss/collapse'; +@import 'scss/modals'; +@import 'scss/maps'; .lsx-itinerary-wrapper, .lsx-units-wrapper { diff --git a/assets/img/Typecalendar-icon.png b/assets/img/Typecalendar-icon.png deleted file mode 100644 index 5ad6902d..00000000 Binary files a/assets/img/Typecalendar-icon.png and /dev/null differ diff --git a/assets/img/Typetours-icon.png b/assets/img/Typetours-icon.png deleted file mode 100644 index 3418240e..00000000 Binary files a/assets/img/Typetours-icon.png and /dev/null differ diff --git a/assets/img/accommodation-type-TO-icon-black-20px.png b/assets/img/accommodation-type-TO-icon-black-20px.png deleted file mode 100644 index 7aa41452..00000000 Binary files a/assets/img/accommodation-type-TO-icon-black-20px.png and /dev/null differ diff --git a/assets/img/accommodation.png b/assets/img/accommodation.png deleted file mode 100644 index c5dacade..00000000 Binary files a/assets/img/accommodation.png and /dev/null differ diff --git a/assets/img/activities.png b/assets/img/activities.png deleted file mode 100644 index 44d9bfc0..00000000 Binary files a/assets/img/activities.png and /dev/null 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 deleted file mode 100644 index a525f987..00000000 Binary files a/assets/img/best-months-to-travel-TO-icon-black-20px.png and /dev/null differ diff --git a/assets/img/placeholders/placeholder-map-1920x656.jpg b/assets/img/blocks/placeholder-map-1920x656.jpg similarity index 100% rename from assets/img/placeholders/placeholder-map-1920x656.jpg rename to assets/img/blocks/placeholder-map-1920x656.jpg diff --git a/assets/img/dates-travelled-icon-black-20px.png b/assets/img/dates-travelled-icon-black-20px.png deleted file mode 100644 index 8c53e3bd..00000000 Binary files a/assets/img/dates-travelled-icon-black-20px.png and /dev/null differ diff --git a/assets/img/duration-icon-black-20px.png b/assets/img/duration-icon-black-20px.png deleted file mode 100644 index d0da9d63..00000000 Binary files a/assets/img/duration-icon-black-20px.png and /dev/null differ diff --git a/assets/img/from-price-TO-icon-black-20px.png b/assets/img/from-price-TO-icon-black-20px.png deleted file mode 100644 index 968d537c..00000000 Binary files a/assets/img/from-price-TO-icon-black-20px.png and /dev/null differ diff --git a/assets/img/left-arrow-new.svg b/assets/img/left-arrow-new.svg deleted file mode 100644 index 486ed234..00000000 --- a/assets/img/left-arrow-new.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/assets/img/map-TO-icon-black-20px.png b/assets/img/map-TO-icon-black-20px.png deleted file mode 100644 index 46e01b2e..00000000 Binary files a/assets/img/map-TO-icon-black-20px.png and /dev/null differ diff --git a/assets/img/mystery-man-square.png b/assets/img/mystery-man-square.png deleted file mode 100644 index d1f176a7..00000000 Binary files a/assets/img/mystery-man-square.png and /dev/null differ diff --git a/assets/img/mystery-man-wide.png b/assets/img/mystery-man-wide.png deleted file mode 100644 index 92a21670..00000000 Binary files a/assets/img/mystery-man-wide.png and /dev/null differ diff --git a/assets/img/offers.png b/assets/img/offers.png deleted file mode 100644 index 7e5f32cd..00000000 Binary files a/assets/img/offers.png and /dev/null differ diff --git a/assets/img/placeholders/placeholder-accommodation-1920x600.jpg b/assets/img/placeholders/placeholder-accommodation-1920x600.jpg deleted file mode 100644 index 8c02c9d6..00000000 Binary files a/assets/img/placeholders/placeholder-accommodation-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-accommodation-350x350.jpg b/assets/img/placeholders/placeholder-accommodation-350x350.jpg deleted file mode 100644 index 57d9fad2..00000000 Binary files a/assets/img/placeholders/placeholder-accommodation-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-accommodation-360x168.jpg b/assets/img/placeholders/placeholder-accommodation-360x168.jpg deleted file mode 100644 index e62cdef8..00000000 Binary files a/assets/img/placeholders/placeholder-accommodation-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-accommodation-750x350.jpg b/assets/img/placeholders/placeholder-accommodation-750x350.jpg deleted file mode 100644 index 44df5bfb..00000000 Binary files a/assets/img/placeholders/placeholder-accommodation-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-activity-1920x600.jpg b/assets/img/placeholders/placeholder-activity-1920x600.jpg deleted file mode 100644 index f463523f..00000000 Binary files a/assets/img/placeholders/placeholder-activity-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-activity-350x350.jpg b/assets/img/placeholders/placeholder-activity-350x350.jpg deleted file mode 100644 index c13ce255..00000000 Binary files a/assets/img/placeholders/placeholder-activity-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-activity-360x168.jpg b/assets/img/placeholders/placeholder-activity-360x168.jpg deleted file mode 100644 index fb683f86..00000000 Binary files a/assets/img/placeholders/placeholder-activity-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-activity-750x350.jpg b/assets/img/placeholders/placeholder-activity-750x350.jpg deleted file mode 100644 index b98238ce..00000000 Binary files a/assets/img/placeholders/placeholder-activity-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-banner-1920x600.jpg b/assets/img/placeholders/placeholder-banner-1920x600.jpg deleted file mode 100644 index 7b1e312f..00000000 Binary files a/assets/img/placeholders/placeholder-banner-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-destination-1920x600.jpg b/assets/img/placeholders/placeholder-destination-1920x600.jpg deleted file mode 100644 index ff6998d2..00000000 Binary files a/assets/img/placeholders/placeholder-destination-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-destination-350x350.jpg b/assets/img/placeholders/placeholder-destination-350x350.jpg deleted file mode 100644 index 82ab7340..00000000 Binary files a/assets/img/placeholders/placeholder-destination-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-destination-360x168.jpg b/assets/img/placeholders/placeholder-destination-360x168.jpg deleted file mode 100644 index 352c873a..00000000 Binary files a/assets/img/placeholders/placeholder-destination-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-destination-750x350.jpg b/assets/img/placeholders/placeholder-destination-750x350.jpg deleted file mode 100644 index 0f93bc30..00000000 Binary files a/assets/img/placeholders/placeholder-destination-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-destination-general.jpg b/assets/img/placeholders/placeholder-destination-general.jpg deleted file mode 100644 index fda260c9..00000000 Binary files a/assets/img/placeholders/placeholder-destination-general.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-general-1920x600.jpg b/assets/img/placeholders/placeholder-general-1920x600.jpg deleted file mode 100644 index 99779bf9..00000000 Binary files a/assets/img/placeholders/placeholder-general-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-general-350x350.jpg b/assets/img/placeholders/placeholder-general-350x350.jpg deleted file mode 100644 index cf8f6a06..00000000 Binary files a/assets/img/placeholders/placeholder-general-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-general-360x168.jpg b/assets/img/placeholders/placeholder-general-360x168.jpg deleted file mode 100644 index e1290f9f..00000000 Binary files a/assets/img/placeholders/placeholder-general-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-general-750x350.jpg b/assets/img/placeholders/placeholder-general-750x350.jpg deleted file mode 100644 index fda260c9..00000000 Binary files a/assets/img/placeholders/placeholder-general-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-map-1170x400.jpg b/assets/img/placeholders/placeholder-map-1170x400.jpg deleted file mode 100644 index 1a5c190e..00000000 Binary files a/assets/img/placeholders/placeholder-map-1170x400.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-map-350x350.jpg b/assets/img/placeholders/placeholder-map-350x350.jpg deleted file mode 100644 index 1f38d8a7..00000000 Binary files a/assets/img/placeholders/placeholder-map-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-map-400x400.jpg b/assets/img/placeholders/placeholder-map-400x400.jpg deleted file mode 100644 index 30568ebd..00000000 Binary files a/assets/img/placeholders/placeholder-map-400x400.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-page-350x350.jpg b/assets/img/placeholders/placeholder-page-350x350.jpg deleted file mode 100644 index de38049f..00000000 Binary files a/assets/img/placeholders/placeholder-page-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-page-360x168.jpg b/assets/img/placeholders/placeholder-page-360x168.jpg deleted file mode 100644 index a44c5c6c..00000000 Binary files a/assets/img/placeholders/placeholder-page-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-page-750x350.jpg b/assets/img/placeholders/placeholder-page-750x350.jpg deleted file mode 100644 index f2a47b68..00000000 Binary files a/assets/img/placeholders/placeholder-page-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-page-general.jpg b/assets/img/placeholders/placeholder-page-general.jpg deleted file mode 100644 index fda260c9..00000000 Binary files a/assets/img/placeholders/placeholder-page-general.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-post-1920x600.jpg b/assets/img/placeholders/placeholder-post-1920x600.jpg deleted file mode 100644 index abcf083c..00000000 Binary files a/assets/img/placeholders/placeholder-post-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-post-350x350.jpg b/assets/img/placeholders/placeholder-post-350x350.jpg deleted file mode 100644 index a5637f50..00000000 Binary files a/assets/img/placeholders/placeholder-post-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-post-360x168.jpg b/assets/img/placeholders/placeholder-post-360x168.jpg deleted file mode 100644 index 1b7d7fee..00000000 Binary files a/assets/img/placeholders/placeholder-post-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-post-750x350.jpg b/assets/img/placeholders/placeholder-post-750x350.jpg deleted file mode 100644 index 1d22500d..00000000 Binary files a/assets/img/placeholders/placeholder-post-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-review-1920x600.jpg b/assets/img/placeholders/placeholder-review-1920x600.jpg deleted file mode 100644 index 5e4b73b0..00000000 Binary files a/assets/img/placeholders/placeholder-review-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-review-350x350.jpg b/assets/img/placeholders/placeholder-review-350x350.jpg deleted file mode 100644 index fc4429c3..00000000 Binary files a/assets/img/placeholders/placeholder-review-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-review-360x168.jpg b/assets/img/placeholders/placeholder-review-360x168.jpg deleted file mode 100644 index b52bb440..00000000 Binary files a/assets/img/placeholders/placeholder-review-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-review-750x350.jpg b/assets/img/placeholders/placeholder-review-750x350.jpg deleted file mode 100644 index 459180e1..00000000 Binary files a/assets/img/placeholders/placeholder-review-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-special-1920x600.jpg b/assets/img/placeholders/placeholder-special-1920x600.jpg deleted file mode 100644 index 6e80e1ea..00000000 Binary files a/assets/img/placeholders/placeholder-special-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-special-350x350.jpg b/assets/img/placeholders/placeholder-special-350x350.jpg deleted file mode 100644 index 7da76c4b..00000000 Binary files a/assets/img/placeholders/placeholder-special-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-special-360x168.jpg b/assets/img/placeholders/placeholder-special-360x168.jpg deleted file mode 100644 index e0757367..00000000 Binary files a/assets/img/placeholders/placeholder-special-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-special-750x350.jpg b/assets/img/placeholders/placeholder-special-750x350.jpg deleted file mode 100644 index 31763f57..00000000 Binary files a/assets/img/placeholders/placeholder-special-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-team-1920x600.jpg b/assets/img/placeholders/placeholder-team-1920x600.jpg deleted file mode 100644 index 686b2155..00000000 Binary files a/assets/img/placeholders/placeholder-team-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-team-350x350.jpg b/assets/img/placeholders/placeholder-team-350x350.jpg deleted file mode 100644 index 43da4f39..00000000 Binary files a/assets/img/placeholders/placeholder-team-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-team-360x168.jpg b/assets/img/placeholders/placeholder-team-360x168.jpg deleted file mode 100644 index 7b3a8b6a..00000000 Binary files a/assets/img/placeholders/placeholder-team-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-team-750x350.jpg b/assets/img/placeholders/placeholder-team-750x350.jpg deleted file mode 100644 index 6b10f8f9..00000000 Binary files a/assets/img/placeholders/placeholder-team-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-tour-1920x600.jpg b/assets/img/placeholders/placeholder-tour-1920x600.jpg deleted file mode 100644 index b1310421..00000000 Binary files a/assets/img/placeholders/placeholder-tour-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-tour-350x350.jpg b/assets/img/placeholders/placeholder-tour-350x350.jpg deleted file mode 100644 index 92a9a307..00000000 Binary files a/assets/img/placeholders/placeholder-tour-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-tour-360x168.jpg b/assets/img/placeholders/placeholder-tour-360x168.jpg deleted file mode 100644 index 456b48dd..00000000 Binary files a/assets/img/placeholders/placeholder-tour-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-tour-750x350.jpg b/assets/img/placeholders/placeholder-tour-750x350.jpg deleted file mode 100644 index e7322b3a..00000000 Binary files a/assets/img/placeholders/placeholder-tour-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-vehicle-1920x600.jpg b/assets/img/placeholders/placeholder-vehicle-1920x600.jpg deleted file mode 100644 index 84ed2580..00000000 Binary files a/assets/img/placeholders/placeholder-vehicle-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-vehicle-350x350.jpg b/assets/img/placeholders/placeholder-vehicle-350x350.jpg deleted file mode 100644 index d8be191f..00000000 Binary files a/assets/img/placeholders/placeholder-vehicle-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-vehicle-360x168.jpg b/assets/img/placeholders/placeholder-vehicle-360x168.jpg deleted file mode 100644 index ad16caa5..00000000 Binary files a/assets/img/placeholders/placeholder-vehicle-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-vehicle-750x350.jpg b/assets/img/placeholders/placeholder-vehicle-750x350.jpg deleted file mode 100644 index 7bbf9cfc..00000000 Binary files a/assets/img/placeholders/placeholder-vehicle-750x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-video-1920x600.jpg b/assets/img/placeholders/placeholder-video-1920x600.jpg deleted file mode 100644 index 38efcde5..00000000 Binary files a/assets/img/placeholders/placeholder-video-1920x600.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-video-350x350.jpg b/assets/img/placeholders/placeholder-video-350x350.jpg deleted file mode 100644 index 02a62941..00000000 Binary files a/assets/img/placeholders/placeholder-video-350x350.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-video-360x168.jpg b/assets/img/placeholders/placeholder-video-360x168.jpg deleted file mode 100644 index 80643b1f..00000000 Binary files a/assets/img/placeholders/placeholder-video-360x168.jpg and /dev/null differ diff --git a/assets/img/placeholders/placeholder-video-750x350.jpg b/assets/img/placeholders/placeholder-video-750x350.jpg deleted file mode 100644 index c687211d..00000000 Binary files a/assets/img/placeholders/placeholder-video-750x350.jpg and /dev/null differ diff --git a/assets/img/restaurants.png b/assets/img/restaurants.png deleted file mode 100644 index c40780d4..00000000 Binary files a/assets/img/restaurants.png and /dev/null differ diff --git a/assets/js/blocks/general.js b/assets/js/blocks/general.js index cbd2b041..58a1b62e 100644 --- a/assets/js/blocks/general.js +++ b/assets/js/blocks/general.js @@ -1,4 +1,3 @@ -// metadata.bindings not handle correctly wp.domReady(() => { @@ -572,5 +571,73 @@ wp.domReady(() => { renaming: false } }); + + // Price Block + wp.blocks.registerBlockVariation("core/group", { + name: "lsx-tour-operator/price", + title: "Price", + category: 'lsx-tour-operator', + icon: 'money-alt', + attributes: { + metadata: { + name: "Price", + }, + align: "wide", + layout: { + type: "flex", + flexWrap: "nowrap", + }, + className: "lsx-price-wrapper", + style: { + spacing: { + blockGap: "5px", + }, + }, + }, + innerBlocks: [ + [ + "core/paragraph", + { + padding: { + top: "2px", + bottom: "2px", + }, + typography: { + fontSize: "x-small", + }, + content: "From:", + className: "has-x-small-font-size", + }, + ], + [ + "core/paragraph", + { + metadata: { + bindings: { + content: { + source: "lsx/post-meta", + args: { + key: "price" + }, + }, + }, + }, + className: "amount has-primary-color has-text-color has-link-color", + padding: { + top: "2px", + bottom: "2px", + }, + color: { + link: "primary-700", + text: "primary-700", + }, + }, + ], + ], + isDefault: false, + supports: { + renaming: false + } + }); }); diff --git a/assets/js/blocks/maps.js b/assets/js/blocks/maps.js new file mode 100644 index 00000000..bd47f515 --- /dev/null +++ b/assets/js/blocks/maps.js @@ -0,0 +1,119 @@ +wp.domReady(() => { + + // Map Block + wp.blocks.registerBlockVariation("core/group", { + name: "lsx-tour-operator/google-map", + title: "Google Map", + description: "Display a Google Map based on the current Tour Operator page.", + category: 'lsx-tour-operator', + icon: 'location-alt', + attributes: { + metadata: { + name: "Google Map", + }, + className: "lsx-location-wrapper", + style: { + spacing: { + padding: { + top: 'var(--wp--preset--spacing--medium)', + bottom: 'var(--wp--preset--spacing--medium)', + left: 'var(--wp--preset--spacing--x-small)', + right: 'var(--wp--preset--spacing--x-small)' + }, + margin: { + top: '0', + bottom: '0' + } + } + }, + align: 'full', + layout: { + type: 'constrained' + }, + tagName: "section" + }, + innerBlocks: [ + [ + 'core/group', + { + align: 'wide', + style: { + spacing: { + margin: { top: '0', bottom: '0' }, + padding: { top: '0', bottom: 'var(--wp--preset--spacing--small)', left: '0', right: '0' }, + blockGap: 'var(--wp--preset--spacing--small)' + } + }, + metadata: { + name: "Title" + }, + layout: { type: 'flex', flexWrap: 'nowrap' } + }, + [ + ['core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' }], + ['core/heading', { textAlign: 'center', content: 'Location' }], + ['core/separator', { style: { layout: { selfStretch: 'fill', flexSize: null } }, backgroundColor: 'primary' }] + ] + ], + [ + 'core/group', + { + align: 'wide', + layout: { type: 'default' }, + name: "Map Container", + metadata: { + name: "Map Container", + } + }, + [ + [ + 'core/cover', + { + url: lsxToEditor.assetsUrl + 'blocks/placeholder-map-1920x656.jpg', + dimRatio: 50, + customOverlayColor: '#e2f0f7', + isUserOverlayColor: false, + isDark: false, + layout: { type: 'constrained' }, + className: "lsx-map-preview", + name: "Preview", + }, + [ + [ + 'core/paragraph', + { + align: 'center', + fontSize: 'large', + content: 'Click here to display the map', + className: 'has-text-align-center has-large-font-size' + } + ] + ] + ], + [ + 'core/group', + { + align: 'wide', + layout: { type: 'default' }, + className: "hidden", + metadata: { + name: "Map Details", + bindings: { + content: { + source: 'lsx/map', + type: 'google' + } + } + } + }, + [] + ] + ] + ] + ], + isDefault: false, + /*supports: { + renaming: false + }*/ + }); +}); \ No newline at end of file diff --git a/assets/js/blocks/slider-query.js b/assets/js/blocks/slider-query.js index 807de78c..da2862b5 100644 --- a/assets/js/blocks/slider-query.js +++ b/assets/js/blocks/slider-query.js @@ -28,6 +28,15 @@ filterByOnsale = props.attributes.filterByOnsale; } + var parentsOnly = props.attributes.parentsOnly || false; + if ( undefined === props.attributes.parentsOnly ) { + if ( props.attributes.className && props.attributes.className.includes( 'parents-only' ) ) { + parentsOnly = true; + } + } else { + parentsOnly = props.attributes.parentsOnly; + } + return el( element.Fragment, {}, @@ -52,6 +61,15 @@ filterByOnsale: value }); } + }), + el(CheckboxControl, { + label: 'Parents Only', + checked: parentsOnly, + onChange: function (value) { + props.setAttributes({ + parentsOnly: value + }); + } }) ) ) @@ -87,6 +105,12 @@ extraProps.className = extraProps.className.replace(/\bon-sale\b\s*/g, '').trim(); } + if ( true === attributes.parentsOnly ) { + extraProps.className = (extraProps.className || '') + ' parents-only'; + } else if ( false === attributes.parentsOnly && extraProps.className ) { + extraProps.className = extraProps.className.replace(/\bparents-only\b\s*/g, '').trim(); + } + } return extraProps; } diff --git a/assets/js/src/custom.js b/assets/js/src/custom.js index 00cae974..188561f4 100755 --- a/assets/js/src/custom.js +++ b/assets/js/src/custom.js @@ -5,452 +5,502 @@ * @subpackage scripts */ -var lsx_to = Object.create( null ); +var lsx_to = Object.create(null); -if ( window.location.hash ) { - ( document.body || document.documentElement ).scrollIntoView(); - setTimeout( function() { ( document.body || document.documentElement ).scrollIntoView(); }, 1 ); +if (window.location.hash) { + (document.body || document.documentElement).scrollIntoView(); + setTimeout(function () { + (document.body || document.documentElement).scrollIntoView(); + }, 1); } -;( function( $, window, document, undefined ) { - - 'use strict'; - - var $document = $( document ), - $window = $( window ), - window_height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight, - window_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; - - /** - * Easing browser scroll on page load (document URL with hash). - * - * @package tour-operator - * @subpackage scripts - */ - lsx_to.set_easing_scroll_on_page_load = function() { - if ( window.location.hash ) { - var $to = $( window.location.hash ), - top = parseInt( $to.offset().top ); - - top -= $( '#wpadminbar' ).length > 0 ? $( '#wpadminbar' ).outerHeight( true ) : 0; - top -= $( '.top-menu-fixed #masthead' ).length > 0 ? $( '.top-menu-fixed #masthead' ).outerHeight( true ) : 0; - top -= $( '.lsx-to-navigation' ).length > 0 ? $( '.lsx-to-navigation' ).outerHeight( true ) : 0; - - $( 'html, body' ).animate( { scrollTop: top }, 800 ); - } - }; - - /** - * Read more effect. - * - * @package tour-operator - * @subpackage scripts - */ - lsx_to.set_read_more = function() { - $( '.single-tour-operator .wp-block-read-more' ).each( function() { - lsx_to.readMoreText = $(this).contents().filter(function() { - return this.nodeType === Node.TEXT_NODE; - }).text(); - - 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 ) { - event.preventDefault(); - $( this ).hide(); - - if ( $( this ).hasClass( 'less-link' ) ) { - lsx_to.readMoreSet( $(this), $(this).parent( '.wp-block-group' ).find('.wp-block-post-content') ); - } else { - lsx_to.readMoreOpen( $(this), $(this).parent( '.wp-block-group' ).find('.wp-block-post-content') ); - } - - $( this ).show(); - } ); - }; - - lsx_to.readMoreSet = function( button, contentWrapper, limit = 1 ) { - if ( 0 < contentWrapper.length ) { - if ( 1 < contentWrapper.children().length ) { - let counter = 0; - - contentWrapper.children().each( function() { - if ( limit <= counter ) { - $(this).hide(); - } - counter++; - }); - } else { - button.hide(); - } - button.removeClass('less-link'); - button.text( lsx_to.readMoreText ); - } else { - button.hide(); +(function ($, window, document, undefined) { + "use strict"; + + var $document = $(document), + $window = $(window), + window_height = + window.innerHeight || + document.documentElement.clientHeight || + document.body.clientHeight, + window_width = + window.innerWidth || + document.documentElement.clientWidth || + document.body.clientWidth; + + /** + * Easing browser scroll on page load (document URL with hash). + * + * @package tour-operator + * @subpackage scripts + */ + lsx_to.set_easing_scroll_on_page_load = function () { + if (window.location.hash) { + var $to = $(window.location.hash), + top = parseInt($to.offset().top); + + top -= + $("#wpadminbar").length > 0 ? $("#wpadminbar").outerHeight(true) : 0; + top -= + $(".top-menu-fixed #masthead").length > 0 + ? $(".top-menu-fixed #masthead").outerHeight(true) + : 0; + top -= + $(".lsx-to-navigation").length > 0 + ? $(".lsx-to-navigation").outerHeight(true) + : 0; + + $("html, body").animate({ scrollTop: top }, 800); + } + }; + + /** + * Read more effect. + * + * @package tour-operator + * @subpackage scripts + */ + lsx_to.set_read_more = function () { + $(".single-tour-operator .wp-block-read-more").each(function () { + lsx_to.readMoreText = $(this) + .contents() + .filter(function () { + return this.nodeType === Node.TEXT_NODE; + }) + .text(); + + 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) { + event.preventDefault(); + $(this).hide(); + + if ($(this).hasClass("less-link")) { + lsx_to.readMoreSet( + $(this), + $(this).parent(".wp-block-group").find(".wp-block-post-content") + ); + } else { + lsx_to.readMoreOpen( + $(this), + $(this).parent(".wp-block-group").find(".wp-block-post-content") + ); + } + + $(this).show(); + } + ); + }; + + lsx_to.readMoreSet = function (button, contentWrapper, limit = 1) { + if (0 < contentWrapper.length) { + if (1 < contentWrapper.children().length) { + let counter = 0; + + contentWrapper.children().each(function () { + if (limit <= counter) { + $(this).hide(); + } + counter++; + }); + } else { + button.hide(); + } + button.removeClass("less-link"); + button.text(lsx_to.readMoreText); + } else { + button.hide(); + } + }; + + lsx_to.readMoreOpen = function (button, contentWrapper) { + if (0 < contentWrapper.children().length) { + contentWrapper.children().each(function () { + if (!$(this).hasClass("wp-block-read-more")) { + $(this).show(); + } + }); + button.addClass("less-link"); + button.text("Read Less"); + button.show(); + } + }; + + /** + * Read more (travel info) effect. + * + * @package tour-operator + * @subpackage scripts + */ + lsx_to.readMoreTIText = ""; + + lsx_to.set_read_more_travel_info = function () { + $(".single-tour-operator .additional-info .lsx-to-more-link").on( + "click", + function (event) { + event.preventDefault(); + + let classes = $(this).closest(".additional-info").attr("class"); + + const regex = /lsx-(.*?)-wrapper/; + const match = classes.match(regex); + const result = match ? match[1] : null; + + if (null !== result) { + $(".modal-" + result).toggleClass("open"); + } + } + ); + + $(".lsx-modal .close").on("click", function (event) { + $(this).parents(".lsx-modal").removeClass("open"); + }); + + // Close by clicking outside + $(document).on("click", function (event) { + if ($(event.target).is(".lsx-modal.open")) { + $(".lsx-modal.open").removeClass("open"); + } + }); + + // Close by pressing Escape + $(document).on("keydown", function (event) { + if (event.key === "Escape") { + $(".lsx-modal.open").removeClass("open"); + } + }); + }; + + lsx_to.removeEmptyParagraphs = function (contentWrapper) { + if (0 < contentWrapper.length) { + contentWrapper.children().each(function () { + if ($(this).is("p") && $(this).html().trim() === "") { + $(this).remove(); + } + }); + } + }; + + /** + * Read more (itinerary) effect. + * + * @package tour-operator + * @subpackage scripts + */ + + lsx_to.readMoreItinText = ""; + + lsx_to.set_read_more_itinerary = function () { + $(".single-tour-operator .lsx-itinerary-wrapper .wp-block-read-more").each( + function () { + $(this).show(); + lsx_to.readMoreItinText = $(this).find("a").text(); + lsx_to.readMoreSet( + $(this), + $(this).parent("div").find(".itinerary-description") + ); + } + ); + + $(".single-tour-operator .lsx-itinerary-wrapper .wp-block-read-more").on( + "click", + function (event) { + event.preventDefault(); + $(this).hide(); + + if ($(this).hasClass("less-link")) { + lsx_to.readMoreSet( + $(this), + $(this).parent("div").find(".itinerary-description") + ); + } else { + lsx_to.readMoreOpen( + $(this), + $(this).parent("div").find(".itinerary-description") + ); + } + + $(this).show(); + } + ); + }; + + /** + * Slider - Pre build. + * + * @package tour-operator + * @subpackage scripts + */ + lsx_to.pre_build_slider = function ($slider) { + $slider.removeClass("is-layout-grid"); + + $slider.on("init", function (event, slick) { + if ( + slick.options.arrows && + slick.slideCount > slick.options.slidesToShow + ) { + $slider.addClass("slick-has-arrows"); + } + }); + + $slider.on("setPosition", function (event, slick) { + if (!slick.options.arrows) { + $slider.removeClass("slick-has-arrows"); + } else if (slick.slideCount > slick.options.slidesToShow) { + $slider.addClass("slick-has-arrows"); + } + }); + }; + + /** + * Slider. + * + * @package tour-operator + * @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); + let slidesToShow = 3; + + lsx_to.pre_build_slider($this); + + const str = $this.attr('class'); + const classRegex = /columns-\S*/g; + const matches = str.match(classRegex); + if ( 0 < matches.length ) { + const column = matches[0].split('-')[1]; + slidesToShow = column; } - } - - lsx_to.readMoreOpen = function( button, contentWrapper ) { - if ( 0 < contentWrapper.children().length ) { - contentWrapper.children().each( function() { - if ( ! $(this).hasClass('wp-block-read-more') ) { - $(this).show(); - } - }); - button.addClass( 'less-link' ); - button.text( 'Read Less' ); - button.show(); - } - } - - /** - * Read more (travel info) effect. - * - * @package tour-operator - * @subpackage scripts - */ - lsx_to.readMoreTIText = ''; - - lsx_to.set_read_more_travel_info = function() { - - $( '.single-tour-operator .additional-info .lsx-to-more-link' ).each( function() { - lsx_to.readMoreTIText = $(this).find('a').text(); - 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 ).find('a').hasClass( 'less-link' ) ) { - lsx_to.readMoreSet( $(this).find('a'), $(this).closest( '.additional-info' ).find('.content'), 2 ); - } else { - lsx_to.readMoreOpen( $(this).find('a'), $(this).closest( '.additional-info' ).find('.content') ); - } - - $( this ).show(); - } ); - }; - - /** - * Read more (itinerary) effect. - * - * @package tour-operator - * @subpackage scripts - */ - - lsx_to.readMoreItinText = ''; - - lsx_to.set_read_more_itinerary = function() { - $( '.single-tour-operator .lsx-itinerary-wrapper .wp-block-read-more' ).each( function() { - $(this).show(); - lsx_to.readMoreItinText = $(this).find('a').text(); - lsx_to.readMoreSet( $(this), $(this).parent( 'div' ).find('.itinerary-description') ); - } ); - - $( '.single-tour-operator .lsx-itinerary-wrapper .wp-block-read-more' ).on( 'click', function( event ) { - event.preventDefault(); - $( this ).hide(); - - if ( $( this ).hasClass( 'less-link' ) ) { - lsx_to.readMoreSet( $(this), $(this).parent( 'div' ).find('.itinerary-description') ); - } else { - lsx_to.readMoreOpen( $(this), $(this).parent( 'div' ).find('.itinerary-description') ); - } - - $( this ).show(); - } ); - }; - - /** - * Slider - Pre build. - * - * @package tour-operator - * @subpackage scripts - */ - lsx_to.pre_build_slider = function( $slider ) { - - $slider.removeClass( 'is-layout-grid' ); - - $slider.on( 'init', function( event, slick ) { - if ( slick.options.arrows && slick.slideCount > slick.options.slidesToShow ) { - $slider.addClass( 'slick-has-arrows' ); - } - } ); - - $slider.on( 'setPosition', function( event, slick ) { - if ( ! slick.options.arrows ) { - $slider.removeClass( 'slick-has-arrows' ); - } else if ( slick.slideCount > slick.options.slidesToShow ) { - $slider.addClass( 'slick-has-arrows' ); - } - } ); - }; - - /** - * Slider. - * - * @package tour-operator - * @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 ); - - lsx_to.pre_build_slider( $this ); - - if ( 1 < $this.children().length ) { - $this.slick( { - 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: 1228, - settings: { - slidesToShow: 3, - slidesToScroll: 1, - draggable: true, - arrows: false, - swipe: true, - dots: true, - } - }, - { - breakpoint: 1028, - settings: { - 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, - } - } - ] - } ); - } - } ); - - // 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. - * - * @package tour-operator - * @subpackage scripts - */ - lsx_to.build_slider_lightbox = function() { - if ( 0 < $( '.wp-block-gallery.has-nested-images' ).length ) { - $( '.wp-block-gallery.has-nested-images' ).slickLightbox( { - caption: function( element, info ) { - return $( element ).find( 'img' ).attr( 'alt' ); - } - } ); - } - - if ( 0 < $( '.lsx-units-wrapper .unit-image a' ).length ) { - let roomImages = $('.lsx-units-wrapper .unit-image a img').map(function() { - return $(this).attr('src'); - }).get(); - console.log(roomImages); - - $( '.lsx-units-wrapper' ).slickLightbox( { - //images : roomImages, - itemSelector: '.unit-image a', - caption: function( element, info ) { - return $( element ).find( 'img' ).attr( 'alt' ); - } - } ); - } - }; - - /** - * On window resize. - * - * @package lsx - * @subpackage scripts - */ - $window.resize( function() { - - window_height = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; - window_width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; - - } ); - - /** - * On document ready. - * - * @package lsx - * @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(); - lsx_to.build_slider( window_width ); - } ); - - /** - * On window load. - * - * @package lsx - * @subpackage scripts - */ - - $window.on('load', function() { - 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 = ` + + if (1 < $this.children().length) { + $this.slick({ + draggable: false, + infinite: true, + swipe: false, + dots: false, + slidesToShow: slidesToShow, // 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: 1228, + settings: { + slidesToShow: 3, + slidesToScroll: 1, + draggable: true, + arrows: false, + swipe: true, + dots: true, + }, + }, + { + breakpoint: 1028, + settings: { + 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, + }, + }, + ], + }); + } + } + ); + + // 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. + * + * @package tour-operator + * @subpackage scripts + */ + lsx_to.build_slider_lightbox = function () { + if (0 < $(".wp-block-gallery.has-nested-images").length) { + $(".wp-block-gallery.has-nested-images").slickLightbox({ + caption: function (element, info) { + return $(element).find("img").attr("alt"); + }, + }); + } + + if (0 < $(".lsx-units-wrapper .unit-image a").length) { + let roomImages = $(".lsx-units-wrapper .unit-image a img") + .map(function () { + return $(this).attr("src"); + }) + .get(); + console.log(roomImages); + + $(".lsx-units-wrapper").slickLightbox({ + //images : roomImages, + itemSelector: ".unit-image a", + caption: function (element, info) { + return $(element).find("img").attr("alt"); + }, + }); + } + }; + + /** + * On window resize. + * + * @package lsx + * @subpackage scripts + */ + $window.resize(function () { + window_height = + window.innerHeight || + document.documentElement.clientHeight || + document.body.clientHeight; + window_width = + window.innerWidth || + document.documentElement.clientWidth || + document.body.clientWidth; + }); + + /** + * On document ready. + * + * @package lsx + * @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(); + lsx_to.build_slider(window_width); + }); + + /** + * On window load. + * + * @package lsx + * @subpackage scripts + */ + + $window.on("load", function () { + lsx_to.build_slider_lightbox(); + }); + + 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 ); + + // 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/assets/js/src/maps.js b/assets/js/src/maps.js index 3c78ed87..961457f3 100644 --- a/assets/js/src/maps.js +++ b/assets/js/src/maps.js @@ -9,7 +9,6 @@ var LSX_TO_Maps = { initThis: function() { var $map = jQuery('.lsx-map:eq(0)'); - // console.log($map); var lat = Number($map.attr('data-lat')); var lng = Number($map.attr('data-long')); @@ -63,33 +62,11 @@ var LSX_TO_Maps = { this.bounds = []; var $footerMap = jQuery(banner_class+':eq(0)'); - if ('.lsx-map-preview' != banner_class) { - height = $footerMap.css('height'); - // container_html = $footerMap.find('.container').html(); - $footerMap.find('.container').hide(); - } else if ('route' === type && 'undefined' !== $map.attr('data-kml')) { + $footerMap.css('height',height); + if ('route' === type && 'undefined' !== $map.attr('data-kml')) { kml = $map.attr('data-kml'); - } else { - $footerMap.css('height',height); } - console.log($map.attr('data-kml')); - - var $container = null; - var $breadcrumbs = null; - if ('.lsx-map-preview' != banner_class) { - jQuery(banner_class).addClass('gmap-banner'); - - $map.closest('section').hide(); - $map.closest('section').appendTo('footer.content-info'); - - if (jQuery(banner_class).children('.container').length == 1) { - $container = jQuery(banner_class).children('.container').clone(true, true); - } - if (jQuery(banner_class).children('.breadcrumbs-container').length == 1) { - $breadcrumbs = jQuery(banner_class).children('.breadcrumbs-container').clone(true, true); - } - } var snazzyMapsStyle = null, styledMap = null; @@ -134,7 +111,6 @@ var LSX_TO_Maps = { //Do we fit to the screen or center the view. if ( !$map.hasClass('disable-auto-zoom') && ( 'cluster' == type || ('route' == type && (false == kml || undefined == kml))) ) { - if ( 1 < this.bounds.length ) { this.setBounds(); } else { @@ -150,18 +126,6 @@ var LSX_TO_Maps = { this.resizeThis(); - // if('cluster' === type){ - // $footerMap.append(container_html); - // } - - if ($container !== null) { - jQuery(banner_class).append($container); - } - if ($breadcrumbs !== null) { - $breadcrumbs.find('.container').show(); - jQuery(banner_class).after($breadcrumbs); - } - $gmap = this.mapObj; }, @@ -345,10 +309,13 @@ var LSX_TO_Maps = { gmap_markers.push({marker:tempMarker,title:''+jQuery(this).attr('data-title')+'',thumbnail:jQuery(this).attr('data-thumbnail'),content:jQuery(this).html()}); var icon_url = jQuery(this).attr('data-icon'); - // console.log(icon_url); - if ('route' == $this.type && (0==counter || marker_length == counter)) { - if (0==counter) { + console.log(icon_url); + console.log(counter); + console.log(marker_length); + + if ('route' == $this.type && ( 0 == counter || marker_length == counter ) ) { + if ( 0 == counter ) { icon_url = lsx_to_maps_params.start_marker; } else { icon_url = lsx_to_maps_params.end_marker; @@ -401,6 +368,8 @@ var LSX_TO_Maps = { }, createMarker: function(position,icon) { + console.log(position); + console.log(jQuery(position.title).text()); var marker = new google.maps.Marker({ position: position.marker, map: this.mapObj, @@ -416,6 +385,8 @@ var LSX_TO_Maps = { // position.content = (position.content).replace('

', '

'); infowindow = new google.maps.InfoWindow({ + title: jQuery(position.title).text(), + label: jQuery(position.title).text(), content: '

' + '' + '
' + @@ -460,7 +431,8 @@ var LSX_TO_Maps = { }, watchMapTriggers: function() { - jQuery(document).on( 'click', '.lsx-map-placeholder, .placeholder-text', function( event ) { + jQuery('.lsx-map-preview a').on( 'click', function( event ) { + event.preventDefault(); jQuery.getScript(lsx_to_maps_params.google_url,function() { jQuery.getScript(lsx_to_maps_params.google_cluster_url); LSX_TO_Maps.initThis(); @@ -470,12 +442,12 @@ var LSX_TO_Maps = { }; jQuery(document).ready(function($) { - //console.log( lsx_to_maps_params ); if ( jQuery('.lsx-map').length > 0 ) { - if ( '' === lsx_to_maps_params.placeholder_enabled ) { - LSX_TO_Maps.initThis(); - } else { + // If there is a placeholder image, then load the placeholder code. + if ( jQuery('.lsx-map').parents('.lsx-location-wrapper').find('.lsx-map-preview').length > 0 ) { LSX_TO_Maps.watchMapTriggers(); + } else { + LSX_TO_Maps.initThis(); } } }); diff --git a/changelog.md b/changelog.md index 1a091c62..d9c96b08 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,23 @@ # Changelog +## [[2.0.1]](https://github.com/lightspeeddevelopment/tour-operator/releases/tag/2.0.1) - 2025-01-24 + +### Added +- A "Parents Only" checkbox to the TO query block settings, allowing you to select only the parent items for a query. (the WordPress parent field does not accept a 0 value). +- The Google Map, map block for Tour Operator, bringing back the various maps shows on the pages. [#477](https://github.com/lightspeedwp/tour-operator/pull/477) + +### Fixed +- Fixes to the post relation fields and when they save, detected via the TO Reviews plugin. +- Fixed the Slider not detecting the amount of columns set on the block. [a6e0ea](https://github.com/lightspeedwp/tour-operator/commit/a6e0eafb508532dc7c137aedc30a17c5856a0309) +- Fixed the Related Content dection, we check to see if the posts exist before trying to display them [b20f879](https://github.com/lightspeedwp/tour-operator/commit/b20f879da7e9abfced7623f7e5348737af064db3) + +### Removed +- Unused icons and placeholders from previous versions. [#477](https://github.com/lightspeedwp/tour-operator/pull/477) +- Removed the SVG Uploader Code causing a security issue. [c972c84](https://github.com/lightspeedwp/tour-operator/commit/c972c84224e2b51564fddc04d547ea6d204a356d) + +### Integrations +- Fixed the Destinations Facet dropdowns using the Fselect field. [8e4cfc](https://github.com/lightspeedwp/tour-operator/commit/8e4cfcb08333c342e9d41fd9fad3fe4f9c31e4c8) + ## [[2.0.0]](https://github.com/lightspeeddevelopment/tour-operator/releases/tag/2.0.0) - 2025-01-10 ### New Features @@ -27,59 +45,45 @@ - **Wetu Map Embed Block**: Created a block to display Wetu maps in the Single Tour template. [#365](https://github.com/lightspeedwp/tour-operator/issues/365) - **Simplified Wetu Importer Settings**: Reduced complexity in the Wetu Importer settings, added image controls, and improved UI based on Figma designs. [#173](https://github.com/lightspeedwp/wetu-importer/issues/173) ---- +### Compatibility & Integration +- **Theme & Page Builder Compatibility:** + Increased compatibility with popular WordPress themes and page builders, minimizing styling conflicts and ensuring consistent front-end rendering. ([#229](https://github.com/lightspeedwp/tour-operator/pull/229), [#204](https://github.com/lightspeedwp/tour-operator/issues/204)) +- **Translation & Localization Updates:** + Added missing translation strings and updated `.pot` files, improving internationalization support and making it easier to localize the plugin. ([#217](https://github.com/lightspeedwp/tour-operator/pull/217)) -### Enhancements +### Email & Notification Templates +- **Email Template System Improvements:** + Integrated a refined email templating structure that supports dynamic placeholders for tour details, booking confirmations, and reminders. ([#240](https://github.com/lightspeedwp/tour-operator/pull/240)) + +### Updates - Defined consistent image sizes across single posts, featured images, and archive pages, with custom aspect ratios. [#392](https://github.com/lightspeedwp/tour-operator/issues/392) - Updated plugin requirements to PHP 8.0 and WordPress 6.7 for improved compatibility and performance. [#406](https://github.com/lightspeedwp/tour-operator/issues/406) - Registered custom fields for post types using JSON for better data handling and display. [#407](https://github.com/lightspeedwp/tour-operator/issues/407) - ---- - -### Bug Fixes -- Fixed issues with setting featured images for custom taxonomies, ensuring proper saving and display. [#419](https://github.com/lightspeedwp/tour-operator/issues/419) -- Resolved syncing issues in the Wetu Importer, addressing a PHP fatal error and spinner loading problem. [#444](https://github.com/lightspeedwp/tour-operator/issues/444) -- Ensured blocks are hidden when related custom fields are empty, preventing display of incomplete content. [#372](https://github.com/lightspeedwp/tour-operator/issues/372) - ---- - -### Deprecations -- Removed unused settings and legacy PHP code from the plugin to align with new block-based functionality. [#331](https://github.com/lightspeedwp/tour-operator/issues/331) - - -## [[2.0.0]](https://github.com/lightspeeddevelopment/tour-operator/releases/tag/2.0.0) - 20-12-2024 - -### Enhancements - **Admin UI & UX Improvements:** Refined the admin interface for managing tours, bookings, and availability. Updated field layouts, improved navigation, and clearer labeling for a more intuitive experience. ([#225](https://github.com/lightspeedwp/tour-operator/pull/225), [#237](https://github.com/lightspeedwp/tour-operator/issues/237)) - **Checkout & Payment Flow Adjustments:** Enhanced integration with WooCommerce and other payment gateways, providing more reliable data handling and reducing the chance of failed booking entries at checkout. ([#231](https://github.com/lightspeedwp/tour-operator/pull/231)) - **Performance Optimizations:** Further optimized database queries, improving load times on large tour catalogs and ensuring smoother browsing experiences. ([#215](https://github.com/lightspeedwp/tour-operator/pull/215)) - -### Compatibility & Integration -- **Theme & Page Builder Compatibility:** - Increased compatibility with popular WordPress themes and page builders, minimizing styling conflicts and ensuring consistent front-end rendering. ([#229](https://github.com/lightspeedwp/tour-operator/pull/229), [#204](https://github.com/lightspeedwp/tour-operator/issues/204)) -- **Translation & Localization Updates:** - Added missing translation strings and updated `.pot` files, improving internationalization support and making it easier to localize the plugin. ([#217](https://github.com/lightspeedwp/tour-operator/pull/217)) - -### Email & Notification Templates -- **Email Template System Improvements:** - Integrated a refined email templating structure that supports dynamic placeholders for tour details, booking confirmations, and reminders. ([#240](https://github.com/lightspeedwp/tour-operator/pull/240)) +--- ### Fixes - **Resolved Seasonal Pricing Bugs:** Addressed incorrect display of overlapping seasonal rates and ensured accurate calculation of discounted or peak-season prices. ([#199](https://github.com/lightspeedwp/tour-operator/issues/199)) - **Checkout Data Handling:** Fixed issues where certain checkout fields failed to render or process correctly, ensuring customers’ booking details are recorded consistently. ([#203](https://github.com/lightspeedwp/tour-operator/issues/203)) - -### Notes for Upgrading -- **Backups & Settings Review:** - Before upgrading, back up your site. After update, review and re-save your booking and pricing settings to ensure that seasonal rules and availability data are correctly applied. +- Fixed issues with setting featured images for custom taxonomies, ensuring proper saving and display. [#419](https://github.com/lightspeedwp/tour-operator/issues/419) +- Resolved syncing issues in the Wetu Importer, addressing a PHP fatal error and spinner loading problem. [#444](https://github.com/lightspeedwp/tour-operator/issues/444) +- Ensured blocks are hidden when related custom fields are empty, preventing display of incomplete content. [#372](https://github.com/lightspeedwp/tour-operator/issues/372) ### Removed - UIX vendor library handling the TO Settings and refactored the settings code - (PR #332)[https://github.com/lightspeedwp/tour-operator/pull/332] - Various settings which are now handled by Block and Site Editor options. - (PR #332)[https://github.com/lightspeedwp/tour-operator/pull/332] +- Removed unused settings and legacy PHP code from the plugin to align with new block-based functionality. [#331](https://github.com/lightspeedwp/tour-operator/issues/331) + +### Notes for Upgrading +- **Backups & Settings Review:** + Before upgrading, back up your site. After update, review and re-save your booking and pricing settings to ensure that seasonal rules and availability data are correctly applied. ### Security - General testing to ensure compatibility with latest WordPress version (6.7). diff --git a/includes/classes/admin/class-settings.php b/includes/classes/admin/class-settings.php index e6679cb4..bc998f44 100644 --- a/includes/classes/admin/class-settings.php +++ b/includes/classes/admin/class-settings.php @@ -240,6 +240,7 @@ public function fusion_table_settings( $tab = 'general' ) { public function map_placeholder_settings( $tab = 'general' ) { if ( 'placeholders' === $tab ) { $settings = $this->get_settings_fields(); + echo wp_kses_post( $this->output_fields( $settings['placeholder'] ) ); } } @@ -266,6 +267,10 @@ public function api_settings( $tab = 'general' ) { public function post_type_map_settings( $tab, $post_type ) { $settings = $this->get_settings_fields(); if ( 'placeholder' === $tab ) { + if ( ! in_array( $post_type, [ 'accommodation', 'destination', 'tour' ] ) ) { + unset( $settings['post_types']['placeholder']['map_placeholder_enabled'] ); + unset( $settings['post_types']['placeholder']['map_placeholder'] ); + } echo wp_kses_post( $this->output_fields( $settings['post_types'][ $tab ], $post_type ) ); } if ( 'template' === $tab ) { diff --git a/includes/classes/blocks/class-bindings.php b/includes/classes/blocks/class-bindings.php index 4387fe4c..74605c00 100644 --- a/includes/classes/blocks/class-bindings.php +++ b/includes/classes/blocks/class-bindings.php @@ -772,19 +772,29 @@ public function render_map_block( $block_content, $parsed_block, $block_obj ) { $map = ''; switch ( $type ) { case 'wetu': + $pattern = '/]*>(.*?)<\/figure>/s'; $wetu_id = get_post_meta( get_the_ID(), 'lsx_wetu_id', true ); if ( ! empty( $wetu_id ) ) { $map = ''; } + $block_content = preg_replace( $pattern, $map, $block_content ); + break; + + case 'google': + preg_match('/class="([^"]*)"/', $block_content, $matches); + $class_string = $matches[1]; + + if ( lsx_to_has_map() ) { + $map = lsx_to_map( '', '', false ); + $map = str_replace( 'class="lsx-map"', 'class="lsx-map ' . $class_string . '"', $map ); + $block_content = $map; + } break; default: break; } - $pattern = '/]*>(.*?)<\/figure>/s'; - $block_content = preg_replace( $pattern, $map, $block_content ); - return $block_content; } diff --git a/includes/classes/blocks/class-registration.php b/includes/classes/blocks/class-registration.php index c7f490e3..4fd71289 100644 --- a/includes/classes/blocks/class-registration.php +++ b/includes/classes/blocks/class-registration.php @@ -25,6 +25,13 @@ class Registration { */ protected $onsale = false; + /** + * True if the current query outputting needs only the parent outputs. + * + * @var boolean + */ + protected $parents_only = false; + /** * Initialize the plugin by setting localization, filters, and administration functions. * @@ -37,9 +44,8 @@ public function __construct() { 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( 'render_block_data', array( $this, 'save_checkbox_queries' ), 10, 1 ); add_filter( 'posts_pre_query', array( $this, 'posts_pre_query' ), 10, 2 ); - - add_filter( 'render_block_data', array( $this, 'save_onsale_queries' ), 10, 1 ); } /** @@ -55,6 +61,7 @@ public function enqueue_block_variations_script() { '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' ), + 'maps' => array( 'wp-blocks', 'wp-dom-ready', 'wp-edit-post', 'lsx-to-block-general-variations' ), ]; $additional_scripts = [ @@ -108,11 +115,31 @@ public function enqueue_block_variations_script() { public function query_args_filter( $query, $block ) { $block = $block->parsed_block; + // These are for all query blocks. + 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; + } + + if ( true === $this->parents_only ) { + $query['post_parent'] = 0; + } + + // Determine if this is the custom block variation. if ( ! isset( $block['attrs']['className'] ) ) { return $query; } - + + // Add our specific query args to the query for our variations. $pattern = "/(lsx|facts)-(.*?)-query/"; preg_match( $pattern, $block['attrs']['className'], $matches ); @@ -179,18 +206,27 @@ public function query_args_filter( $query, $block ) { $directions = explode( '-related-', $key ); $to = $directions[0]; $from = $directions[1]; + $items = []; + + do_action('qm/debug',$key); // Get the current item IDS to exclude if ( $to === $from ) { $excluded_items = [ get_the_ID() ]; - } else { - $excluded_items = get_post_meta( get_the_ID(), $to . '_to_' . $from, true ); - if ( ! empty( $excluded_items ) ) { - if ( ! is_array( $excluded_items ) ) { - $excluded_items = [ $excluded_items ]; - } - } else { - $excluded_items = []; + } + + + $found_items = get_post_meta( get_the_ID(), $to . '_to_' . $from, true ); + + if ( false !== $found_items && ! empty( $found_items ) ) { + if ( ! is_array( $found_items ) ) { + $found_items = [ $found_items ]; + } + + $found_items = $this->filter_existing_ids( $found_items ); + + if ( ! empty( $found_items ) ) { + $items = array_merge( $items, $found_items ); } } @@ -198,30 +234,35 @@ public function query_args_filter( $query, $block ) { $destinations = get_post_meta( get_the_ID(), 'destination_to_' . $from, true ); if ( ! empty( $destinations ) ) { - $items = []; foreach ( $destinations as $destination ) { + if ( '' === $destination ) { + continue; + } + $found_items = get_post_meta( $destination, $to . '_to_destination', true ); if ( ! empty( $found_items ) ) { if ( ! is_array( $found_items ) ) { $found_items = [ $found_items ]; } + $found_items = $this->filter_existing_ids( $found_items ); $items = array_merge( $items, $found_items ); } } - - if ( ! empty( $items ) ) { - $items = array_unique( $items ); - $items = array_diff( $items, $excluded_items ); - $query['post__in'] = $items; - } } + if ( ! empty( $items ) ) { + $items = array_unique( $items ); + $query['post__in'] = $items; + } if ( ! isset( $query['post__in'] ) ) { $this->disabled[ $key ] = true; } - // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in - $query['post__not_in'] = $excluded_items; + if ( ! empty( $excluded_items ) ) { + // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_post__not_in + $query['post__not_in'] = $excluded_items; + + } break; @@ -246,7 +287,16 @@ public function query_args_filter( $query, $block ) { if ( ! is_array( $found_items ) ) { $found_items = [ $found_items ]; } - $query['post__in'] = $found_items; + + $found_items = $this->filter_existing_ids( $found_items ); + + if ( ! empty( $found_items ) ) { + $query['post__in'] = $found_items; + } else { + $this->disabled[ $key ] = true; + $query['post__in'] = [ get_the_ID() ]; + } + } else { $this->disabled[ $key ] = true; $query['post__in'] = [ get_the_ID() ]; @@ -258,22 +308,6 @@ 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; } @@ -310,8 +344,6 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj return $block_content; } - do_action( 'qm/debug', $matches ); - if ( in_array( 'travel-information', $matches ) ) { return $block_content; } @@ -383,6 +415,15 @@ public function maybe_hide_varitaion( $block_content, $parsed_block, $block_obj if ( empty( wp_get_post_terms( get_the_ID(), $key, $tax_args ) ) ) { $block_content = ''; } + } else if ( 'location' === $key ) { + if ( ! lsx_to_has_map() ) { + $block_content = ''; + } + } else if ( 'gallery' === $key ) { + $value = get_post_meta( get_the_ID(), $key, true ); + if ( ! is_array( $value ) ) { + $block_content = ''; + } } else { $key = str_replace( '-', '_', $key ); $key_array = [ $key ]; @@ -395,8 +436,6 @@ 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 ) ) { @@ -448,6 +487,21 @@ protected function post_ids_exist( $ids ) { return $result; } + protected function filter_existing_ids( $ids ) { + $ids = array_unique( $ids ); + $new_ids = []; + foreach ( $ids as $key => $id ) { + if ( empty( $id ) ) { + continue; + } + if ( 0 === $this->post_ids_exist( $id ) ) { + continue; + } + $new_ids[] = $id; + } + return $new_ids; + } + /** * This function will grab our Featured query so we dont have to redo that. * @@ -483,7 +537,7 @@ public function find_featured_items( $query ) { * @param array $parsed_block * @return array */ - public function save_onsale_queries( $parsed_block ) { + public function save_checkbox_queries( $parsed_block ) { if ( ! isset( $parsed_block['blockName'] ) || ! isset( $parsed_block['attrs'] ) ) { return $parsed_block; } @@ -494,15 +548,21 @@ public function save_onsale_queries( $parsed_block ) { 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; } + + $this->parents_only = false; + if ( false !== stripos( $parsed_block['attrs']['className'], 'parents-only' ) ) { + $this->parents_only = true; + } + return $parsed_block; } } diff --git a/includes/classes/blocks/class-templates.php b/includes/classes/blocks/class-templates.php index a7c14f27..21473379 100644 --- a/includes/classes/blocks/class-templates.php +++ b/includes/classes/blocks/class-templates.php @@ -81,23 +81,7 @@ public function register_post_type_templates() { 'search-results' => [ 'title' => __( 'Search Results', 'tour-operator' ), 'description' => __( 'Displays when a visitor performs a search on your website.', 'tour-operator' ), - ], - 'index' => [ - 'title' => __( 'Index', 'tour-operator' ), - 'description' => __( 'Used as a fallback template for all pages when a more specific template is not defined.', 'tour-operator' ), - ], - 'no-title' => [ - 'title' => __( 'No Title', 'tour-operator' ), - 'description' => __( 'A generic page template with no page title displayed', 'tour-operator' ), - ], - 'pages' => [ - 'title' => __( 'Pages', 'tour-operator' ), - 'description' => __( 'A generic page template with a page title displayed', 'tour-operator' ), - ], - 'archive' => [ - 'title' => __( 'All Archives', 'tour-operator' ), - 'description' => __( 'Displays any archive, including posts by a single author, category, tag, taxonomy, custom post type, and date. This template will serve as a fallback when more specific templates (e.g., Category or Tag) cannot be found.', 'tour-operator' ), - ], + ] ]; foreach ( $post_types as $key => $labels ) { diff --git a/includes/classes/class-post-connections.php b/includes/classes/class-post-connections.php index 13ab817d..bcc4f5e8 100644 --- a/includes/classes/class-post-connections.php +++ b/includes/classes/class-post-connections.php @@ -23,6 +23,15 @@ class Post_Connections { */ public $options = array(); + public $sources = 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', + ); + /** * Constructor */ @@ -31,6 +40,7 @@ public function __construct() { 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 ); + add_filter( 'facetwp_facet_dropdown_show_counts', [ $this, 'disable_facet_count' ] , 10, 2 ); } /** @@ -73,6 +83,11 @@ public static function get_instance() { * Alter the rows and include extra facets rows for the continents */ public function facetwp_index_row_data( $rows, $params ) { + + if ( ! isset( $params['facet']['source'] ) ) { + return $rows; + } + switch ( $params['facet']['source'] ) { case 'cf/destination_to_tour': case 'cf/destination_to_accommodation': @@ -242,15 +257,8 @@ public function facetwp_index_row( $params, $class ) { * @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'] ) { + + if ( in_array( $params['facet']['source'], $this->sources ) ) { $output = $this->destination_facet_render( $params ); } return $output; @@ -262,15 +270,13 @@ public function destination_facet_html( $output, $params ) { public function destination_facet_render( $params ) { $facet = $params['facet']; - if ( 'checkboxes' !== $params['facet']['type'] ) { + if ( 'checkboxes' !== $params['facet']['type'] && 'fselect' !== $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( @@ -344,6 +350,9 @@ public function destination_facet_render( $params ) { $continent_class = ''; $country_class = ''; + // A variable to keep track if the current parent is checked, if so we will want to display those sub items. + $is_parent_selected = false; + // Run through each value and output the values. foreach ( $values as $key => $facet ) { $depth_type = ''; @@ -377,13 +386,17 @@ public function destination_facet_render( $params ) { } } - if ( $facet['depth'] <= $current_depth ) { + // Check if this is a parent. + if ( 0 === (int) $facet['depth'] ) { + $is_parent_selected = in_array( $facet['facet_value'], $selected_values ); + } + + if ( ( $facet['depth'] <= $current_depth && $is_parent_selected ) || 0 === (int) $facet['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 ); } - } } @@ -391,6 +404,10 @@ public function destination_facet_render( $params ) { $output = implode( '', $options ); } + if ( 'fselect' === $params['facet']['type'] ) { + $output = ''; + } + $output = '' . $output . ''; return $output; @@ -448,15 +465,24 @@ public function format_checkbox_facet( $key, $result, $selected_values, $region 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 = in_array( $result['facet_value'], $selected_values ) ? ' selected' : ''; $selected .= ' ' . $region; - - $temp_html .= '
- -
' . $result['facet_display_value'] . ' (' . $result['counter'] . ')
-
'; + $temp_html .= ''; return $temp_html; } + + /** + * Disables the facet coun on the fselect facet. + * + * @param boolean $return + * @param array $params + * @return boolean + */ + public function disable_facet_count( $return, $params ) { + if ( in_array( $params['facet']['source'], $this->sources ) && 'fselect' === $params['facet']['type'] ) { + return false; + } + return $return; + } } diff --git a/includes/classes/legacy/class-admin.php b/includes/classes/legacy/class-admin.php index b9fdb34f..06bf5f6f 100644 --- a/includes/classes/legacy/class-admin.php +++ b/includes/classes/legacy/class-admin.php @@ -62,7 +62,6 @@ public function __construct() { add_action( 'init', array( $this, 'init' ) ); add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_stylescripts' ), 999 ); - add_action( 'cmb_save_custom', array( $this, 'post_relations' ), 3, 20 ); } /** @@ -72,6 +71,8 @@ public function __construct() { */ public function init() { if ( is_admin() ) { + add_action( 'cmb2_pre_save_field', array( $this, 'cpt_relations' ), 2, 20 ); + $this->connections = $this->create_post_connections(); $this->single_fields = apply_filters( 'lsx_to_search_fields', array() ); $this->taxonomies = apply_filters( 'lsx_to_taxonomies', $this->taxonomies ); @@ -135,100 +136,101 @@ public function enqueue_admin_stylescripts( $hook ) { } /** - * Sets up the "post relations" + * Fixes the CMB2 field relations * - * @return object + * @param string $field_id + * @param bool $status + * @param string $action + * @param object $field + * @return void */ - public function post_relations( $post_id, $field, $value ) { - if ( 'group' === $field['type'] && isset( $this->single_fields ) && array_key_exists( $field['id'], $this->single_fields ) ) { - $delete_counter = array(); - - foreach ( $this->single_fields[ $field['id'] ] as $fields_to_save ) { - $delete_counter[ $fields_to_save ] = 0; + public function cpt_relations( $field_id, $field ) { + + if ( in_array( $field_id, $this->connections ) ) { + $connected_id = get_the_ID(); + $previous_values = get_post_meta( $connected_id, $field_id, true ); + $remote_key = $this->reverse_key( $field_id ); + + if ( isset( $field->data_to_save[ $field_id ] ) ) { + $new_values = $field->data_to_save[ $field_id ]; + } else { + $new_values = array(); } - //Loop through each group in case of repeatable fields - $relations = false; - $previous_relations = false; - - foreach ( $value as $group ) { - //loop through each of the fields in the group that need to be saved and grab their values. - foreach ( $this->single_fields[ $field['id'] ] as $fields_to_save ) { - //Check if its an empty group - if ( isset( $group[ $fields_to_save ] ) && ! empty( $group[ $fields_to_save ] ) ) { - if ( $delete_counter[ $fields_to_save ] < 1 ) { - //If this is a relation field, then we need to save the previous relations to remove any items if need be. - if ( in_array( $fields_to_save, $this->connections ) ) { - $previous_relations[ $fields_to_save ] = get_post_meta( $post_id, $fields_to_save, false ); - } - - delete_post_meta( $post_id, $fields_to_save ); - $delete_counter[ $fields_to_save ] ++; - } - - //Run through each group - foreach ( $group[ $fields_to_save ] as $field_value ) { - if ( null !== $field_value ) { - if ( 1 === $field_value ) { - $field_value = true; - } - - add_post_meta( $post_id, $fields_to_save, $field_value ); - - //If its a related connection the save that - if ( in_array( $fields_to_save, $this->connections ) ) { - $relations[ $fields_to_save ][ $field_value ] = $field_value; - } - } - } + //if the new values are empty, then we need to remove the previous values. + if ( empty( $new_values ) ) { + if ( ! empty( $previous_values ) ) { + foreach ( $previous_values as $remote_id ) { + $this->remove_connected_id( $remote_id, $connected_id, $remote_key ); } } - }//end of the repeatable group foreach + } else { + + if ( ! is_array( $previous_values ) ) { + $previous_values = [ $previous_values ]; + } - //If we have relations, loop through them and save the meta - if ( false !== $relations ) { - foreach ( $relations as $relation_key => $relation_values ) { - $temp_field = array( - 'id' => $relation_key, - ); + // Now determine if we added or removed any values. + $is_removing = array_diff( $previous_values, $new_values ); + $is_adding = array_diff( $new_values, $previous_values ); - $this->save_related_post( $post_id, $temp_field, $relation_values, $previous_relations[ $relation_key ] ); + if ( ! empty( $is_removing ) ) { + foreach ( $is_removing as $remote_id ) { + $this->remove_connected_id( $remote_id, $connected_id, $remote_key ); + } + } + + if ( ! empty( $is_adding ) ) { + foreach ( $is_adding as $remote_id ) { + $this->add_connected_id( $remote_id, $connected_id, $remote_key ); + } } - } - } else { - if ( in_array( $field['id'], $this->connections ) ) { - $this->save_related_post( $post_id, $field, $value ); } } } /** - * Save the reverse post relation. + * Reverses the key for the remote_key slug. * - * @return null + * @param [type] $meta_key + * @return void */ - public function save_related_post( $post_id, $field, $value, $previous_values = false ) { - $ids = explode( '_to_', $field['id'] ); - $relation = $ids[1] . '_to_' . $ids[0]; - - if ( in_array( $relation, $this->connections ) ) { - if ( false === $previous_values ) { - $previous_values = get_post_meta( $post_id, $field['id'], false ); - } + public function reverse_key( $meta_key ) { + $ids = explode( '_to_', $meta_key ); + return $ids[1] . '_to_' . $ids[0]; + } - if ( false !== $previous_values && ! empty( $previous_values ) ) { - foreach ( $previous_values as $tr ) { - delete_post_meta( $tr, $relation, $post_id ); - } - } + /** + * Remove the connected ID from the serialized array. + * + * @param int $remote_id + * @param int $connected_id + * @param string $meta_key + * @return void + */ + public function remove_connected_id( $remote_id, $connected_id, $meta_key ) { + $prev = get_post_meta( $remote_id, $meta_key, true ); + if ( ! empty( $prev ) ) { + $diff = array_diff( $prev, array( $connected_id ) ); + update_post_meta( $remote_id, $meta_key, $diff, $prev ); + } + } - if ( is_array( $value ) ) { - foreach ( $value as $v ) { - if ( '' !== $v && null !== $v && false !== $v ) { - add_post_meta( $v, $relation, $post_id ); - } - } + public function add_connected_id( $remote_id, $connected_id, $meta_key ) { + $prev = get_post_meta( $remote_id, $meta_key, true ); + // No Previous items detected. + if ( false === $prev || empty( $prev ) ) { + delete_post_meta( $remote_id, $meta_key ); + $test = add_post_meta( $remote_id, $meta_key, array( $connected_id ), true ); + } else { + if ( ! is_array( $prev ) ) { + $new = array( $prev ); + } else { + $new = $prev; } + $new[] = $connected_id; + $new = array_unique( $new ); + $updated = update_post_meta( $remote_id, $meta_key, $new, $prev ); } } diff --git a/includes/classes/legacy/class-destination.php b/includes/classes/legacy/class-destination.php index 090fa15a..c26527bf 100644 --- a/includes/classes/legacy/class-destination.php +++ b/includes/classes/legacy/class-destination.php @@ -43,6 +43,8 @@ class Destination { */ protected $plugin_screen_hook_suffix = null; + public $modals = []; + /** * Initialize the plugin by setting localization, filters, and * administration functions. @@ -56,6 +58,13 @@ private function __construct() { add_action( 'lsx_to_map_meta', array( $this, 'content_meta' ) ); add_action( 'lsx_to_modal_meta', array( $this, 'content_meta' ) ); add_filter( 'lsx_to_parents_only', array( $this, 'filter_countries' ) ); + + add_filter( 'lsx_to_custom_field_query', array( $this, 'travel_information_excerpt' ), 5, 10 ); + add_filter( 'facetwp_query_args', [ $this, 'facet_wp_filter' ] , 10, 2 ); + add_action( 'pre_get_posts', [ $this, 'only_parent_destinations' ] ); + + add_action( 'wp_footer', array( $this, 'output_modals' ) ); + } /** @@ -107,4 +116,88 @@ public function filter_countries( $countries = array() ) { } return $countries; } + + public function only_parent_destinations( $query ) { + // Only run on the front end and for the main query + if ( ! is_admin() && $query->is_main_query() && $query->is_post_type_archive( 'destination' ) ) { + // Show only top-level + $query->set( 'post_parent', 0 ); + + // Alphabetical by title + $query->set( 'orderby', 'title' ); + $query->set( 'order', 'ASC' ); + + // Make sure pagination is not disabled + $query->set( 'posts_per_page', 12 ); // or your desired number + $query->set( 'paged', get_query_var( 'paged' ) ); + $query->set( 'nopaging', false ); + } + } + + /** + * Sets the destination archive to only show top-level destinations + * + * @param array $args + * @param array $facet + * @return array + */ + public function facet_wp_filter( $args, $facet ) { + if ( ! is_admin() && is_post_type_archive( 'destination' ) ) { + $args['post_parent'] = 0; + $args['orderby'] = 'title'; + $args['order'] = 'ASC'; + $args['posts_per_page'] = 12; + } + return $args; + } + + /** + * Filter the travel information and return a shortened version. + */ + public function travel_information_excerpt( $html = '', $meta_key = false, $value = false, $before = '', $after = '' ) { + $limit_chars = 150; + $ti_keys = [ + 'electricity', + 'banking', + 'cuisine', + 'climate', + 'transport', + 'dress', + 'health', + 'safety', + 'visa', + 'additional_info', + ]; + + if ( get_post_type() === 'destination' && in_array( $meta_key, $ti_keys ) ) { + $this->modals[ $meta_key ] = $html; + + $value = wp_trim_excerpt( wp_strip_all_tags( $html ) ); + $value = str_replace( '
', ' ', $value ); + $value = str_replace( '
', ' ', $value ); + + if ( strlen( $value ) > $limit_chars ) { + $position = strpos( $value, ' ', $limit_chars ); + if ( false !== $position ) { + $value_output = substr( $value, 0, $position ); + } else { + $value_output = $value; + } + $value = trim( force_balance_tags( $value_output . '...' ) ); + } + + $html = trim( force_balance_tags( $value ) ); + } + return $html; + } + + public function output_modals() { + if ( ! empty( $this->modals ) ) { + foreach ( $this->modals as $key => $content ) { + $heading = '

' . ucwords( $key ) . '

'; + $modal = ''; + echo wp_kses_post( $modal ); + } + } + } } diff --git a/includes/classes/legacy/class-frontend.php b/includes/classes/legacy/class-frontend.php index 87b499e3..8450b6ae 100644 --- a/includes/classes/legacy/class-frontend.php +++ b/includes/classes/legacy/class-frontend.php @@ -57,11 +57,9 @@ public function __construct() { if ( ! is_admin() ) { add_filter( 'pre_get_posts', array( $this, 'travel_style_post_types' ), 10, 1 ); - add_filter( 'posts_orderby', array( $this, 'enable_continent_taxonomy_order' ), 10, 2 ); } - // add_filter( 'the_terms', array( $this, 'links_new_window' ), 10, 2 ); - $this->maps = Maps::get_instance(); + $this->maps = new Maps(); add_filter( 'get_the_archive_title', array( $this, 'get_the_archive_title' ), 100 ); @@ -97,39 +95,6 @@ public function enqueue_stylescripts() { wp_enqueue_script( 'tour-operator-script', LSX_TO_URL . 'assets/js/' . $prefix . 'custom' . $suffix . '.js', array( 'jquery', 'slick', 'slick-lightbox'/*, 'fixto'*/ ), LSX_TO_VER, true ); - $param_array = array( - 'slickSlider' => array( - 'desktop' => array( - 'draggable' => false, - 'infinite' => true, - 'swipe' => false, - 'cssEase' => 'ease-out', - 'dots' => true, - 'slidesToShow' => 3, - 'slidesToScroll' => 3, - ), - 'tablet' => array( - 'slidesToShow' => 3, - 'slidesToScroll' => 3, - 'draggable' => true, - 'arrows' => false, - 'swipe' => true, - 'breakpoint' => 992, - ), - 'mobile' => array( - 'slidesToShow' => 1, - 'slidesToScroll' => 1, - 'draggable' => true, - 'arrows' => false, - 'swipe' => true, - 'breakpoint' => 768, - ), - ), - ); - $param_array = apply_filters( 'lsx_to_js_params', $param_array ); - wp_localize_script( 'tour-operator-script', 'lsx_to_params', $param_array ); - - if ( ! $has_slick ) { wp_enqueue_style( 'slick', LSX_TO_URL . 'assets/css/vendor/slick.css', array(), LSX_TO_VER ); } @@ -140,7 +105,6 @@ public function enqueue_stylescripts() { wp_enqueue_style( 'tour-operator-style', LSX_TO_URL . 'assets/css/style.css', array(), LSX_TO_VER ); wp_style_add_data( 'tour-operator-style', 'rtl', 'replace' ); - } /** @@ -154,32 +118,6 @@ public function travel_style_post_types( $query ) { return $query; } - /** - * Enable continent taxonomy order. - */ - public function enable_continent_taxonomy_order( $orderby, $query ) { - global $wpdb; - - if ( $query->is_main_query() && $query->is_post_type_archive( 'destination' ) ) { - if ( isset( $this->options['destination'] ) && isset( $this->options['destination']['group_items_by_continent'] ) ) { - $new_orderby = "( - SELECT GROUP_CONCAT(lsx_to_term_order ORDER BY lsx_to_term_order ASC) - FROM $wpdb->term_relationships - INNER JOIN $wpdb->term_taxonomy USING (term_taxonomy_id) - INNER JOIN $wpdb->terms USING (term_id) - WHERE $wpdb->posts.ID = object_id - AND taxonomy = 'continent' - GROUP BY object_id - ) "; - - $new_orderby .= ( 'ASC' == strtoupper( $query->get( 'order' ) ) ) ? 'ASC' : 'DESC'; - $orderby = $new_orderby . ', ' . $orderby; - } - } - - return $orderby; - } - /** * Add a some classes so we can style. */ diff --git a/includes/classes/legacy/class-maps.php b/includes/classes/legacy/class-maps.php index 7ee277ce..f2822560 100644 --- a/includes/classes/legacy/class-maps.php +++ b/includes/classes/legacy/class-maps.php @@ -17,587 +17,519 @@ * @package Destination * @author LightSpeed */ -class Maps { - - /** - * Holds instances of the class - * - * @var object \lsx\legacy\Maps() - */ - protected static $instance; - - /** - * If the maps are enabled. - * - * @var bool - */ - public $maps_enabled = false; - - /** - * Holds the value of the current marker - * - * @var bool - */ - public $current_marker = false; - - /** - * If the map placeholder is enabled. - * - * @var bool - */ - public $placeholder_enabled = false; - - /** - * If the map should display in the destinations banner. - * - * @var bool - */ - public $enable_banner_map = false; - - /** - * The post types this post should work with - * - * @var array - */ - public $post_types = array(); - - /** - * Constructor - */ - public function __construct() { - add_action( 'wp_enqueue_scripts', array( $this, 'assets' ), 1499 ); - $this->post_types = array( +class Maps +{ + + /** + * If the maps are enabled. + * + * @var bool + */ + public $maps_enabled = false; + + /** + * Holds the value of the current marker + * + * @var bool + */ + public $current_marker = false; + + /** + * If the map placeholder is enabled. + * + * @var bool + */ + public $placeholder_enabled = false; + + /** + * If the map should display in the destinations banner. + * + * @var bool + */ + public $enable_banner_map = false; + + /** + * The post types this post should work with + * + * @var array + */ + public $post_types = array(); + + /** + * Constructor + */ + public function __construct() { + $this->post_types = array( 'destination', 'accommodation', 'tour', - ); - } - - /** - * Return an instance of this class. - * - * @since 1.0.0 - * @return object A single instance of this class. - */ - public static function get_instance() { - // If the single instance hasn't been set, set it now. - if ( is_null( self::$instance ) ) { - self::$instance = new self(); - } - - return self::$instance; - } - - /** - * Enques the assets - */ - public function assets() { - if ( $this->is_a_bot() || ! lsx_to_has_map() || true === apply_filters( 'lsx_to_disable_map_js', false ) ) { - return; - } - $settings = tour_operator()->options; - $api_key = ''; - $preview_src = $this->get_map_preview_src(); - - if ( isset( $settings['api']['googlemaps_key'] ) ) { - $api_key = $settings['api']['googlemaps_key']; - } - if ( isset( $settings['destination'] ) && isset( $settings['destination']['enable_banner_map'] ) && 'on' === $settings['destination']['enable_banner_map'] ) { - $this->enable_banner_map = apply_filters( 'lsx_to_has_destination_banner_map', true ); - } - - if ( isset( $settings['display'] ) && isset( $settings['display']['map_placeholder_enabled'] ) && 'on' === $settings['display']['map_placeholder_enabled'] ) { - if ( ( is_post_type_archive( 'destination' ) || is_singular( 'destination' ) ) && true === $this->enable_banner_map ) { - $this->placeholder_enabled = false; - } elseif ( '' !== $preview_src ) { - $this->placeholder_enabled = true; - } - } - $this->placeholder_enabled = apply_filters( 'lsx_to_map_placeholder_enabled', $this->placeholder_enabled ); - if ( defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ) { - $prefix = 'src/'; - $suffix = ''; - } else { - $prefix = ''; - $suffix = '.min'; - } - - $dependacies = array( 'jquery', 'googlemaps_api', 'googlemaps_api_markercluster' ); - $google_url = 'https://maps.googleapis.com/maps/api/js?key=' . $api_key . '&libraries=places'; - $google_marker_cluster = LSX_TO_URL . 'assets/js/vendor/google-markerCluster.js'; - - if ( true === $this->placeholder_enabled ) { - $dependacies = array( 'jquery' ); - } else { - wp_enqueue_script( 'googlemaps_api', $google_url, array( 'jquery' ), LSX_TO_VER, true ); - wp_enqueue_script( 'googlemaps_api_markercluster', $google_marker_cluster, array( 'googlemaps_api' ), LSX_TO_VER, true ); - } - - wp_enqueue_script( - 'lsx_to_maps', - LSX_TO_URL . 'assets/js/' . $prefix . 'maps' . $suffix . '.js', - $dependacies, - LSX_TO_VER, - true - ); - wp_localize_script( - 'lsx_to_maps', - 'lsx_to_maps_params', - array( - 'apiKey' => $api_key, - 'start_marker' => tour_operator()->markers->start, - 'end_marker' => tour_operator()->markers->end, - 'placeholder_enabled' => $this->placeholder_enabled, - 'enable_banner_map' => $this->enable_banner_map, - 'google_url' => $google_url, - 'google_cluster_url' => $google_marker_cluster, - ) - ); - } - - /** - * Output the Map - * - * @since 1.0.0 - * - * @return null - */ - public function map_output( $post_id = false, $args = array() ) { - $defaults = array( - 'latitude' => '-33.914482', - 'longitude' => '18.3758789', - 'zoom' => 14, - 'width' => '100%', - 'height' => '400px', - 'type' => 'single', - 'search' => '', - 'connections' => false, - 'link' => true, - 'selector' => '.lsx-map-preview', - 'icon' => false, - 'content' => 'address', - 'kml' => false, - 'cluster_small' => tour_operator()->markers->cluster_small, - 'cluster_medium' => tour_operator()->markers->cluster_medium, - 'cluster_large' => tour_operator()->markers->cluster_large, - 'fusion_tables' => false, - 'fusion_tables_colour_border' => '#000000', - 'fusion_tables_width_border' => '2', - 'fusion_tables_colour_background' => '#000000', - 'disable_cluster_js' => false, - 'disable_auto_zoom' => false, - ); - - $args = wp_parse_args( $args, $defaults ); - $map_classes = array( 'lsx-map' ); - if ( true === $args['disable_auto_zoom'] ) { - $map_classes[] = 'disable-auto-zoom'; - } - if ( true === $this->placeholder_enabled ) { - $map_classes[] = 'map-has-placeholder'; - } - - $thumbnail = ''; - if ( false === $args['icon'] ) { - $icon = $this->set_icon( $post_id ); - } - - if ( ( '-33.914482' !== $args['latitude'] && '18.3758789' !== $args['longitude'] ) || false !== $args['search'] || 'cluster' === $args['type'] || 'route' === $args['type'] ) { - $map = '
'; - if ( true === $this->placeholder_enabled ) { - $map .= $this->get_map_preview_html( $args['width'], $args['height'] ); - } - $map .= '
'; - - $map .= ''; + $map .= '
'; + + $this->assets(); + + return $map; + } + } + + /** + * Returns the map marker. + * + * @param boolean $post_id + * @return mixed + */ + public function set_icon( $post_id = false ) { + $icon = tour_operator()->markers->default_marker; + if (false !== $post_id ) { + $connection_type = get_post_type($post_id); + $to_post_types = array_keys(lsx_to_get_post_types()); + if ( in_array( $connection_type, $to_post_types ) && isset( tour_operator()->markers->post_types[ $connection_type ] ) ) { + $icon = tour_operator()->markers->post_types[ $connection_type ]; + } else { + $icon = apply_filters('lsx_to_default_map_marker', tour_operator()->markers->default_marker); + } + } + return $icon; + } + + /** + * Checking for bots on the maps. + * + * @package ctt-lsx-child + */ + public function is_a_bot() { + $is_bot = false; + $user_agents = array( + 'Googlebot', + 'Googlebot-Mobile', + 'Googlebot-Image', + 'Googlebot-News', + 'Googlebot-Video', + 'AdsBot-Google', + 'AdsBot-Google-Mobile-Apps', + 'Feedfetcher-Google', + 'Mediapartners-Google', + 'APIs-Google', + 'GTmetrix', + 'Baiduspider', + 'ia_archiver', + 'R6_FeedFetcher', + 'NetcraftSurveyAgent', + 'Sogou web spider', + 'bingbot', + 'BingPreview', + 'slurp', + 'Yahoo! Slurp', + 'Ask Jeeves/Teoma', + 'facebookexternalhit', + 'PrintfulBot', + 'msnbot', + 'Twitterbot', + 'UnwindFetchor', + 'urlresolver', + 'Butterfly', + 'TweetmemeBot', + 'PaperLiBot', + 'MJ12bot', + 'AhrefsBot', + 'Exabot', + 'Ezooms', + 'YandexBot', + 'SearchmetricsBot', + 'picsearch', + 'TweetedTimes Bot', + 'QuerySeekerSpider', + 'ShowyouBot', + 'woriobot', + 'merlinkbot', + 'BazQuxBot', + 'Kraken', + 'SISTRIX Crawler', + 'R6_CommentReader', + 'magpie-crawler', + 'GrapeshotCrawler', + 'PercolateCrawler', + 'MaxPointCrawler', + 'R6_FeedFetcher', + 'NetSeer crawler', + 'grokkit-crawler', + 'SMXCrawler', + 'PulseCrawler', + 'Y!J-BRW', + '80legs.com/webcrawler', + 'Mediapartners-Google', + 'Spinn3r', + 'InAGist', + 'Python-urllib', + 'NING', + 'TencentTraveler', + 'Feedfetcher-Google', + 'mon.itor.us', + 'spbot', + 'Feedly', + 'bitlybot', + 'ADmantX Platform', + 'Niki-Bot', + 'Pinterest', + 'python-requests', + 'DotBot', + 'HTTP_Request2', + 'linkdexbot', + 'A6-Indexer', + 'Baiduspider', + 'TwitterFeed', + 'Microsoft Office', + 'Pingdom', + 'BTWebClient', + 'KatBot', + 'SiteCheck', + 'proximic', + 'Sleuth', + 'Abonti', + '(BOT for JCE)', + 'Baidu', + 'Tiny Tiny RSS', + 'newsblur', + 'updown_tester', + 'linkdex', + 'baidu', + 'searchmetrics', + 'genieo', + 'majestic12', + 'spinn3r', + 'profound', + 'domainappender', + 'VegeBot', + 'terrykyleseoagency.com', + 'CommonCrawler Node', + 'AdlesseBot', + 'metauri.com', + 'libwww-perl', + 'rogerbot-crawler', + 'MegaIndex.ru', + 'ltx71', + 'Qwantify', + 'Traackr.com', + 'Re-Animator Bot', + 'Pcore-HTTP', + 'BoardReader', + 'omgili', + 'okhttp', + 'CCBot', + 'Java/1.8', + 'semrush.com', + 'feedbot', + 'CommonCrawler', + 'AdlesseBot', + 'MetaURI', + 'ibwww-perl', + 'rogerbot', + 'MegaIndex', + 'BLEXBot', + 'FlipboardProxy', + 'techinfo@ubermetrics-technologies.com', + 'trendictionbot', + 'Mediatoolkitbot', + 'trendiction', + 'ubermetrics', + 'ScooperBot', + 'TrendsmapResolver', + 'Nuzzel', + 'Go-http-client', + 'Applebot', + 'LivelapBot', + 'GroupHigh', + 'SemrushBot', + 'ltx71', + 'commoncrawl', + 'istellabot', + 'DomainCrawler', + 'cs.daum.net', + 'StormCrawler', + 'GarlikCrawler', + 'The Knowledge AI', + 'getstream.io/winds', + 'YisouSpider', + 'archive.org_bot', + 'semantic-visions.com', + 'FemtosearchBot', + '360Spider', + 'linkfluence.com', + 'glutenfreepleasure.com', + 'Gluten Free Crawler', + 'YaK/1.0', + 'Cliqzbot', + 'app.hypefactors.com', + 'axios', + 'semantic-visions.com', + 'webdatastats.com', + 'schmorp.de', + 'SEOkicks', + 'DuckABot', + 'AOLBuild', + 'Barkrowler', + 'ZoominfoBot', + 'Linguee Bot', + 'Mail.RU_Bot', + 'OnalyticaBot', + 'Linguee Bot', + 'admantx-adform', + 'Buck/2.2', + 'Barkrowler', + 'Zombiebot', + 'Nutch', + 'SemanticScholarBot', + "Jetslid'e", + 'scalaj-http', + 'XoviBot', + 'sysomos.com', + 'PocketParser', + 'newspaper', + 'serpstatbot', + ); + // @phpcs:ignore WordPress.Security.NonceVerification.Recommended + if (isset($_GET['debug_bot']) ) { + // @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'])); + } else { + return false; } - } - /** - * Returns the map marker. - * - * @param boolean $post_id - * @return mixed - */ - public function set_icon( $post_id = false ) { - $settings = tour_operator()->options; - $icon = tour_operator()->markers->default_marker; - if ( false !== $post_id ) { - $connection_type = get_post_type( $post_id ); - $to_post_types = array_keys( lsx_to_get_post_types() ); - if ( in_array( $connection_type, $to_post_types ) ) { - if ( isset( tour_operator()->markers->post_types[ $connection_type ] ) ) { - $icon = tour_operator()->markers->post_types[ $connection_type ]; - } - } else { - $icon = apply_filters( 'lsx_to_default_map_marker', tour_operator()->markers->default_marker ); + foreach ( $user_agents as $agent ) { + if (strtolower($agent) === strtolower($user_agent) ) { + $is_bot = true; + } + } + return $is_bot; + } + + public function map_marker_html( $connection ) { + ?> +
> + ', ', ', '' ); + the_terms( get_the_ID(), 'accommodation-type', ' ', ', ', '' ); } - } - return $icon; - } - - /** - * Gets the Map Preview image src. - */ - public function get_map_preview_src( $mobile = false, $laptop = false ) { - $settings = tour_operator()->options; - $prefix = ''; - $default_size = '1920x656'; - if ( false !== $mobile ) { - $prefix = '_mobile'; - $default_size = '400x400'; - } - if ( false !== $laptop ) { - $default_size = '1170x400'; - } - - $queried_post_type = get_query_var( 'post_type' ); - if ( is_array( $queried_post_type ) ) { - $queried_post_type = $queried_post_type[0]; - } - - $image = LSX_TO_URL . 'assets/img/placeholders/placeholder-map-' . $default_size . '.jpg'; - - if ( isset( $settings['display'] ) && isset( $settings['display'][ 'map' . $prefix . '_placeholder' ] ) && '' !== $settings['display'][ 'map' . $prefix . '_placeholder' ] ) { - $image = $settings['display'][ 'map' . $prefix . '_placeholder' ]; - } + ?> - if ( isset( $settings[ $queried_post_type ] ) && isset( $settings[ $queried_post_type ][ 'map' . $prefix . '_placeholder' ] ) && '' !== $settings[ $queried_post_type ][ 'map' . $prefix . '_placeholder' ] ) { - $image = $settings[ $queried_post_type ][ 'map' . $prefix . '_placeholder' ]; - } - - if ( is_post_type_archive( $this->post_types ) ) { - if ( isset( $settings[ get_post_type() ] ) && isset( $settings[ get_post_type() ][ 'map' . $prefix . '_placeholder' ] ) && '' !== $settings[ get_post_type() ][ 'map' . $prefix . '_placeholder' ] ) { - $image = $settings[ get_post_type() ][ 'map' . $prefix . '_placeholder' ]; +
+ post_types ) ) { - $potential_placeholder = get_post_meta( get_the_ID(), 'map' . $prefix . '_placeholder', true ); - if ( '' !== $potential_placeholder ) { - $size = 'full'; - if ( false !== $mobile ) { - $size = 'medium'; - } - $potential_placeholder = wp_get_attachment_image_src( $potential_placeholder, 'full' ); - if ( is_array( $potential_placeholder ) && ! empty( $potential_placeholder ) ) { - $image = $potential_placeholder[0]; - } + $excerpt = get_the_excerpt($connection); + if ( empty( $excerpt ) || '' === $excerpt ) { + $tooltip = apply_filters( 'get_the_excerpt', get_the_content() ); + $tooltip = strip_tags( $tooltip ); + echo wp_kses_post( wpautop( $tooltip ) ); + } else { + echo wp_kses_post( $excerpt ); } - } - $image = apply_filters( 'lsx_to_map' . $prefix . '_placeholder_src', $image ); - return $image; - } + ?> +
+
+ get_map_preview_src(); - $preview_html = ''; - if ( '' !== $preview_src ) { - $preview_src_mobile = $this->get_map_preview_src( true ); - if ( '' === $preview_src_mobile ) { - $preview_src_mobile = $preview_src; - } - $preview_src_laptop = $this->get_map_preview_src( false, true ); - if ( '' === $preview_src_laptop ) { - $preview_src_laptop = $preview_src; + function map_start_end_points( $connections = array() ) { + if ( ! empty( $connections ) ) { + $departs_from = get_post_meta( get_the_ID(), 'departs_from', true ); + if ( false !== $departs_from && '' !== $departs_from ) { + $connections = array_merge( array( $departs_from ), $connections ); } - $srcset = $preview_src_mobile . ' 600w,' . $preview_src_laptop . ' 1280w,' . $preview_src . ' 1920w'; - $sizes = 'sizes="(max-width: 600) 10vw, (max-width: 1280px) 50vw, 100vw"'; - $preview_html = ''; - $preview_html .= '

' . esc_html__( 'Click to display the map', 'tour-operator' ) . '

'; - } - return $preview_html; - } - /** - * Checking for bots on the maps. - * - * @package ctt-lsx-child - */ - public function is_a_bot() { - $is_bot = false; - $user_agents = array( - 'Googlebot', - 'Googlebot-Mobile', - 'Googlebot-Image', - 'Googlebot-News', - 'Googlebot-Video', - 'AdsBot-Google', - 'AdsBot-Google-Mobile-Apps', - 'Feedfetcher-Google', - 'Mediapartners-Google', - 'APIs-Google', - 'GTmetrix', - 'Baiduspider', - 'ia_archiver', - 'R6_FeedFetcher', - 'NetcraftSurveyAgent', - 'Sogou web spider', - 'bingbot', - 'BingPreview', - 'slurp', - 'Yahoo! Slurp', - 'Ask Jeeves/Teoma', - 'facebookexternalhit', - 'PrintfulBot', - 'msnbot', - 'Twitterbot', - 'UnwindFetchor', - 'urlresolver', - 'Butterfly', - 'TweetmemeBot', - 'PaperLiBot', - 'MJ12bot', - 'AhrefsBot', - 'Exabot', - 'Ezooms', - 'YandexBot', - 'SearchmetricsBot', - 'picsearch', - 'TweetedTimes Bot', - 'QuerySeekerSpider', - 'ShowyouBot', - 'woriobot', - 'merlinkbot', - 'BazQuxBot', - 'Kraken', - 'SISTRIX Crawler', - 'R6_CommentReader', - 'magpie-crawler', - 'GrapeshotCrawler', - 'PercolateCrawler', - 'MaxPointCrawler', - 'R6_FeedFetcher', - 'NetSeer crawler', - 'grokkit-crawler', - 'SMXCrawler', - 'PulseCrawler', - 'Y!J-BRW', - '80legs.com/webcrawler', - 'Mediapartners-Google', - 'Spinn3r', - 'InAGist', - 'Python-urllib', - 'NING', - 'TencentTraveler', - 'Feedfetcher-Google', - 'mon.itor.us', - 'spbot', - 'Feedly', - 'bitlybot', - 'ADmantX Platform', - 'Niki-Bot', - 'Pinterest', - 'python-requests', - 'DotBot', - 'HTTP_Request2', - 'linkdexbot', - 'A6-Indexer', - 'Baiduspider', - 'TwitterFeed', - 'Microsoft Office', - 'Pingdom', - 'BTWebClient', - 'KatBot', - 'SiteCheck', - 'proximic', - 'Sleuth', - 'Abonti', - '(BOT for JCE)', - 'Baidu', - 'Tiny Tiny RSS', - 'newsblur', - 'updown_tester', - 'linkdex', - 'baidu', - 'searchmetrics', - 'genieo', - 'majestic12', - 'spinn3r', - 'profound', - 'domainappender', - 'VegeBot', - 'terrykyleseoagency.com', - 'CommonCrawler Node', - 'AdlesseBot', - 'metauri.com', - 'libwww-perl', - 'rogerbot-crawler', - 'MegaIndex.ru', - 'ltx71', - 'Qwantify', - 'Traackr.com', - 'Re-Animator Bot', - 'Pcore-HTTP', - 'BoardReader', - 'omgili', - 'okhttp', - 'CCBot', - 'Java/1.8', - 'semrush.com', - 'feedbot', - 'CommonCrawler', - 'AdlesseBot', - 'MetaURI', - 'ibwww-perl', - 'rogerbot', - 'MegaIndex', - 'BLEXBot', - 'FlipboardProxy', - 'techinfo@ubermetrics-technologies.com', - 'trendictionbot', - 'Mediatoolkitbot', - 'trendiction', - 'ubermetrics', - 'ScooperBot', - 'TrendsmapResolver', - 'Nuzzel', - 'Go-http-client', - 'Applebot', - 'LivelapBot', - 'GroupHigh', - 'SemrushBot', - 'ltx71', - 'commoncrawl', - 'istellabot', - 'DomainCrawler', - 'cs.daum.net', - 'StormCrawler', - 'GarlikCrawler', - 'The Knowledge AI', - 'getstream.io/winds', - 'YisouSpider', - 'archive.org_bot', - 'semantic-visions.com', - 'FemtosearchBot', - '360Spider', - 'linkfluence.com', - 'glutenfreepleasure.com', - 'Gluten Free Crawler', - 'YaK/1.0', - 'Cliqzbot', - 'app.hypefactors.com', - 'axios', - 'semantic-visions.com', - 'webdatastats.com', - 'schmorp.de', - 'SEOkicks', - 'DuckABot', - 'AOLBuild', - 'Barkrowler', - 'ZoominfoBot', - 'Linguee Bot', - 'Mail.RU_Bot', - 'OnalyticaBot', - 'Linguee Bot', - 'admantx-adform', - 'Buck/2.2', - 'Barkrowler', - 'Zombiebot', - 'Nutch', - 'SemanticScholarBot', - "Jetslid'e", - 'scalaj-http', - 'XoviBot', - 'sysomos.com', - 'PocketParser', - 'newspaper', - 'serpstatbot', - ); - // @phpcs:ignore WordPress.Security.NonceVerification.Recommended - if ( isset( $_GET['debug_bot'] ) ) { - // @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 ) { - if ( strtolower( $agent ) === strtolower( $user_agent ) ) { - $is_bot = true; + $ends_in = get_post_meta( get_the_ID(), 'ends_in', true ); + if ( false !== $ends_in && '' !== $ends_in ) { + $connections[] = $ends_in; } } - return $is_bot; + return $connections; } } diff --git a/includes/classes/legacy/class-tour-operator.php b/includes/classes/legacy/class-tour-operator.php index 814ac88a..4cc9e1f6 100644 --- a/includes/classes/legacy/class-tour-operator.php +++ b/includes/classes/legacy/class-tour-operator.php @@ -321,7 +321,6 @@ public function set_vars() { * @return void */ public function set_map_vars() { - return; $this->map_post_types = array( 'accommodation', 'activity', 'destination' ); $this->markers = new \stdClass(); @@ -335,38 +334,40 @@ public function set_map_vars() { $this->google_api_key = false; } - if ( isset( $this->options['display']['googlemaps_marker'] ) && '' !== $this->options['display']['googlemaps_marker'] ) { - $this->markers->default_marker = $this->options['display']['googlemaps_marker']; + do_action('qm/debug',$this->options); + + if ( isset( $this->options['googlemaps_marker_id'] ) && ! empty( $this->options['googlemaps_marker_id'] ) ) { + $this->markers->default_marker = wp_get_attachment_image_src( $this->options['googlemaps_marker_id'], 'full' )[0]; } else { $this->markers->default_marker = LSX_TO_URL . 'assets/img/markers/gmaps-mark.svg'; } - if ( isset( $this->options['display']['gmap_cluster_small'] ) && '' !== $this->options['display']['gmap_cluster_small'] ) { - $this->markers->cluster_small = $this->options['display']['gmap_cluster_small']; + if ( isset( $this->options['gmap_cluster_small'] ) && '' !== $this->options['gmap_cluster_small'] ) { + $this->markers->cluster_small = $this->options['gmap_cluster_small']; } else { $this->markers->cluster_small = LSX_TO_URL . 'assets/img/markers/m1.png'; } - if ( isset( $this->options['display']['gmap_cluster_medium'] ) && '' !== $this->options['display']['gmap_cluster_medium'] ) { - $this->markers->cluster_medium = $this->options['display']['gmap_cluster_medium']; + if ( isset( $this->options['gmap_cluster_medium'] ) && '' !== $this->options['gmap_cluster_medium'] ) { + $this->markers->cluster_medium = $this->options['gmap_cluster_medium']; } else { $this->markers->cluster_medium = LSX_TO_URL . 'assets/img/markers/m2.png'; } - if ( isset( $this->options['display']['gmap_cluster_large'] ) && '' !== $this->options['display']['gmap_cluster_large'] ) { - $this->markers->cluster_large = $this->options['display']['gmap_cluster_large']; + if ( isset( $this->options['gmap_cluster_large'] ) && '' !== $this->options['gmap_cluster_large'] ) { + $this->markers->cluster_large = $this->options['gmap_cluster_large']; } else { $this->markers->cluster_large = LSX_TO_URL . 'assets/img/markers/m3.png'; } - if ( isset( $this->options['display']['gmap_marker_start'] ) && '' !== $this->options['display']['gmap_marker_start'] ) { - $this->markers->start = $this->options['display']['gmap_marker_start']; + if ( isset( $this->options['gmap_marker_start_id'] ) && ! empty( $this->options['gmap_marker_start_id'] ) ) { + $this->markers->start = wp_get_attachment_image_src( $this->options['gmap_marker_start_id'], 'full' )[0]; } else { $this->markers->start = LSX_TO_URL . 'assets/img/markers/start-marker.png'; } - if ( isset( $this->options['display']['gmap_marker_end'] ) && '' !== $this->options['display']['gmap_marker_end'] ) { - $this->markers->end = $this->options['display']['gmap_marker_end']; + if ( isset( $this->options['gmap_marker_end_id'] ) && ! empty( $this->options['gmap_marker_end_id'] ) ) { + $this->markers->end = wp_get_attachment_image_src( $this->options['gmap_marker_end_id'], 'full' )[0]; } else { $this->markers->end = LSX_TO_URL . 'assets/img/markers/end-marker.png'; } diff --git a/includes/constants/settings-fields.php b/includes/constants/settings-fields.php index 1834c697..b865a892 100644 --- a/includes/constants/settings-fields.php +++ b/includes/constants/settings-fields.php @@ -64,18 +64,6 @@ 'default' => 0, 'preview_w' => 300, ), - 'map_placeholder_enabled' => array( - 'label' => esc_html__( 'Enable Map Placeholder', 'tour-operator' ), - 'desc' => esc_html__( 'Enable a placeholder users will click to load the map.', 'tour-operator' ), - 'type' => 'checkbox', - 'default' => 0, - ), - 'map_placeholder' => array( - 'label' => esc_html__( 'Upload a map placeholder', 'tour-operator' ), - 'type' => 'image', - 'default' => 0, - 'preview_w' => 300, - ), ), 'fusion' => array( 'fusion_tables_enabled' => array( @@ -115,19 +103,7 @@ 'type' => 'image', 'default' => 0, 'preview_w' => 300, - ), - 'map_placeholder_enabled' => array( - 'label' => esc_html__( 'Enable Map Placeholder', 'tour-operator' ), - 'desc' => esc_html__( 'Enable a placeholder users will click to load the map.', 'tour-operator' ), - 'type' => 'checkbox', - 'default' => 0, - ), - 'map_placeholder' => array( - 'label' => esc_html__( 'Upload a map placeholder', 'tour-operator' ), - 'type' => 'image', - 'default' => 0, - 'preview_w' => 300, - ), + ) ), 'template' => array( 'disable_archives' => array( diff --git a/includes/template-tags/general.php b/includes/template-tags/general.php index 2fc7605e..c390ec16 100644 --- a/includes/template-tags/general.php +++ b/includes/template-tags/general.php @@ -88,47 +88,6 @@ function lsx_to_itinerary_drinks_basis( $before = '', $after = '', $echo = true return ''; } - -// =============== Tours =================== - -/** - * 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; -} - // ============== Accommodation ================ /** * Outputs the accommodations facilities diff --git a/includes/template-tags/maps.php b/includes/template-tags/maps.php index 0218fb58..cb060c0c 100644 --- a/includes/template-tags/maps.php +++ b/includes/template-tags/maps.php @@ -17,7 +17,7 @@ function lsx_to_is_map_enabled() { $options = tour_operator()->legacy->options; $return = true; - if ( false !== $options && isset( $options['display']['maps_disabled'] ) && 'on' === $options['display']['maps_disabled'] ) { + if ( false !== $options && isset( $options['maps_disabled'] ) && 'on' === $options['maps_disabled'] ) { $return = false; } return $return; @@ -30,11 +30,11 @@ function lsx_to_is_map_enabled() { * @param string $before * @param string $after * @param boolean $echo - * @return void + * @return string */ function lsx_to_map( $before = '', $after = '', $echo = true ) { - global $wp_query, $post; $location = get_transient( get_the_ID() . '_location' ); + if ( false !== $location ) { $map = ''; $map_override = apply_filters( 'lsx_to_map_override', false ); @@ -104,23 +104,19 @@ function lsx_to_map( $before = '', $after = '', $echo = true ) { $connections = $regions->posts; } } else { - $accommodation = get_post_meta( $parent_id, 'accommodation_to_destination', false ); + $accommodation = get_post_meta( $parent_id, 'accommodation_to_destination', true ); if ( false !== $accommodation && ! empty( $accommodation ) ) { $connections = $accommodation; } } - if ( lsx_to_has_destination_banner_map() ) { - $args['selector'] = '#lsx-banner .page-banner'; - } - $args['content'] = 'excerpt'; if ( false !== $connections && '' !== $connections && ! empty( $connections ) ) { $args['connections'] = $connections; $args['type'] = 'cluster'; - if ( '0' === $parent_id && ! lsx_to_has_destination_banner_cluster() ) { + if ( '0' === $parent_id ) { $args['disable_cluster_js'] = true; } } else { @@ -175,16 +171,12 @@ function lsx_to_map( $before = '', $after = '', $echo = true ) { $connections = $countries->posts; } - if ( lsx_to_has_destination_banner_map() ) { - $args['selector'] = '#lsx-banner .page-banner'; - } - $args['content'] = 'excerpt'; if ( false !== $connections && '' !== $connections ) { $args['connections'] = $connections; $args['type'] = 'cluster'; - if ( '0' === $parent_id && ! lsx_to_has_destination_banner_cluster() ) { + if ( '0' === $parent_id ) { $args['disable_cluster_js'] = true; } } @@ -208,25 +200,16 @@ function lsx_to_map( $before = '', $after = '', $echo = true ) { $map = $map_override; } - // @codingStandardsIgnoreLine - echo $map; + if ( true === $echo ) { + // @codingStandardsIgnoreLine + echo $before . $map . $after; + } else { + return $before . $map . $after; + } } } } -if ( ! function_exists( 'lsx_to_map_meta' ) ) { - /** - * Outputs the map meta - * - * @package to-maps - * @subpackage template-tags - * @category meta - */ - function lsx_to_map_meta() { - do_action( 'lsx_to_map_meta' ); - } -} - if ( ! function_exists( 'lsx_to_display_fustion_tables' ) ) { /** * Return if the fusion tables are enabled or not @@ -236,13 +219,10 @@ function lsx_to_map_meta() { */ function lsx_to_display_fustion_tables() { $temp = get_option( '_lsx-to_settings', false ); - - if ( false !== $temp && isset( $temp['display'] ) && ! empty( $temp['display'] ) ) { - if ( isset( $temp['display']['fusion_tables_enabled'] ) ) { - return true; - } else { - return false; - } + if ( isset( $temp['fusion_tables_enabled'] ) ) { + return true; + } else { + return false; } } } @@ -257,9 +237,9 @@ function lsx_to_display_fustion_tables() { function lsx_to_fustion_tables_attr( $attribute, $default ) { $temp = get_option( '_lsx-to_settings', false ); - if ( false !== $temp && isset( $temp['display'] ) && ! empty( $temp['display'] ) ) { - if ( isset( $temp['display'][ 'fusion_tables_' . $attribute ] ) && ! empty( $temp['display'][ 'fusion_tables_' . $attribute ] ) ) { - return $temp['display'][ 'fusion_tables_' . $attribute ]; + if ( false !== $temp && isset( $temp ) ) { + if ( isset( $temp[ 'fusion_tables_' . $attribute ] ) && ! empty( $temp[ 'fusion_tables_' . $attribute ] ) ) { + return $temp[ 'fusion_tables_' . $attribute ]; } else { return $default; } @@ -267,52 +247,6 @@ function lsx_to_fustion_tables_attr( $attribute, $default ) { } } -if ( ! function_exists( 'lsx_to_has_destination_banner_map' ) ) { - /** - * Checks to see if the destination banner map is enabled. - * - * @package to-maps - * @subpackage template-tags - * @category destination - * - * @return boolean - */ - function lsx_to_has_destination_banner_map() { - $temp = tour_operator()->legacy->options; - $return = false; - if ( false !== $temp && isset( $temp['destination'] ) && ! empty( $temp['destination'] ) ) { - if ( isset( $temp['destination']['enable_banner_map'] ) ) { - $return = true; - } - } - return apply_filters( 'lsx_to_has_destination_banner_map', $return ); - } -} - -if ( ! function_exists( 'lsx_to_has_destination_banner_cluster' ) ) { - /** - * Checks to see if the destination banner map cluster is disabled. - * - * @package to-maps - * @subpackage template-tags - * @category destination - * - * @return boolean - */ - function lsx_to_has_destination_banner_cluster() { - $temp = get_option( '_lsx-to_settings', false ); - - if ( false !== $temp && isset( $temp['destination'] ) && ! empty( $temp['destination'] ) ) { - if ( isset( $temp['destination']['disable_banner_map_cluster'] ) ) { - return false; - } else { - return true; - } - } - return true; - } -} - if ( ! function_exists( 'lsx_to_maps_has_api_key' ) ) { /** * Checks to see if the API key is actually set. @@ -323,7 +257,7 @@ function lsx_to_has_destination_banner_cluster() { */ function lsx_to_maps_has_api_key() { $options = tour_operator()->options; - if ( false !== $options && isset( $options['api']['googlemaps_key'] ) ) { + if ( false !== $options && isset( $options['googlemaps_key'] ) ) { $return = true; } else { $return = $options; @@ -402,3 +336,41 @@ function lsx_to_has_map( $is_enqueque_script = false ) { } } } + +/** + * 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/package.json b/package.json index fca910b4..225254b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tour-operator", - "version": "1.4.9", + "version": "2.0.1", "description": "Tour Operators for LSX", "main": "gulpfile.js", "scripts": { diff --git a/readme.txt b/readme.txt index 2bdd9afb..56babcee 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: lsx, tour operator, travel, tourism, itinerary Requires at least: 6.7 Tested up to: 6.7 Requires PHP: 8.0 -Stable tag: 2.0.0 +Stable tag: 2.0.1 License: GPLv3 or later License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/templates/archive-destination.html b/templates/archive-destination.html index eded0f9c..3f4f1fa3 100644 --- a/templates/archive-destination.html +++ b/templates/archive-destination.html @@ -20,17 +20,34 @@
- -
-
-

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.

-
-
- + +
+
+

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.

+
+
+ + + +
+ +
+ -
-
+
+ + + +
diff --git a/templates/single-accommodation.html b/templates/single-accommodation.html index 96fde6f8..5febddde 100644 --- a/templates/single-accommodation.html +++ b/templates/single-accommodation.html @@ -304,6 +304,20 @@

Fast Facts

+ +
+ +
+ +
diff --git a/templates/single-country.html b/templates/single-country.html index e29c44e3..33777145 100644 --- a/templates/single-country.html +++ b/templates/single-country.html @@ -100,6 +100,20 @@

Fast Facts

+ +
+ +
+ +
diff --git a/templates/single-destination.html b/templates/single-destination.html index f02b2dd9..2a1043b8 100644 --- a/templates/single-destination.html +++ b/templates/single-destination.html @@ -102,6 +102,20 @@

Fast Facts

+ +
+ +
+ +