/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
client/sections-filter.js
15 строк
477 B
flootr
chore: migrate client/sections-filter to import/order (#54493)
13 июл 2021, 13:14
Не верифицирован
13 июл 2021, 13:14
2d57a54
Код
Авторство
О чём код?
import config from '@automattic/calypso-config'; export default function isSectionEnabled( section ) { return isSectionNameEnabled( section.name ); } export function isSectionNameEnabled( sectionName ) { const activeSections = config( 'sections' ); const byDefaultEnableSection = config( 'enable_all_sections' ); if ( activeSections && typeof activeSections[ sectionName ] !== 'undefined' ) { return activeSections[ sectionName ]; } return byDefaultEnableSection; }