-1

So basically, I am using the Wordpress editor on my site and I do not want my users posting ANY HTML in it at all since it can cause some problems.

My Wordpress Editor is currently like this:

<?php wp_editor( get_the_content() , 'post_content'); ?>

In simple terms, I would basically like it to just look like a simple HTML textarea, and strip all HTML tags (like what the PHP function strip_tags does. Although, I cannot get this PHP functionality working with a simple textarea... Not to sure why, just a coding problem with my theme.

So yes, is something like this possible?

4

3 に答える 3

1

array_mapデータベースに保存している配列のすべての要素のタグを削除するために使用できると思います..

$save_to_db = array_map('strip_tags', $save_to_db);

于 2013-11-04T05:33:34.527 に答える
1

get_the_content()入力されたコンテンツの文字列を返すため、それは単純にユーザーの入力であり、フィルター処理されていません。次に例を示します。"This is an <em>unfiltered</em> string with <strong>potential HTML included!</strong>"

strip_tagsエディターを初期化する場合、初期化中に上記の入力を単純に呼び出すことはできませんか?

<?php wp_editor( strip_tags(get_the_content()), 'post_content'); ?>

最終的なテキストは、次のようになりますstrip_tags"This is an unfiltered string with potential HTML included!"

于 2013-11-04T04:13:18.993 に答える