$13 GRAYBYTE WORDPRESS FILE MANAGER $29

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.157
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//sitemap_item.js
import { __ } from '@wordpress/i18n';
import { useState, useMemo, useEffect } from '@wordpress/element';

export const RenderSitemapItem = (props) => {
	const { _props, pl_props, data } = props;
	const { attributes } = _props;
	const { atts } = data;
	const [allData, setAllData] = useState({});
	const [memoizationCache, setMemoizationCache] = useState({});

	useEffect(() => {

		const ajaxUrl = `${pagelayer_ajax_url}&action=${atts.sitemap_type == 'post_type' ? 'pagelayer_get_pages_list' : 'pagelayer_get_taxonomy_list'}`;
		
		// Skip for title attribute
		const cacheKey = JSON.stringify({
			...attributes,
			title: ''
		});
		
		if(memoizationCache[cacheKey]) {
			setAllData(memoizationCache[cacheKey]);
			return;
		}
		
		var data_type = "",
			post_order = "",
			order = "",
			hier = "",
			depth = "",
			empty = "";

		if (atts['sitemap_type'] == 'post_type') {
			data_type = atts['source_post'];
			post_order = atts['order_post'];
			order = atts['order'];
			hier = atts['hierarchical'];
			depth = atts['depth'];
		} else {
			data_type = atts['source_taxonomy'];
			post_order = atts['order_taxonomy'];
			order = atts['order'];
			hier = atts['hierarchical'];
			depth = atts['depth'];
			empty = atts['hide_empty'];
		}
		
		jQuery.ajax({
			type: 'POST',
			url: ajaxUrl,
			data: {
				type: data_type,
				post_order: post_order,
				order: order,
				hier: hier,
				depth: depth,
				empty: empty,
				pagelayer_nonce: pagelayer_ajax_nonce,
			},
			success: function (ajaxResponse) {
				setAllData(ajaxResponse);
				var newMemoizationCache = { ...memoizationCache };
				
				newMemoizationCache[cacheKey] = ajaxResponse;
				setMemoizationCache(newMemoizationCache);
			},
			error: function (error) {
				console.error("Error fetching data:-->", error);
			},
		});

		jQuery('.pagelayer-sitemap-div-holder[data-nofollow] .pagelayer-sitemap-list-item a').attr('rel', 'nofollow');
		
	}, [attributes]);

	return (
		<div className="pagelayer-sitemap-section">
			{allData.length > 0 && (
				<>
					<span>
					{ attributes['title'] ? (
						attributes.title
					) : (
						attributes.sitemap_type === 'post_type' ? __('Pages') : __('Categories')
					)}
					</span>
					<div dangerouslySetInnerHTML={{ __html: allData }} />
				</>
			)}
		</div >
	);
};


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