view-slider/index.php 0000644 00000014464 15021222412 0010616 0 ustar 00 'splide__slide']);
}
// if ($itemSource == "posts") {
// $items = post_grid_builder_post_query_items($itemQueryArgs);
// }
// if ($itemSource == "terms") {
// $items = post_grid_terms_query_item($itemQueryArgs);
// }
wp_enqueue_style('splide_core');
wp_enqueue_script('splide.min');
wp_enqueue_script('post-grid-slider-front');
$reponsiveCss = isset($PostGridData["reponsiveCss"]) ? $PostGridData["reponsiveCss"] : "";
$sliderOptions = isset($PostGridData['sliderOptions']) ? $PostGridData['sliderOptions'] : [];
$sliderOptionsRes = isset($PostGridData['sliderOptionsRes']) ? $PostGridData['sliderOptionsRes'] : [];
//var_dump($reponsiveCss);
$PostGridBuilderCss .= $reponsiveCss;
$wrapper = isset($PostGridData["wrapper"]) ? $PostGridData["wrapper"] : [];
$wrapperOptions = isset($wrapper["options"]) ? $wrapper["options"] : [];
$wrapperTag = !empty($wrapperOptions["tag"]) ? $wrapperOptions["tag"] : "div";
$wrapperClass = isset($wrapperOptions["class"]) ? $wrapperOptions["class"] : "";
$navsWrap = isset($PostGridData["navsWrap"]) ? $PostGridData["navsWrap"] : [];
$navItem = isset($PostGridData["navItem"]) ? $PostGridData["navItem"] : [];
$prev = isset($PostGridData["prev"]) ? $PostGridData["prev"] : [];
$prevIcon = isset($PostGridData["prevIcon"]) ? $PostGridData["prevIcon"] : [];
$next = isset($PostGridData["next"]) ? $PostGridData["next"] : [];
$nextIcon = isset($PostGridData["nextIcon"]) ? $PostGridData["nextIcon"] : [];
$paginationWrap = isset($PostGridData["paginationWrap"]) ? $PostGridData["paginationWrap"] : [];
$paginationItem = isset($PostGridData["paginationItem"]) ? $PostGridData["paginationItem"] : [];
$paginationItemActive = isset($PostGridData["paginationItemActive"]) ? $PostGridData["paginationItemActive"] : [];
$prevIconLibrary = isset($options['library']) ? $options['library'] : '';
$prevIconSrcType = isset($options['srcType']) ? $options['srcType'] : '';
$prevIconSrc = isset($options['iconSrc']) ? $options['iconSrc'] : '';
$prevIconHtml = ' ';
$nextIconLibrary = isset($options['library']) ? $options['library'] : '';
$nextIconSrcType = isset($options['srcType']) ? $options['srcType'] : '';
$nextIconSrc = isset($options['iconSrc']) ? $options['iconSrc'] : '';
$nextIconHtml = ' ';
$sliderOptionsResNew = [];
foreach ($sliderOptionsRes as $id => $arg) {
foreach ($arg as $view => $value) {
if ($view == 'Desktop') {
$viewNum = '1280';
}
if ($view == 'Tablet') {
$viewNum = '991';
}
if ($view == 'Mobile') {
$viewNum = '767';
}
$sliderOptionsResNew[$viewNum][$id] = $value;
}
}
$sliderOptions['breakpoints'] = $sliderOptionsResNew;
$blockId = "post-grid-" . $post_id;
//echo "
" . var_export($loopLayouts, true) . " ";
$PostGridDataAttr = [
"id" => $blockId,
"lazyLoad" => $lazyLoad,
];
$prevIconPosition = '';
$prevText = 'Prev';
$nextIconPosition = '';
$nextText = 'Next';
?>
{
var dataSplideargs = item.getAttribute("data-splide");
var dataSplideargsObj = JSON.parse(dataSplideargs);
var splide = new Splide('#' + item.id);
splide.mount();
})
}
});
view-grid/index.php 0000644 00000004457 15021222412 0010262 0 ustar 00 " . var_export($loopLayouts, true) . "";
$PostGridDataAttr = [
"id" => $blockId,
"lazyLoad" => $lazyLoad,
];
?>
{
element.classList.remove("animate__animated", `animate__${animate_name}`);
}, duration);
}
listenUrlHash() {
var hash = window.location.hash;
var hashWrap = document.querySelector('[href="' + hash + '"]');
if (hashWrap == null) return;
var header = hashWrap.parentElement;
var index = header.getAttribute("index")
this.switch(index)
}
activeByIndex(index) {
if (this.id.length == 0) return;
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index");
this.activeIndex = index
var content = header.nextElementSibling;
if (loopIndex == index) {
header.classList.toggle("accordion-header-active");
content.style.display = "block";
content.style.height = "auto";
var iconToggle = header.querySelector(".accordion-icon-toggle");
var iconIdle = header.querySelector(".accordion-icon-idle");
if (header.classList.contains("accordion-header-active")) {
if (iconToggle != null) {
iconToggle.style.display = "inline-block"; this.animate(iconToggle, this.iconInAnimation, this.iconAnimationDuration)
}
if (iconIdle != null) {
iconIdle.style.display = "none";
this.animate(iconIdle, this.iconOutAnimation, this.iconAnimationDuration)
}
content.style.display = "block";
content.style.height = "auto";
this.animate(content, this.contentInAnimation, this.contentAnimationDuration)
} else {
if (iconIdle != null) {
iconIdle.style.display = "inline-block";
}
if (iconToggle != null) {
iconToggle.style.display = "none";
}
this.animate(content, this.contentOutAnimation, this.contentAnimationDuration)
}
}
});
}
inactiveByIndex(index) {
if (this.id.length == 0) return;
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index"); var content = header.nextElementSibling;
if (loopIndex == index) {
header.classList.toggle("accordion-header-active");
//content.style.display = "none";
//content.style.height = 0;
}
var iconToggle = header.querySelector(".accordion-icon-toggle");
var iconIdle = header.querySelector(".accordion-icon-idle"); if (header.classList.contains("accordion-header-active")) {
if (iconToggle != null) {
iconToggle.style.display = "inline-block";
this.animate(iconToggle, this.iconInAnimation, this.iconAnimationDuration)
}
if (iconIdle != null) {
iconIdle.style.display = "none";
this.animate(iconIdle, this.iconOutAnimation, this.iconAnimationDuration)
}
content.style.display = "block";
content.style.height = "auto";
this.animate(content, this.contentInAnimation, this.contentAnimationDuration)
} else {
if (iconIdle != null) {
iconIdle.style.display = "inline-block";
}
if (iconToggle != null) {
iconToggle.style.display = "none";
}
content.style.display = "none";
this.animate(content, this.contentOutAnimation, this.contentAnimationDuration)
}
});
}
hideByIndex(index) {
if (this.id.length == 0) return;
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index");
if (index == loopIndex) {
var content = header.nextElementSibling;
//content.style.display = "none";
header.style.display = "none";
}
});
}
unhideByIndex(index) {
if (this.id.length == 0) return;
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index");
if (index == loopIndex) {
var content = header.nextElementSibling;
//content.style.display = "block";
header.style.display = "flex";
}
});
}
unhideAll(index) {
if (this.id.length == 0) return;
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index"); var content = header.nextElementSibling;
content.style.display = "none";
header.style.display = "flex";
});
}
switch(index) {
if (this.id.length == 0) return;
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index");
this.activeIndex = index
var content = header.nextElementSibling;
if (loopIndex == index) {
header.classList.toggle("accordion-header-active");
content.style.display = "block";
content.style.height = "auto";
} else {
header.classList.remove("accordion-header-active");
content.style.display = "none";
content.style.height = 0;
}
var iconToggle = header.querySelector(".accordion-icon-toggle");
var iconIdle = header.querySelector(".accordion-icon-idle");
if (header.classList.contains("accordion-header-active")) {
if (iconToggle != null) {
iconToggle.style.display = "inline-block";
this.animate(iconToggle, this.iconInAnimation, this.iconAnimationDuration)
}
if (iconIdle != null) {
iconIdle.style.display = "none";
this.animate(iconIdle, this.iconOutAnimation, this.iconAnimationDuration)
}
content.style.display = "block";
content.style.height = "auto";
this.animate(content, this.contentInAnimation, this.contentAnimationDuration)
} else {
if (iconIdle != null) {
iconIdle.style.display = "inline-block";
}
if (iconToggle != null) {
iconToggle.style.display = "none";
} this.animate(content, this.contentOutAnimation, this.contentAnimationDuration)
content.style.display = "none";
}
});
}
switchNext() {
var activeIndex = this.activeIndex;
var max = this.headerList.length - 1;
var nextIndex = (activeIndex + 1 > max) ? 0 : (activeIndex + 1);
this.switch(nextIndex);
}
switchPrev() {
var activeIndex = this.activeIndex;
var max = this.headerList.length - 1;
var nextIndex = (activeIndex - 1 < 0) ? max : (activeIndex - 1);
this.switch(nextIndex);
}
autoPlayRun() {
let currentIndex = -1;
const loopThroughItems = () => {
var length = this.headerList.length + 1;
currentIndex = (currentIndex + 1) % length;
this.switch(currentIndex);
setTimeout(loopThroughItems, this.autoPlayDelay);
};
if (this.autoPlay) loopThroughItems();
}
search(keyword) {
if (keyword.length == 0) {
this.unhideAll()
return;
}
var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
accordionHeaders.forEach((header, i) => {
var loopIndex = header.getAttribute("index");
//this.activeIndex = index
var content = header.nextElementSibling;
var headerLabel = header.querySelector(".accordion-header-label");
var labelText = headerLabel.innerText.toLowerCase();;
var contentText = content.innerText.toLowerCase();;
var searchContent = labelText + " " + contentText
var position = searchContent.indexOf(keyword);
if (position < 0) {
this.hideByIndex(loopIndex)
} else {
this.unhideByIndex(loopIndex)
}
});
}
expandCollapseAll() {
var expandCollapseAllHndle = document.querySelector("#" + this.id + " " + this.expandCollapseAllHndle);
var toggled = expandCollapseAllHndle.getAttribute("data-toggled");
var headerCount = this.headerList.length
var expandCollapseAllDelay = parseInt(this.expandCollapseAllDelay);
var expandalltext = expandCollapseAllHndle.getAttribute("data-expandalltext");
var collapsealltext = expandCollapseAllHndle.getAttribute("data-collapsealltext");
var expandalliconhtml = expandCollapseAllHndle.getAttribute("data-expandalliconhtml");
var collapsealliconhtml = expandCollapseAllHndle.getAttribute("data-collapsealliconhtml");
if (!toggled) {
expandCollapseAllHndle.setAttribute("data-toggled", true);
var innerHtml = `${collapsealliconhtml}${collapsealltext} `;
var _this = this;
for (var i = 0; i < headerCount; i++) {
(function (index) {
setTimeout(function () {
_this.activeByIndex(index)
}, expandCollapseAllDelay * index);
})(i);
}
} else {
var _this = this;
for (var i = 0; i < headerCount; i++) {
(function (index) {
setTimeout(function () {
_this.inactiveByIndex(index)
}, expandCollapseAllDelay * index);
})(i);
}
expandCollapseAllHndle.removeAttribute("data-toggled");
var innerHtml = `${expandalliconhtml}${expandalltext} `;
}
expandCollapseAllHndle.innerHTML = innerHtml
}
init() {
const accordionWrapper = document.querySelector(`#${this.id}`);
if (this.lazyLoad) accordionWrapper.style.display = "block"; var accordionHeaders = document.querySelectorAll("#" + this.id + " > .accordion-header");
var headerList = [];
accordionHeaders.forEach((header, index) => {
var headerId = header.getAttribute("id");
headerList.push(headerId)
header.setAttribute("index", index);
const counter = header.querySelector(".accordion-label-counter");
if (counter !== null) {
counter.textContent = `${index + 1}`; // Adding 1 to start counting from 1
}
});
this.headerList = headerList;
accordionHeaders.forEach((accordionHeader) => {
var iconToggle = accordionHeader.querySelector(".accordion-icon-toggle");
var iconIdle = accordionHeader.querySelector(".accordion-icon");
if (iconToggle != null) {
iconToggle.style.display = "none";
}
});
if (accordionHeaders != null) {
accordionHeaders.forEach((accordionHeader) => {
// var fieldId = accordionHeader.getAttribute("id");
var content = accordionHeader.nextElementSibling;
var iconToggle = accordionHeader.querySelector(".accordion-icon-toggle");
var iconIdle = accordionHeader.querySelector(".accordion-icon-idle");
if (iconToggle != null) {
iconToggle.style.display = "none";
}
if (content != undefined) {
content.style.height = 0;
content.style.overflow = "hidden";
content.style.display = "none";
}
accordionHeader.addEventListener("click", (event) => {
event.stopImmediatePropagation();
event.preventDefault(); //accordionHeader.scrollIntoView({ behavior: 'smooth' });
if (this.clickToScrollTop) {
var offset = this.clickToScrollTopOffset;
const elementPosition = accordionHeader.getBoundingClientRect().top + window.scrollY;
const offsetPosition = elementPosition - offset;
window.scrollTo({
top: offsetPosition,
behavior: 'smooth'
});
}
var loopIndex = accordionHeader.getAttribute("index");
if (this.keepExpandOther) {
this.activeByIndex(loopIndex);
} else {
this.switch(loopIndex);
}
});
});
}
if (this.activeIndex.length > 1) {
this.activeIndex.map((index) => {
this.activeByIndex(index);
})
}
if (this.urlHash) this.listenUrlHash();
if (this.autoPlay) this.autoPlayRun();
if (this.expandCollapseAllEnable) {
var expandCollapseAllHndle = document.querySelector("#" + this.id + " " + this.expandCollapseAllHndle);
if (expandCollapseAllHndle != null) {
var _this = this;
expandCollapseAllHndle.addEventListener("click", function (event) {
_this.expandCollapseAll();
})
}
}
if (this.searchEnable) {
var _this = this;
var searchHndle = document.querySelector("#" + this.id + " .search-input");
if (searchHndle != null) {
function debounce(func, delay) {
let timeout;
return function (...args) {
clearTimeout(timeout);
timeout = setTimeout(() => func.apply(this, args), delay);
};
} function handleKeyup(event) {
event.preventDefault();
var value = event.target.value;
_this.search(value)
}
searchHndle.addEventListener('keyup', debounce(handleKeyup, 500));
}
}
}
}
// Initialize instances
document.querySelectorAll("[data-accordionBuilder]").forEach((tabElement) => {
const config = JSON.parse(tabElement.getAttribute("data-accordionBuilder"));
new AccordionBuilder(config);
});
});
post-grid-hook.php 0000644 00000214652 15021222412 0010124 0 ustar 00
taxonomy) ? $term->taxonomy : '';
$term_id = isset($term->term_id) ? $term->term_id : '';
$post_grid_js_args['page_type'] = 'taxonomy';
$post_grid_js_args['page_taxonomy'] = $taxonomy;
$post_grid_js_args['page_tax_term'] = $term_id;
}
$post_grid_js_args['id'] = $grid_id;
$post_grid_js_args['lazy_load'] = $lazy_load_enable;
$post_grid_js_args['masonry_enable'] = $masonry_enable;
$post_grid_js_args['view_type'] = $grid_type;
$post_grid_js_args = apply_filters('post_grid_js_args', $post_grid_js_args, $args);
?>
';
} elseif ($font_aw_version == 'v_4') {
$nav_top_search_icon = ' ';
}
// if($grid_id != 2147) return;
// 7 is grid ID where you want to display this input field
$nav_top_search_placeholder = isset($post_grid_options['nav_top']['search_placeholder']) ? $post_grid_options['nav_top']['search_placeholder'] : __('Start typing', 'post-grid');
$nav_top_search_icon = isset($post_grid_options['nav_top']['search_icon']) ? $post_grid_options['nav_top']['search_icon'] : $nav_top_search_icon;
$keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';
?>
';
} elseif ($font_aw_version == 'v_4') {
$nav_top_search_icon = ' ';
}
// if($grid_id != 2147) return;
// 7 is grid ID where you want to display this input field
$nav_top_search_placeholder = isset($post_grid_options['nav_top']['search_placeholder']) ? $post_grid_options['nav_top']['search_placeholder'] : __('Start typing', 'post-grid');
$nav_top_search_icon = isset($post_grid_options['nav_top']['search_icon']) ? $post_grid_options['nav_top']['search_icon'] : $nav_top_search_icon;
$search_loading_icon = isset($post_grid_options['nav_top']['search_loading_icon']) ? $post_grid_options['nav_top']['search_loading_icon'] : '';
?>
$taxonomyData) {
$terms = !empty($taxonomyData['terms']) ? $taxonomyData['terms'] : array();
$terms_relation = !empty($taxonomyData['terms_relation']) ? $taxonomyData['terms_relation'] : 'OR';
$checked = !empty($taxonomyData['checked']) ? $taxonomyData['checked'] : '';
if (!empty($terms) && !empty($checked)) {
$tax_query[] = array(
'taxonomy' => $taxonomy,
'field' => 'term_id',
'terms' => $terms,
'operator' => $terms_relation,
);
}
}
$tax_query_relation = array('relation' => $categories_relation);
$tax_query = array_merge($tax_query_relation, $tax_query);
/* ################################ Keyword query ######################################*/
//$keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : $keyword;
/* ################################ Single pages ######################################*/
if (is_singular()) :
$current_post_id = get_the_ID();
$query_args['post__not_in'] = array($current_post_id);
endif;
if (get_query_var('paged')) {
$paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
if ($ignore_paged == 'yes') {
$paged = 1;
}
if (!empty($post_types))
$query_args['post_type'] = $post_types;
if (!empty($post_status))
$query_args['post_status'] = $post_status;
if (!empty($keyword))
$query_args['s'] = $keyword;
if (!empty($exclude_post_id))
$query_args['post__not_in'] = $exclude_post_id;
if (!empty($include_post_id))
$query_args['post__in'] = $include_post_id;
if (!empty($query_order))
$query_args['order'] = $query_order;
if (!empty($query_orderby))
$query_args['orderby'] = $query_orderby;
if (!empty($query_orderby_meta_key))
$query_args['meta_key'] = $query_orderby_meta_key;
if (!empty($posts_per_page))
$query_args['posts_per_page'] = (int)$posts_per_page;
if (!empty($paged))
$query_args['paged'] = $paged;
if (!empty($offset))
$query_args['offset'] = $offset + (($paged - 1) * $posts_per_page);
if (!empty($tax_query))
$query_args['tax_query'] = $tax_query;
if (!empty($_GET['lang']))
$query_args['lang'] = sanitize_text_field($_GET['lang']);
$query_args = apply_filters('post_grid_filter_query_args', $query_args, $grid_id);
$query_args = apply_filters('post_grid_query_args', $query_args, $args);
$post_grid_wp_query = new WP_Query($query_args);
$wp_query = $post_grid_wp_query;
$loop_count = 0;
if ($post_grid_wp_query->have_posts()) :
do_action('post_grid_loop_top', $args);
?>
have_posts()) : $post_grid_wp_query->the_post();
$post_id = get_the_ID();
$args['post_id'] = $post_id;
$args['loop_count'] = $loop_count;
do_action('post_grid_loop', $args);
$loop_count++;
endwhile;
do_action('post_grid_after_loop', $args);
?>
layout_content($layout_content);
} else {
if (!empty($post_grid_layout_content[$layout_content])) {
$layout = $post_grid_layout_content[$layout_content];
} else {
$layout = array();
}
}
?>
$element) {
$element_id = isset($element['key']) ? $element['key'] : '';
if (empty($element_id)) return;
$element_args['element'] = $element;
$element_args['index'] = $elementIndex;
$element_args['post_id'] = $post_id;
$element_args['layout_id'] = $post_id;
do_action('post_grid_layout_element_' . $element_id, $element_args);
}
?>
layout_content($layout_content);
} else {
if (!empty($post_grid_layout_content[$layout_content])) {
$layout = $post_grid_layout_content[$layout_content];
} else {
$layout = array();
}
}
?>
$elementData) {
foreach ($elementData as $elementId => $element) {
$element_args['element'] = $element;
$element_args['index'] = $elementIndex;
$element_args['post_id'] = $post_id;
$element_args['layout_id'] = $layout_id;
do_action('post_grid_layout_element_' . $elementId, $element_args);
}
}
}
add_action('post_grid_loop_bottom', 'post_grid_loop_bottom_pagination', 10, 2);
function post_grid_loop_bottom_pagination($args, $post_grid_wp_query)
{
$post_grid_options = $args['options'];
$pagination_type = isset($post_grid_options['nav_bottom']['pagination_type']) ? $post_grid_options['nav_bottom']['pagination_type'] : 'normal';
$grid_type = !empty($post_grid_options['grid_type']) ? $post_grid_options['grid_type'] : 'grid';
$nav_top = !empty($post_grid_options['nav_top']) ? $post_grid_options['nav_top'] : [];
$action_type = !empty($post_grid_options['action_type']) ? $post_grid_options['action_type'] : 'form_submit';
if ($pagination_type == 'none') return;
$pagination_type = ($action_type == 'ajax') ? 'ajax_pagination' : $pagination_type;
$pagination_type = ($grid_type == 'filterable') ? 'jquery' : $pagination_type;
wp_enqueue_script('scrollto');
?>
max_num_pages) ? $post_grid_wp_query->max_num_pages : 0;
$pagination_prev_text = !empty($post_grid_options['pagination']['prev_text']) ? $post_grid_options['pagination']['prev_text'] : __('« Previous', 'post-grid');
$pagination_next_text = !empty($post_grid_options['pagination']['next_text']) ? $post_grid_options['pagination']['next_text'] : __('Next »', 'post-grid');
$pagination_max_num_pages = !empty($post_grid_options['pagination']['max_num_pages']) ? $post_grid_options['pagination']['max_num_pages'] : $max_num_pages;
$pagination_font_size = !empty($post_grid_options['pagination']['font_size']) ? $post_grid_options['pagination']['font_size'] : '17px';
$pagination_font_color = !empty($post_grid_options['pagination']['font_color']) ? $post_grid_options['pagination']['font_color'] : '#646464';
$pagination_bg_color = !empty($post_grid_options['pagination']['bg_color']) ? $post_grid_options['pagination']['bg_color'] : '#646464';
$pagination_active_bg_color = !empty($post_grid_options['pagination']['active_bg_color']) ? $post_grid_options['pagination']['active_bg_color'] : '#4b4b4b';
?>
str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => '?paged=%#%',
'current' => max(1, $paged),
'total' => $pagination_max_num_pages,
'prev_text' => $pagination_prev_text,
'next_text' => $pagination_next_text,
)
);
?>
$elementData) {
foreach ($elementData as $elementId => $element) {
$element_args['element'] = $element;
$element_args['index'] = $elementIndex;
//$element_args['post_id'] = $post_id;
$element_args['layout_id'] = $layout_id;
//ob_start();
do_action('post_grid_layout_element_css_' . $elementId, $element_args);
//$element_css .= ob_get_clean();
}
}
?>
$item) {
$custom_class = isset($item['custom_class']) ? $item['custom_class'] : '';
$char_limit = isset($item['char_limit']) ? $item['char_limit'] : '';
$key = isset($item['key']) ? $item['key'] : '';
$css = isset($item['css']) ? $item['css'] : '';
$css_hover = isset($item['css_hover']) ? $item['css_hover'] : '';
$read_more_text = isset($item['read_more_text']) ? $item['read_more_text'] : '';
$link_target = isset($item['link_target']) ? $item['link_target'] : '';
$five_star_count = isset($item['five_star_count']) ? $item['five_star_count'] : '';
$layout_elements_data[$item_count][$key]['custom_class'] = $custom_class;
$layout_elements_data[$item_count][$key]['css'] = $css;
$layout_elements_data[$item_count][$key]['css_hover'] = $css_hover;
if ($key == 'title' || $key == 'title_link' || $key == 'excerpt' || $key == 'excerpt_read_more') {
$layout_elements_data[$item_count][$key]['char_limit'] = $char_limit;
$layout_elements_data[$item_count][$key]['link_to'] = 'post_link';
}
if ($key == 'read_more' || $key == 'excerpt_read_more') {
$layout_elements_data[$item_count][$key]['read_more_text'] = $read_more_text;
}
if ($key == 'read_more' || $key == 'excerpt_read_more' || $key == 'title_link') {
$layout_elements_data[$item_count][$key]['link_target'] = $link_target;
$layout_elements_data[$item_count][$key]['link_to'] = 'post_link';
}
if ($key == 'five_star') {
$layout_elements_data[$item_count][$key]['five_star_count'] = $five_star_count;
}
$item_count++;
}
$layout_elements_data[$item_count]['wrapper_end']['wrapper_id'] = '';
$post_grid_title = get_the_title($grid_id);
$post_args = array(
'post_title' => $post_grid_title . ' - ' . $layout_skin . ' - ' . $content_layout,
'post_type' => 'post_grid_layout',
'post_status' => 'publish',
'post_author' => 1,
);
$new_layout_id = wp_insert_post($post_args);
$custom_scripts['custom_css'] = post_grid_layout_css($layout_skin);
$custom_scripts['custom_js'] = '';
$layout_options['layout_preview_img'] = '';
update_post_meta($new_layout_id, 'layout_elements_data', $layout_elements_data);
update_post_meta($new_layout_id, 'custom_scripts', $custom_scripts);
update_post_meta($new_layout_id, 'layout_options', $layout_options);
$options['layout_id'] = $new_layout_id;
update_post_meta($grid_id, 'post_grid_meta_options', $options);
if ($layout_converted) {
?>
Layout converted successfully, please go # this
link to edit layout
Please report issue if you found any problem, create support ticket
" . var_export($masonryOptions, true) . "";
if ($itemSource == "posts") {
$items = post_grid_builder_post_query_items($itemQueryArgs, $loopLayouts);
}
// if ($itemSource == "terms") {
// $items = post_grid_terms_query_item($itemQueryArgs);
// }
// if ($itemSource == "easyAccordion") {
// $items = post_grid_easy_accordion_query_item($itemQueryArgs);
// }
$PostGridDataAttr = [
"id" => $blockId,
"lazyLoad" => $lazyLoad,
];
$dataBlockId = [
"blockId" => 'abc123',
];
wp_enqueue_script('jquery');
wp_enqueue_script('imagesloaded');
wp_enqueue_script('masonry');
wp_enqueue_script('masonry.min');
wp_enqueue_script('post-grid-masonry-front');
?>
{
var masonryArgs = item.getAttribute("data-masonry");
var masonryArgsObj = JSON.parse(masonryArgs);
var masonryOptions = masonryArgsObj;
var blockargs = item.getAttribute("data-block-id");
var blockArgsObj = JSON.parse(blockargs);
var blockId = blockArgsObj.blockId;
// var elemX = document.querySelector(".pg" + blockId);
var elemX = document.querySelector("." + blockId);
if (elemX != null) {
// elemX.forEach((item) => {
imagesLoaded(item, function () {
var msnry = new Masonry(item, masonryOptions);
});
// });
}
});
}
});
settings-usage-shortcode.php 0000644 00000020400 15021223043 0012173 0 ustar 00
[youtube_channel]'
);
?>
channel
(string) ID of preferred YouTube channel. Do not set full URL to channel, but just last part from URL - ID (name)
vanity
(string) Vanity name.
username
(string) Legacy YouTube username.
playlist
(string) ID of preferred YouTube playlist.
resource
(int) Resource to use for feed:
• 0
Channel (User Uploads)
• 1
Favorites (for defined channel)
• 2
Playlist
• 3
Liked Videos (for defined channel)
cache
(int) Period in seconds for caching feed. You can disable caching by setting this option to 0
, but if you have a lot of visits, consider at least short caching (couple minutes).
fetch
(int) Number of videos that will be used as stack for random pick (min 2, max 50)
skip
(int) Number of videos to skip (not applicable for embedable playlist and random pick (min 0, max 49, default 0) [Individual option, does not exists in global plugin settings! ]
num
(int) Number of videos to display per YTC block.
random
(bool) Option to randomize videos on every page load. [Individual option, does not exists in global plugin settings! ]
ratio
(int) Set preferred aspect ratio for thumbnail and video. You can use:
• 3
16:9 widescreen (default)
• 1
4:3
width
(int) Width of thumbnail and video in pixels.
responsive
(bool) Distribute one full width video per row.
display
(string) Object that will be used to represent video. We have couple predefined options:
• thumbnail
Thumbnail will be used and video will be loaded in lightbox.
• iframe
HTML5 (iframe)
• iframe2
HTML5 (iframe) with asynchronous loading - recommended
• playlist
Embedded playlist
thumb_quality
(string) Define image quality for thumbnail display mode. Default is hqdefault
, available:
• default
Default Quality (120x90px)
• mqdefault
Medium Quality (320x180px)
• hqdefault
High Quality (480x360px)
• sddefault
Standard Definition (640x480px)
• maxresdefault
Maximum Resolution (1280x720px)
no_thumb_title
(bool) By default YouTube thumbnail will have tooltip with info about video title and date of publishing. By setting this option to 1
or true
you can hide tooltip
controls
(bool) Set this option to 1
or true
to hide playback controls. To display controls set this option to 0
or false
.
autoplay
(bool) Enable autoplay of first video in YTC video stack by setting this option to 1
or true
mute
(bool) Set this option to 1
or true
to mute videos set to autoplay on load
norel
(bool) Set this option to 1
or true
to hide related videos after finished playbak
nobrand
(bool) Set this option to 1
or true
to hide YouTube logo from playback control bar
nolightbox
(bool) Set this option to 1
or true
to disable lightbox and open thumbnail link in new tab/windows instead in lightbox
showtitle
(string) Set to:
• none
to hide title
• above
to show video title above video/thumbnail
• below
to show video title below video/thumbnail
• inside
to show top aligned video title inside thumbnail; if display
is not thumbnail
then treat as above
• inside_b
to show bottom aligned title inside thumbnail; if display
is not thumbnail
then treat as below
linktitle
(bool) Set to 1
or true
to link title to vlideo.
showdesc
(bool) Set to 1
or true
to show video description.
desclen
(int) Set number of characters to cut down length of video description. Set to 0
to use full length description.
noanno
(bool) Set to 1
or true
to hide overlay video annotations (from embedded player)
goto_txt
(string)
popup
(int) Control where link to channel will be opened:
• 0
open link in same window
• 1
open link in new window with JavaScript
• 2
open link in new window with target="_blank"
anchor attribute
link_to
(string) URL to link:
• none
hide link (default)
• channel
Channel page
• handle
YouTube Handle URL
• vanity
DEPRECATED Vanity custom URL
• legacy
DEPRECATED Legacy username page
settings-tools.php 0000644 00000001723 15021223043 0010246 0 ustar 00 Clear YTC Cache
To avoid page load slowdown, we provide internal YouTube Channel caching functionality. You can enable caching per widget or shortcode, and set how long cached feed for particular widget or shortcode will live.
If you wish to force clear cache before it expires (for example, you have set cache timeout to 2 days, but wish to force loading of fresh channel or playlist feed), you can force Clear All YTC Cache to remove transients from database on demand.
Clear All YTC Cache
settings-usage.php 0000644 00000002735 15021223043 0010216 0 ustar 00
.
%s',
esc_html__( 'Widgets', 'youtube-channel' )
)
);
?>
[youtube_channel]'
);
?>
settings.php 0000644 00000003504 15021223043 0007107 0 ustar 00
v.
__( 'General', 'youtube-channel' ),
'video' => __( 'Video', 'youtube-channel' ),
'content' => __( 'Content', 'youtube-channel' ),
'link' => __( 'Link to Channel', 'youtube-channel' ),
'tools' => __( 'Tools', 'youtube-channel' ),
'help' => __( 'Help', 'youtube-channel' ),
);
?>
$tab_title ) {
$tab_url = '?page=' . YTC_PLUGIN_SLUG . '&tab=' . $tab_name;
$tab_class = $active_tab === $tab_name ? ' nav-tab-active' : '';
echo '' . esc_html( $tab_title ) . ' ';
}
?>
';
settings_fields( sanitize_key( 'ytc_' . $active_tab ) );
do_settings_sections( sanitize_key( YTC_PLUGIN_SLUG . '_' . $active_tab ) );
submit_button();
echo '';
} elseif ( 'tools' === $active_tab ) {
include_once YTC_DIR_TEMPLATES . '/settings-tools.php';
} elseif ( 'help' === $active_tab ) {
include_once YTC_DIR_TEMPLATES . '/settings-usage.php';
include_once YTC_DIR_TEMPLATES . '/settings-usage-shortcode.php';
} // $active_tab != 'tools|help|support'
} // ! empty ( $tabs[$active_tab] )
?>
AttachToPost/display_tab_source.php 0000644 00000000162 15021223713 0013500 0 ustar 00