/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/editor/src/components/post-format/check.js
29 строк
798 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { useSelect } from '@wordpress/data'; import PostTypeSupportCheck from '../post-type-support-check'; import { store as editorStore } from '../../store'; /** * Component check if there are any post formats. * * @param {Object} props The component props. * @param {React.ReactNode} props.children The child elements to render. * * @return {React.ReactNode} The rendered component or null if post formats are disabled. */ export default function PostFormatCheck( { children } ) { const disablePostFormats = useSelect( ( select ) => select( editorStore ).getEditorSettings().disablePostFormats, [] ); if ( disablePostFormats ) { return null; } return ( <PostTypeSupportCheck supportKeys="post-formats"> { children } </PostTypeSupportCheck> ); }