<?php
// отключаем фильтр
remove_filter( 'pre_term_description', 'wp_filter_kses' );
remove_filter( 'term_description', 'wp_kses_data' );
//добавляем редактор
add_filter('edit_category_form_fields', 'cat_description');
function cat_description($tag) {
?>
<table class="form-table">
<tr class="form-field">
<th scope="row" valign="top"><label for="description"><?php _ex('Description', 'Taxonomy Description'); ?></label></th>
<td>
<?php
$settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '15', 'textarea_name' => 'description' );
wp_editor(wp_kses_post($tag->description , ENT_QUOTES, 'UTF-8'), 'cat_description', $settings);
?>
<br />
<span class="description">
<?php _e('The description is not prominent by default; however, some themes may show it.'); ?>
</span>
</td>
</tr>
</table><?php
}
//отключаем стандартное поле
add_action('admin_head', 'remove_default_category_description');
function remove_default_category_description() {
global $current_screen;
if ( $current_screen->id == 'edit-category' ) {?>
<script>
jQuery(function($) {
$('#edittag').css( "maxWidth","1420px");
$('.column-description').remove();
$('textarea#description').closest('tr.form-field').remove();
});
</script><?php
}
}
?>