: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
if (instaPostData.show_likes_count == 'true') {
<div class="embedpress-inline popup-like-button"><a target="_blank" href="${instaPostData.permalink}">${likeIcon} ${instaPostData.like_count || 0}</a></div>
if (instaPostData.show_comments_count == 'true') {
<div class="embedpress-inline"><a target="_blank" href="${instaPostData.permalink}">${commentsIcon} ${instaPostData.comments_count || 0}</a></div>
if (instaPostData.popup_follow_button_text == 'false') {
instaPostData.popup_follow_button_text = '';
if (instaPostData.popup_follow_button == 'true' || instaPostData.popup_follow_button == 'yes') {
followBtn = `<div class="insta-followbtn">
<a target="_new" href="${srcUrl}" type="button" class="btn btn-primary">${instaPostData.popup_follow_button_text}</a>
console.log(instaPostData);
<div class="popup-container">
<div class="popup-md-9 white">
<div class="embedpress-popup-block embedpress-popup-img" id="post-${instaPostData.id}">
<div class="popup-md-3 red">
<div class="embedpress-popup-block embedpress-popup-info">
<div class="embedpress-popup-header">
<div class="embedpress-popup-header-img"> <a target="_blank" href="${srcUrl}"
target="_blank" class="embedpress-href">
<img decoding="async" loading="lazy" class="embedpress-popup-round" src="${instaPostData.profile_picture_url}" width="30" height="30"> <span class="embedpress-popup-username">${instaPostData.username}</span>
<div class="embedpress-popup-text">${captionText}</div>
<div class="embedpress-popup-stats">
<div class="embedpress-inline">
<div class="embedpress-popup-share-buttons"> <a
href="https://www.facebook.com/sharer/sharer.php?u=${instaPostData.permalink}" target="_blank">
<span class="dashicons dashicons-facebook"></span></a> <a
href="https://twitter.com/intent/tweet?url=${instaPostData.permalink}"
<svg viewBox="0 0 18 18" aria-hidden="true" class="r-4qtqp9 r-yyyyoo r-dnmrzs r-bnwqim r-1plcrui r-lrvibr r-lrsllp r-18jsvk2 r-16y2uox r-8kz0gk" width="18" height="18"><path d="M13.683 1.688h2.481l-5.42 6.195 6.377 8.43h-4.993L8.217 11.2l-4.474 5.113H1.26l5.798-6.626L.941 1.688H6.06l3.535 4.673zm-.871 13.14h1.375L5.313 3.095H3.838z"/></svg>
<a href="https://www.linkedin.com/shareArticle?mini=true&url=${instaPostData.permalink}"
target="_blank"><span class="dashicons dashicons-linkedin"></span></a> <a
href="https://pinterest.com/pin/create/button/?url=${instaPostData.permalink}"
target="_blank"><span class="dashicons dashicons-pinterest"></span></a></div>
<div class="embedpress-href embedpress-popup-share">${shareIcon}</div>
</div><div class="embedpress-inline embedpress-popup-instagram-buttons"><a
href="${instaPostData.permalink}" target="_blank"
class="embedpress-href">${instaIcon}</a></div>
// Add a click event listener to the insta-gallery container
epGlobals.instaPopup = (container) => {
container?.addEventListener('click', function (event) {
// Check if the clicked element has the class insta-gallery-item
const instaItem = event.target.closest('.insta-gallery-item');
const postData = instaItem.dataset.postdata;
const postid = instaItem.getAttribute('data-insta-postid');
const accountType = container?.closest('.instagram-container')?.getAttribute('data-connected-acc-type');
if (instaItem.closest('.instagram-container').getAttribute('data-hashtag')) {
hashtag = instaItem?.closest('.instagram-container')?.getAttribute('data-hashtag');
const closestPopup = event.target.closest('.ose-instagram-feed')?.querySelector('.insta-popup');
closestPopup.style.display = 'block';
var feedElement = event.target.closest('.ose-instagram-feed');
var popupElement = feedElement.querySelector('.popup-is-initialized');
popupElement.innerHTML = getPopupTemplate(postData, hashtag, accountType);
if (!document.querySelector(`#post-${postid}`)?.classList.contains('carousel-is-initialized')) {
const carousel = new CgCarousel(`#post-${postid}`, { slidesPerView: 1, loop: true }, {});
const next = document.querySelector(`#post-${postid} .js-carousel__next-1`);
next?.addEventListener('click', () => carousel.next());
const prev = document.querySelector(`#post-${postid} .js-carousel__prev-1`);
prev?.addEventListener('click', () => carousel.prev());
document.querySelector(`#post-${postid}`)?.classList.add('carousel-is-initialized');
const instaContainers = document.querySelectorAll('.embedpress-gutenberg-wrapper .insta-gallery');
if (instaContainers.length > 0) {
instaContainers.forEach((container) => {
epGlobals.instaPopup(container);
$('.popup-close').click(function (e) {
// Hide the popup by setting display to none
$('.insta-popup').hide();
$('.popup-container').remove();
$(document).on('click', function (e) {
if (e.target.classList.contains('popup-wrapper')) {
$('.insta-popup').hide();
$('.popup-container').remove();
const instafeeds = document.querySelectorAll('.ose-instagram-feed');
epGlobals.initializeTabs = (containerEl) => {
containerEl.addEventListener('click', function (event) {
const clickedElement = event.target;
return; // No element clicked, ignore the event
if (containerEl.querySelector('.load-more-button-container') && (clickedElement.getAttribute('data-media-type') === 'VIDEO' || clickedElement.getAttribute('data-media-type') === 'CAROUSEL_ALBUM')) {
containerEl.querySelector('.load-more-button-container').style.display = 'none';
else if (containerEl.querySelector('.load-more-button-container') && (clickedElement.getAttribute('data-media-type') === 'ALL')) {
containerEl.querySelector('.load-more-button-container').style.display = 'flex';
if (clickedElement.matches('.tabs li')) {
if (clickedElement.classList.contains('active')) {
const mediaType = clickedElement.getAttribute('data-media-type');
const tabs = containerEl.querySelectorAll('.tabs li');
tabs.forEach(t => t.classList.remove('active'));
clickedElement.classList.add('active');
function showItems(mediaType) {
const items = containerEl.getElementsByClassName('insta-gallery-item');
for (let i = 0; i < items.length; i++) {
if (mediaType === 'ALL' || item.getAttribute('data-media-type') === mediaType) {
item.style.display = 'block';
item.style.display = 'none';
epGlobals.instaLoadMore = () => {
// Unbind any previously bound click event to avoid multiple bindings
$('.insta-load-more-button').off('click').on('click', function (e) {
const loadmoreBtn = that.closest('.load-more-button-container');
const loadmoreKey = loadmoreBtn.data('loadmorekey');
const connectedAccount = that.closest('.instagram-container').data('connected-acc-type');
const feedType = that.closest('.instagram-container').data('feed-type');
const hashtagId = that.closest('.instagram-container').data('hashtag-id');
const userId = that.closest('.instagram-container').data('uid');
let loadedPosts = loadmoreBtn.data('loaded-posts') || 0;
let postsPerPage = loadmoreBtn.data('posts-per-page') || 0;
const params = JSON.stringify(that.closest('.instagram-container').data('params'));
const instaContainer = that.closest('.instagram-container');
const spinicon = `<svg class="insta-loadmore-spinicon" width="18" height="18" fill="${'#fff'}" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_GuJz{transform-origin:center;animation:spinner_STY6 1.5s linear infinite}@keyframes spinner_STY6{100%{transform:rotate(360deg)}}</style><g class="spinner_GuJz"><circle cx="3" cy="12" r="2"/><circle cx="21" cy="12" r="2"/><circle cx="12" cy="21" r="2"/><circle cx="12" cy="3" r="2"/><circle cx="5.64" cy="5.64" r="2"/><circle cx="18.36" cy="18.36" r="2"/><circle cx="5.64" cy="18.36" r="2"/><circle cx="18.36" cy="5.64" r="2"/></g></svg>`;
// Check if no spinicon exists
if (instaContainer.find('.insta-loadmore-spinicon').length === 0) {
that.attr('disabled', true);
'action': 'loadmore_data_handler',
'loaded_posts': loadedPosts,
'posts_per_page': postsPerPage,
'connected_account_type': connectedAccount,
'loadmore_key': loadmoreKey,
'_nonce': eplocalize.nonce
if (feedType === 'hashtag_type') {
data.hashtag_id = hashtagId;
jQuery.post(eplocalize.ajaxurl, data, function (response) {
if (response.total_feed_posts >= response.next_post_index) {
var $responseHtml = $(response.html);
instaContainer.find('.insta-gallery').append($responseHtml);
that.removeAttr('disabled');
instaContainer.find('.insta-loadmore-spinicon').remove();
loadedPosts = response.next_post_index;
loadmoreBtn.data('loaded-posts', loadedPosts);
// After loading more items, reinitialize the tabs for the specific container
const containerEl = loadmoreBtn.closest('.ose-instagram-feed')[0];
epGlobals.initializeTabs(containerEl);
if (response.total_feed_posts === response.next_post_index) {
if (instafeeds.length > 0) {
instafeeds.forEach(function (feed) {
epGlobals.initializeTabs(feed);
if ($('.embedpress-gutenberg-wrapper .ose-instagram-feed').length > 0) {
epGlobals.instaLoadMore();
mouseenter: function () {
$('.embedpress-popup-share-buttons').addClass('show');
mouseleave: function () {
var buttons = $('.embedpress-popup-share-buttons');
if (!buttons.is(':hover')) buttons.removeClass('show');
}, '.embedpress-href.embedpress-popup-share, .embedpress-popup-share-buttons');
mouseenter: function () {
$(this).addClass('show');
mouseleave: function () {
$(this).removeClass('show');
}, '.embedpress-popup-share-buttons');
document.addEventListener('DOMContentLoaded', function () {
epGlobals.initCarousel = (carouselSelector, options, carouselId) => {
const carouselOptions = {
slidesPerView: options.slideshow,
spacing: options.spacing,
autoplay: options.autoplay,
transitionSpeed: options.transitionspeed,
autoplaySpeed: options.autoplayspeed,
slidesPerView: parseInt(options.slideshow) - 1
slidesPerView: parseInt(options.slideshow)
const carousel = new CgCarousel(carouselSelector, carouselOptions, {});
const next = document.querySelector(`[data-carouselid="${carouselId}"] #js-carousel__next-1`);
next.addEventListener('click', () => carousel.next());
const prev = document.querySelector(`[data-carouselid="${carouselId}"] #js-carousel__prev-1`);
prev.addEventListener('click', () => carousel.prev());
const instaWrappers = document.querySelectorAll('.ep-embed-content-wraper');
if (instaWrappers.length > 0) {
instaWrappers.forEach((wrapper) => {
const carouselId = wrapper.getAttribute('data-carouselid');
let options = wrapper.getAttribute(`data-carousel-options`);
options = JSON.parse(options);
const carouselSelector = `[data-carouselid="${carouselId}"] .embedpress-insta-container`;
document.querySelector(`[data-carouselid="${carouselId}"] .cg-carousel__btns`).classList.remove('hidden');
epGlobals.initCarousel(carouselSelector, options, carouselId);
jQuery(window).on("elementor/frontend/init", function () {
var filterableGalleryHandler = function ($scope, $) {
// Get the Elementor unique selector for this widget
let classes = $scope[0].className;
let selectorEl = '.' + classes.split(' ').join('.');
const epElLoadMore = () => {
const spinicon = '<svg width="18" height="18" fill="#fff" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>.spinner_GuJz{transform-origin:center;animation:spinner_STY6 1.5s linear infinite}@keyframes spinner_STY6{100%{transform:rotate(360deg)}}</style><g class="spinner_GuJz"><circle cx="3" cy="12" r="2"/><circle cx="21" cy="12" r="2"/><circle cx="12" cy="21" r="2"/><circle cx="12" cy="3" r="2"/><circle cx="5.64" cy="5.64" r="2"/><circle cx="18.36" cy="18.36" r="2"/><circle cx="5.64" cy="18.36" r="2"/><circle cx="18.36" cy="5.64" r="2"/></g></svg>';
$('.elementor-widget-container .ep-nft-gallery-wrapper').each(function () {
let selctorEl = `.elementor-widget-container [data-nftid='${$(this).data('nftid')}']`;
let loadmorelabel = $(selctorEl).data('loadmorelabel');
$(selctorEl + ` .ep_nft_item`).slice(0, $(selctorEl).data('itemparpage')).show();
$('.elementor-widget-container .ep-nft-gallery-wrapper .ep-loadmore-wrapper button').css('display', 'flex');
$(selctorEl + " .nft-loadmore").click(function (e) {
//change the text of the button
$(this).html(loadmorelabel + spinicon);
$(this).prop("disabled", true);
$(selctorEl + " .nft-loadmore").text(loadmorelabel);
$(selctorEl + " .nft-loadmore").prop("disabled", false);
$(selctorEl + " .ep_nft_item:hidden").slice(0, $(selctorEl).data('itemparpage')).fadeIn("slow");
if ($(selctorEl + " .ep_nft_item:hidden").length == 0) {
$(selctorEl + " .nft-loadmore").fadeOut("slow");
if ($('.elementor-widget-container .ep-nft-gallery-wrapper').length > 0) {
// Content protection system function
const unlockElSubmitHander = (perentSel, that) => {
var ep_client_id = jQuery(that).closest('form').find('input[name="ep_client_id"]').val();
var password = jQuery(`input[name="pass_${ep_client_id}"]`).val();
var post_id = jQuery(`input[name="post_id"]`).val();
const buttonText = jQuery(that).closest('.password-form-container').find('input[type="submit"]').val();
const unlokingText = jQuery(that).data('unlocking-text');
'action': 'lock_content_form_handler',
'client_id': ep_client_id,
jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="submit"]').val(unlokingText);
jQuery.post(eplocalize.ajaxurl, data, function (response) {
if (!response.embedHtml) {
jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="submit"]').val(buttonText);
jQuery('#' + perentSel + '-' + ep_client_id + ' .password-form input[type="password"]').val('');
jQuery(that).closest('.password-form-container').find('.error-message').removeClass('hidden');
if ($('.ep-content-locked').has('#' + perentSel + '-' + ep_client_id).length) {
$('.ep-content-locked').removeClass('ep-content-locked');
jQuery('#' + perentSel + '-' + ep_client_id + ' .ep-embed-content-wraper').html(response.embedHtml);
$('#' + perentSel + '-' + ep_client_id).removeClass('ep-content-protection-enabled');
if (jQuery('#' + perentSel + '-' + ep_client_id + ' .ose-youtube').length > 0) {
epGlobals.youtubeChannelGallery();
if ($('.elementor-widget-container .ep-nft-gallery-wrapper').length > 0) {
jQuery('#password-error_' + ep_client_id).html(response.form);
jQuery('#password-error_' + ep_client_id).show();
// unlockElSubmitHander called for Elementor
jQuery('.ep-elementor-content .password-form').submit(function (e) {
e.preventDefault(); // Prevent the default form submission
unlockElSubmitHander('ep-elementor-content', this);
const instaWrappers = document.querySelectorAll('.ep-embed-content-wraper');
if (instaWrappers.length > 0) {
instaWrappers.forEach((wrapper) => {
const carouselId = wrapper.getAttribute('data-carouselid');
let options = wrapper.getAttribute(`data-carousel-options`);
options = JSON.parse(options);
const carouselSelector = `[data-carouselid="${carouselId}"] .embedpress-insta-container`;
document.querySelector(`[data-carouselid="${carouselId}"] .cg-carousel__btns`).classList.remove('hidden');
epGlobals.initCarousel(carouselSelector, options, carouselId);
const instaFeed = document.querySelector(`${selectorEl} .ose-instagram-feed`);
const instaGallery = document.querySelector(`${selectorEl} .insta-gallery`);
epGlobals.initializeTabs(instaFeed);
epGlobals.instaPopup(instaGallery);
$('.popup-close').click(function (e) {
// Hide the popup by setting display to none
$('.insta-popup').hide();
$('.popup-container').remove();