다음은 노드 추가 / 편집 양식, 컨텐츠 유형 추가 / 편집 양식 및 관리자 / 컨텐츠 드롭 다운에서 "프론트 페이지로 승격"및 "목록 맨 위에 고정"을 제거하는 Drupal 7 용으로 작성한 사용자 정의 모듈입니다. 이 모듈은 데이터베이스 설정을 변경하지 않으므로 기존 내용을 변경하지 않으므로 언제든지 사용 중지하고 옵션을 다시 가져올 수 있으며 모든 것이 이전처럼 작동합니다.
이 코드를 hide_sticky_promote.module에 붙여넣고 해당 hide_sticky_promote.info 파일을 만들고 모듈 및 wallah를 더 이상 사용하지 않도록 설정하고 확인란 또는 드롭 다운 선택을 승격시킵니다.
/**
* Remove sticky/promote entirely from add and edit content type forms.
*
* Implements hook_form_FORM_ID_alter().
*/
function hide_sticky_promote_form_node_type_form_alter(&$form, &$form_state, $form_id) {
// Remove sticky/promote entirely from add and edit content type forms.
$options = array('promote', 'sticky');
foreach ($options as $key) {
unset($form['workflow']['node_options']['#options'][$key]);
}
}
/**
* Remove sticky/promote entirely from node/X/edit & node/X/add forms.
*
* Implements hook_form_BASE_FORM_ID_alter().
*/
function hide_sticky_promote_form_node_form_alter(&$form, &$form_state, $form_id) {
$options = array('promote', 'sticky');
foreach ($options as $key) {
$form['options'][$key]['#access'] = FALSE;
}
}
/**
* Remove some sticky/promote update options on admin/content.
*
* Implements hook_form_FORM_ID_alter().
*/
function hide_sticky_promote_form_node_admin_content_alter(&$form, &$form_state, $form_id) {
$options = array('demote', 'promote', 'sticky', 'unsticky', );
foreach ($options as $key) {
unset($form['admin']['options']['operation']['#options'][$key]);
}
}
또는 모듈 형식으로 여기에서 가져옵니다 : https://github.com/StudioZut/hide-sticky-promote