0
我使用强制摘录代码自动生成摘录的内容,而无需使用多个标签或摘录编辑器对话框中的functions.php如下:的WordPress如何添加TinyMCE的格式排功能后> ID摘录过滤
function mytheme_excerpt_read_more_link($output) {
global $post;
return $output . ' <div class="more-link">
<a href="' . get_permalink($post->ID) . '>Read More</a></div>';
}
add_filter('the_excerpt', 'mytheme_excerpt_read_more_link');
但是,我需要添加TinyMCE函数,以便如果某人在编辑器中添加斜体(例如),<em>
将在摘录代码中选取。
这是我定制TinyMCE的:
add_filter('mce_buttons', 'mrw_mce_buttons_1');
function mrw_mce_buttons_1($buttons) {
$buttons = array('styleselect', 'bold', 'italic',
'link', 'unlink', 'bullist', 'numlist', 'indent',
'outdent', 'pastetext', 'removeformat', 'charmap',
'undo', 'redo', 'wp_more','wp_help', );
return $buttons;
}
怎样上述过滤器添加到后> ID?我试过,但没有奏效:
function my_theme_add_tinymce_styles() {
global $post;
$post_type = get_post_type($post->ID);
$tinymce_style = 'mrw_mce_buttons_1';
add_editor_style($tinymce_style);
}
add_action('pre_get_posts', 'my_theme_add_tinymce_styles');
感谢 查尔斯