添加WordPress编辑器

添加WordPress编辑器,wordpress,wordpress-theming,Wordpress,Wordpress Theming,这就是我添加自定义分类法的方式 $args = array( 'labels' => $labels, 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_admin_column' =&g

这就是我添加自定义分类法的方式

$args = array(
    'labels'                     => $labels,
    'hierarchical'               => true,
    'public'                     => true,
    'show_ui'                    => true,
    'show_admin_column'          => true,
    'show_in_nav_menus'          => true,
    'show_tagcloud'              => true,
    'supports' => array( 'editor', 'thumbnail')
);
register_taxonomy( 'bookwriters', 'product', $args );
我想在描述中添加WordPress编辑器我怎么能做到


您可以尝试以下方法:

/**
 * TinyMCE editor in taxonomy page
 */
function o99__category_editor() {
    global $pagenow, $current_screen;

    if( $pagenow == 'edit-tags.php' ) {
        require_once(ABSPATH . 'wp-admin/includes/post.php'); // we need these
        require_once(ABSPATH . 'wp-admin/includes/template.php');

        wp_tiny_mce( false, array( 'editor_selector' => 'description', 'elements' => 'description', 'mode' => 'exact' )); // first argument TRUE will give the light version
    } 
}
add_action( 'init', 'o99__category_editor' );
我并没有真正测试过它,但沿着这条思路的一些东西应该是有效的。 此外,由于TinyMCE编辑器作为默认编辑器被删除,您可能需要获得Classic editor插件。也没有测试