Risposte:
Sì, rimuovi il supporto dell'editor dal tuo tipo di post personalizzato.
Puoi farlo in due modi.
Esempio:
$args = array(
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'capability_type' => 'post',
'has_archive' => true,
'supports' => array('title','author','thumbnail','excerpt','comments')
);
register_post_type('book',$args);
2.Utilizzando il supporto remove_post_type se il tipo di post personalizzato non è definito dal tuo codice (ovvero alcuni altri plugin / temi hanno definito un tipo di post personalizzato).
Esempio:
add_action('init', 'my_rem_editor_from_post_type');
function my_rem_editor_from_post_type() {
remove_post_type_support( <POST TYPE>, 'editor' );
}
Quando registri il tuo tipo di post personalizzato, non specificare il supporto per l'editor.
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true,
'hierarchical' => false,
'menu_position' => null,
// on the supports param here you see no 'editor'
'supports' => array('title','author','thumbnail','excerpt','comments')
);
register_post_type('book',$args);
Ulteriori informazioni Vedere: Riferimento funzioni / tipo di registro .
Puoi anche impostare
'supports' => false
per evitare comportamenti predefiniti (titolo ed editor).
Nota: questo è per 3,5 o superiore.
Puoi rimuovere tittle o l'editor nell'amministratore del modulo post
function mvandemar_remove_post_type_support() {
remove_post_type_support( 'post', 'title' );
remove_post_type_support( 'post', 'editor' );
}
add_action( 'init', 'mvandemar_remove_post_type_support' );