react-code-dataset / wp-calypso /client /sections-filter.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
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;
}