$71 GRAYBYTE WORDPRESS FILE MANAGER $80

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

/home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/PageCreator/hooks/

HOME
Current File : /home/bravrvjk/dantho.rw/wp-content/plugins/extendify/src/PageCreator/hooks//usePageLayout.js
import { useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import {
	getGeneratedPageTemplate,
	getImprintPageTemplate,
} from '@page-creator/api/DataApi';
import { usePageProfile } from '@page-creator/hooks/usePageProfile';
import { useSiteImages } from '@page-creator/hooks/useSiteImages';
import { useSitePlugins } from '@page-creator/hooks/useSitePlugins';
import { useGlobalsStore } from '@page-creator/state/global';
import useSWRImmutable from 'swr/immutable';

export const usePageLayout = () => {
	const { pageProfile } = usePageProfile();
	const { siteImages } = useSiteImages();
	const { sitePlugins } = useSitePlugins();
	const loading = !pageProfile || !siteImages || !sitePlugins;
	const { setProgress, regenerationCount } = useGlobalsStore();

	const params = {
		key: `page-creator-page-layout-${regenerationCount}`,
		pageProfile,
		siteImages,
		sitePlugins,
	};

	const fetcher = pageProfile?.isImprintPage
		? () => getImprintPageTemplate()
		: getGeneratedPageTemplate;

	const { data, error } = useSWRImmutable(loading ? null : params, fetcher);

	useEffect(() => {
		if (data) return;
		setProgress(__('Creating a custom layout...', 'extendify-local'));
	}, [data, setProgress]);

	return { template: data?.template ?? data, error, loading: !data && !error };
};


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
6 Nov 2025 10.43 AM
bravrvjk / bravrvjk
0755
usePageCustomContent.js
2.1 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
usePageLayout.js
1.282 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644
usePageProfile.js
0.964 KB
13 Mar 2025 9.10 PM
bravrvjk / bravrvjk
0644
useSiteImages.js
0.788 KB
13 Mar 2025 9.10 PM
bravrvjk / bravrvjk
0644
useSitePlugins.js
0.503 KB
27 Aug 2025 5.47 PM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF