PHP Classes

File: src/hooks/useMenuFix.tsx

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WordPress React Plugin Kit   src/hooks/useMenuFix.tsx   Download  
File: src/hooks/useMenuFix.tsx
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WordPress React Plugin Kit
Environment to develop new WordPress plugins
Author: By
Last change:
Date: 2 years ago
Size: 481 bytes
 

Contents

Class file image Download
/** * External dependencies */ import { useEffect } from '@wordpress/element'; import { useLocation } from 'react-router-dom'; /** * Internal dependencies */ import { menuFix } from '../utils/MenuFix'; export default function useMenuFix() { const location = useLocation(); /** * Call menuFix after any route changes. * * fix the admin menu for the slug */ useEffect(() => { menuFix(); }, [location.pathname]); return null; }