$11 GRAYBYTE WORDPRESS FILE MANAGER $92

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/var/softaculous/sitepad/editor/site-data/plugins/pagelayer/js/react/src/blocks/

HOME
Current File : /var/softaculous/sitepad/editor/site-data/plugins/pagelayer/js/react/src/blocks//post_folio.js
import { useRef, useEffect, useState } from "react";

export const RenderPostsFolioBlock = (props) => {
	const { _props, tag, data } = props;
	const { className, attributes } = _props;
	const { id, atts } = data;
	
	const [cachedResponses, setCachedResponses] = useState([]);
	const [postHTML, setPostHTML] = useState([]);

	useEffect(() => {
		const post = {};
		
		post["pagelayer_nonce"] = pagelayer_ajax_nonce;
		if (atts["type"]) post["post_type"] = atts["type"];
		if (atts["filter_by"]) post["filter_by"] = atts["filter_by"];
		if (atts["count"]) post["posts_per_page"] = atts["count"];

		const stringifiedPost = JSON.stringify(post);

		// Check if the response is already cached
		const cachedResponse = cachedResponses.find(
			(cached) => JSON.stringify(cached.post) === stringifiedPost
		);
		
		if (cachedResponse) {
			setPostHTML(cachedResponse.data);
		} else {
			// If not cached, make the AJAX call
			jQuery.ajax({
				url: pagelayer_ajax_url + "action=pagelayer_fetch_posts",
				type: "post",
				data: post,
				success: function (data) {
					setPostHTML(data);
					
					// Cache the response for future use
					setCachedResponses((prevResponses) => [
						...prevResponses,
						{ post: post, data: data },
					]);
				},
			});
		}
	}, [attributes["type"], attributes["filter_by"], attributes["count"]]);

	useEffect(() => {
		pagelayer_post_folio(pagelayer_query(`.p-${id}`));
	}, [attributes["type"], attributes["filter_by"], attributes["count"], postHTML]);

	return (
		<div className="pagelayer-postfolio-section" dangerouslySetInnerHTML={{__html: postHTML}} />
	);
};



Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
21 Feb 2026 2.55 AM
root / root
0755
quote
--
21 Feb 2026 2.55 AM
root / root
0755
render-group
--
21 Feb 2026 2.55 AM
root / root
0755
archive-posts.js
1.395 KB
18 Feb 2026 11.32 PM
root / root
0644
col.js
1.624 KB
18 Feb 2026 11.32 PM
root / root
0644
facebook_button.js
1.282 KB
18 Feb 2026 11.32 PM
root / root
0644
image_slider.js
3.664 KB
18 Feb 2026 11.32 PM
root / root
0644
post_folio.js
1.624 KB
18 Feb 2026 11.32 PM
root / root
0644
posts.js
4.672 KB
18 Feb 2026 11.32 PM
root / root
0644
primary_menu.js
4.631 KB
18 Feb 2026 11.32 PM
root / root
0644
review_slider.js
1.753 KB
18 Feb 2026 11.32 PM
root / root
0644
row.js
8.442 KB
18 Feb 2026 11.32 PM
root / root
0644
sitemap_item.js
2.332 KB
18 Feb 2026 11.32 PM
root / root
0644
slides.js
1.67 KB
18 Feb 2026 11.32 PM
root / root
0644
tabs.js
3.14 KB
18 Feb 2026 11.32 PM
root / root
0644
testimonial_slider.js
1.717 KB
18 Feb 2026 11.32 PM
root / root
0644
video.js
2.381 KB
18 Feb 2026 11.32 PM
root / root
0644
video_slider.js
1.704 KB
18 Feb 2026 11.32 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF