尽管 autop 功能似乎在我不想要它时给了我所有的地狱,我有几个带有 tinyMCE 文本区域的自定义元框。现在他们不存钱了
标签.. 他们似乎没问题 / 保存其他 html 标记。
我的一个盒子的 html 看起来像:
<div class="customEditor">
<div class="custom_upload_buttons" class="hide-if-no-js"><?php do_action( 'media_buttons' ); ?></div>
<?php $mb->the_field('below_content'); ?>
<textarea rows="10" cols="50" name="<?php $mb->the_name(); ?>" rows="3"><?php $mb->the_value(); ?></textarea>
</div>
命名和东西都由 WPAlchemy 处理,因此奇怪的 $mb->the_name() 东西
功能 my_admin_print_footer_scripts() { ?>
/*
/* * 多个 TinyMCE 设置 */
设置= {模式:“特定文本区域”,宽度:“100%”,主题:“高级”,皮肤:“wp_theme”,主题高级按钮1:“粗体,斜体,删除线,下划线,|,bullist,numlist,blockquote,|,justifyleft ,justifycenter,justifyright,|,link,unlink,|,spellchecker", theme_advanced_buttons2:"formatselect,XXXforecolor,|,pastetext,pasteword,removeformat,|,outdent,indent,|,undo,redo,|,code", theme_advanced_buttons3: "", theme_advanced_buttons4:"", language:"en", spellchecker_languages:"+English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Polish=pl,葡萄牙语=pt,西班牙语=es,瑞典语=sv", theme_advanced_toolbar_location:"top", theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom", theme_advanced_resizing:"1", theme_advanced_resize_horizontal:"", dialog_type:"modal", relative_urls:"", remove_script_host:"", convert_urls:"", apply_source_formatting:"", remove_linebreaks:"1", gecko_spellcheck :“1”,实体:“38,amp,60,lt,62,gt”,accessibility_focus:“1”,tabfocus_elements:“major-publishing-actions”,media_strict:“”,paste_remove_styles:“1”,paste_remove_spans: "1", paste_strip_class_attributes:"all", wpeditimage_disable_captions:"", plugins:"safari,inlinepopups,spellchecker,paste,wordpress,tabfocus" };jQuery(document).ready(function($) { var $ta, id, mceID; $('.customEditor textarea').each(function(i){ $ta = $(this); id = $ta.attr('id'); if (!id){ id = 'customEditor-' + i; $ta.attr('id',id); } tinyMCE.settings = settings; tinyMCE.execCommand('mceAddControl',
假的,身份证);});
$('.custom_upload_buttons a').each(function() { $(this).click(function() { mceID = $(this).parent().next('textarea').attr('id'); window.send_to_editor = window.send_to_editor_clone; }); window.send_to_editor_clone = function(html){ tinyMCE.execInstanceCommand(mceID, 'mceInsertContent', false, html); tb_remove(); } }); }); /* ]]> */</script><?php }
// 重要:注意优先级99,js需要放在tinymce加载后 add_action('admin_print_footer_scripts','my_admin_print_footer_scripts',99);