X7ROOT File Manager
Current Path:
/home/hikrsdyp/public_html/wp-content/plugins/extendify/src/Agent/hooks
home
/
hikrsdyp
/
public_html
/
wp-content
/
plugins
/
extendify
/
src
/
Agent
/
hooks
/
??
..
??
useDraggable.js
(3.77 KB)
??
useFontVariationOverride.js
(2.33 KB)
??
useLockPost.js
(567 B)
??
usePortal.js
(485 B)
??
useResizable.js
(3.17 KB)
??
useThemeFontsVariations.js
(399 B)
??
useThemeVariations.js
(1.14 KB)
??
useVariationOverride.js
(3.11 KB)
Editing: useLockPost.js
import apiFetch from '@wordpress/api-fetch'; import { useEffect } from '@wordpress/element'; export const useLockPost = ({ postId, enabled }) => { useEffect(() => { if (!postId || !enabled) return; let timeoutId; const lockPost = async () => { await apiFetch({ path: '/extendify/v1/agent/lock-post', method: 'POST', data: { postId }, }).catch(() => undefined); // lock auto removes every 15 minutes timeoutId = setTimeout(lockPost, 14 * 60 * 1000); }; lockPost(); return () => clearTimeout(timeoutId); }, [postId, enabled]); };
Upload File
Create Folder