输入上的WP_EDITOR更改内容

时间:2014-04-02 作者:Lynn Appleget

我有一个使用wp\\U编辑器的文本区域

第一次输入时效果很好。

通过文本或视觉保存它保存到mysql刚刚好这是我保存之前文本区域中的内容

<a href="/wp-content/uploads/2014/03/Multi_Leaf_2098.jpg"><img class="alignleft size-medium wp-image-555" alt="Drag Multi Leaf" src="/wp-content/uploads/2014/03/Multi_Leaf_2098-199x300.jpg" width="199" height="300" /></a>Designed with a low arch, which promotes weight transfer by lowering the ride height at the rear of the vehicle.
Very high spring rate which aids in transferring weight quicker and planting the rear tires.
把它带到文本区域我会得到卷曲引号。。。文本已截断(请参见alt标记)。。。图片未加载。。。

<a href="”/wp-content/uploads/2014/03/Multi_Leaf_2098.jpg”"><img class="”alignleft" alt="”Drag" src="”/wp-content/uploads/2014/03/Multi_Leaf_2098-199×300.jpg”" width="”199″" height="”300″" /></a>Designed with a low arch, which promotes weight transfer by lowering the ride height at the rear of the vehicle.

Very high spring rate which aids in transferring weight quicker and planting the rear tires.

&nbsp;
如果再次保存并返回双卷引号,请注意额外的行和硬空格以及额外的行<请注意额外的行、硬空间和额外的行

现在,除非我修复一切并重做图片,否则它将不再工作。所以你不能编辑你必须重做

因此,我很确定加载到编辑区域时它会发生变化,因此我尝试了wp\\U编辑器调用

wp_editor(html_entity_decode(stripcslashes($content)), \'content\', $settings);
wp_editor(html_entity_decode($content), \'content\', $settings);
wp_editor(stripcslashes($content), \'content\', $settings);

$settings = array(
    \'tinymce\'       => array(
        \'setup\' => \'function (ed) {
            tinymce.documentBaseURL = "\' . get_admin_url() . \'";
        }\',
    ),
    \'quicktags\'     => TRUE,
    \'editor_class\'  => \'frontend-article-editor\',
    \'textarea_rows\' => 25,
    \'media_buttons\' => TRUE,
);
我已经安装了tnymce advanced。这些设置会让这一切发生吗。

1 个回复
SO网友:JinYoung Chang

在函数中添加这两行。php:

remove_filter( \'the_content\', \'wpautop\' ); 
remove_filter( \'the_content\', \'wptexturize\' );

结束

相关推荐

如何在tinyMCE段落下拉菜单中向html输出元素添加类

我试图修改函数中的TinyMCE行为。php。我试图做到这一点,例如h4在每次违约时都会得到一类“头条新闻”。我已经走到一半了。我找到了创建下拉菜单的设置,其中填充了我的自定义样式/类:function tinymce_mod( $init ) { $init[\'theme_advanced_buttons2_add\'] = \'styleselect\'; $init[\'theme_advanced_styles\'] = \"Header 4=mus-bi\";&