| 1 |
import { useSelect, dispatch } from '@wordpress/data' |
| 2 |
import { useEffect } from '@wordpress/element' |
| 3 |
|
| 4 |
export const useDisableWelcomeGuide = () => { |
| 5 |
const isWelcomeGuide = useSelect((select) => { |
| 6 |
return select('core/edit-post').isFeatureActive('welcomeGuide') |
| 7 |
}, []) |
| 8 |
|
| 9 |
useEffect(() => { |
| 10 |
if (isWelcomeGuide) { |
| 11 |
dispatch('core/edit-post').toggleFeature('welcomeGuide') |
| 12 |
} |
| 13 |
}, [isWelcomeGuide]) |
| 14 |
} |
| 15 |
|