function fb_instant_articles_form_node_type_form_builder in Facebook Instant Articles 3.x
Same name and namespace in other branches
- 8.2 fb_instant_articles.module \fb_instant_articles_form_node_type_form_builder()
Entity builder for the node type form with the FBIA toggle.
See also
fb_instant_articles_form_node_type_form_alter()
1 string reference to 'fb_instant_articles_form_node_type_form_builder'
File
- ./
fb_instant_articles.module, line 126 - Contains fb_instant_articles.module..
Code
function fb_instant_articles_form_node_type_form_builder($entity_type, NodeTypeInterface $type, &$form, FormStateInterface $form_state) {
if ($form_state
->getValue('fb_instant_articles_enabled') === 1) {
$type
->setThirdPartySetting('fb_instant_articles', 'fb_instant_articles_enabled', 1);
}
else {
$type
->unsetThirdPartySetting('fb_instant_articles', 'fb_instant_articles_enabled');
}
}