【发布时间】:2017-01-23 15:22:26
【问题描述】:
我把这段代码放在了我的wordpress function.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 type="text/javascript">
jQuery(function($) {
$('textarea#description').closest('tr.form-field').remove();
});
</script>
<?php
}
}
你看得很清楚。
但是应该在“content-html”中显示的文本显示在“content-tmce”中。
例如:
"content-html": <strong>hello</strong>
"content-tmce": <strong>hello</strong>
我已遵循此指南:https://paulund.co.uk/add-tinymce-editor-category-description
我该如何解决?
【问题讨论】:
-
你从哪里得到这个代码?是向导吗?您可以链接到任何其他资源或示例吗?
-
你能解释一下这里困扰你的事情吗?对我来说,它似乎工作正常。我的意思是,尽可能好......
-
我希望“content-html”:hello。改为“content-tmce”预览可编辑
标签: php jquery html wordpress tinymce