/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/editor/src/components/post-author/select.js
26 строк
692 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { __ } from '@wordpress/i18n'; import { useDispatch } from '@wordpress/data'; import { SelectControl } from '@wordpress/components'; import { store as editorStore } from '../../store'; import { useAuthorsQuery } from './hook'; export default function PostAuthorSelect() { const { editPost } = useDispatch( editorStore ); const { authorId, authorOptions } = useAuthorsQuery(); const setAuthorId = ( value ) => { const author = Number( value ); editPost( { author } ); }; return ( <SelectControl className="post-author-selector" label={ __( 'Author' ) } options={ authorOptions } onChange={ setAuthorId } value={ authorId } hideLabelFromVision /> ); }