wp_insert_postでscript,iframeタグさ消されるのを防ぐ
wp_insert_postでfc2動画を投稿してましたが
scriptタグが勝手に削除されてこまってました。

以下の方法で解決できましたので、備忘録です。
switch_to_blog( $SITE_ID );
remove_filter('content_save_pre', 'wp_filter_post_kses');
$insert_id = wp_insert_post($post_value,true);
restore_current_blog();
wp_insert_postの前に「remove_filter(‘content_save_pre’, ‘wp_filter_post_kses’);」を実行してサニタイズを無効にしてあげます。
これでOKでした。
- Word Press
Total 281 views