WordPressの投稿で、YouTubeのiframeタグのコードが消えてしまうという報告がありました。
WordPress 3.5にアップグレードしてから起こっているようで、調べてみると予約投稿する場合に限って iframe や script タグコードが消えてしまうようです。
既にWordpressのtracでチケットが切られているので、次バージョンでは改善されることでしょう。
日本語での情報がまだ少ないようですし、お急ぎの方のためにWordpressのtracで紹介されているパッチを紹介しておきます。
本体のファイルを修正することで改善されます。
wp-includes / post.php の 3017行目付近
1 2 3 4 5 6 7 8 |
function wp_publish_post( $post ) { if ( ! $post = get_post( $post ) ) return; if ( 'publish' == $post->post_status ) return; $post->post_status = 'publish'; wp_update_post( $post ); } |
を
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function wp_publish_post( $post ) { global $wpdb; if ( ! $post = get_post( $post ) ) return; if ( 'publish' == $post->post_status ) return; $wpdb->update( $wpdb->posts, array( 'post_status' => 'publish' ), array( 'ID' => $post->ID ) ); clean_post_cache( $post->ID ); $old_status = $post->post_status; $post->post_status = 'publish'; wp_transition_post_status( 'publish', $old_status, $post ); do_action( 'edit_post', $post->ID, $post ); do_action( 'save_post', $post->ID, $post ); do_action( 'wp_insert_post', $post->ID, $post ); } |
に変更します(自己責任で)。
詳しくは以下を参照してください。
WordPress track Ticket #22944