Hide "Promoted to front page" and "Sticky at top of lists" options in Drupal
This blog describes how to hide "Promoted to front page" and "Sticky at top of lists" options from node editing page in Drupal. When adding or editing a node, you can see "Publishing options" at bottom of the page which contains 'Published', 'Promoted to front page' and 'Sticky at top of lists' checkbox options. The below image shows you the three options:
The "Published" option is used to publish the content. The "Promoted to front page" option is used to display content in the front page. The 'Sticky at top of lists' option is used to keep the content sticked to the top of front page. If you don't need to show "Promoted to front page" and "Sticky at top of lists" options, then you can hide those options easily. You can hide these options by altering the form either using either hook_form_alter() or hook_form_form_id_alter().
<?php
/**
* Implement hook_form_FORM_ID_alter().
*/
function kf_form_article_node_form(&$form, $&form_state) {
// hide promoted to front page option
if (isset($form['options']['promote'])) {
$form['options']['promote']['#access'] = FALSE;
}
// hide sticky at top of lists option
if (isset($form['options']['sticky'])) {
$form['options']['sticky']['#access'] = FALSE;
}
}
?>