强制1列并将发布元数据放在标题下方

时间:2015-04-10 11:52:44

标签: wordpress admin

如何在wordpress管理员的wysiwyg编辑器之前强制使用1列布局并将发布元数据放在标题下面?

1 个答案:

答案 0 :(得分:0)

add_action( 'add_meta_boxes', 'action_add_meta_boxes', 0 );
function action_add_meta_boxes() {
    global $_wp_post_type_features;
    if (isset($_wp_post_type_features['post']['editor']) && $_wp_post_type_features['post']['editor']) {
        unset($_wp_post_type_features['post']['editor']);
        add_meta_box(
            'description_section',
            __('Description'),
            'inner_custom_box',
            'post', 'normal', 'high'
        );
    }
    if (isset($_wp_post_type_features['page']['editor']) && $_wp_post_type_features['page']['editor']) {
        unset($_wp_post_type_features['page']['editor']);
        add_meta_box(
            'description_sectionid',
            __('Description'),
            'inner_custom_box',
            'page', 'normal', 'high'
        );
    }
}
function inner_custom_box( $post ) {
    the_editor($post->post_content);
}

(来自https://wordpress.org/support/topic/move-custom-meta-box-above-editor