WordPress 3.0 で、カスタムテンプレートプラグインを使っているとカスタム投稿タイプで画像が挿入できなくなる
custom-field-template.php の下記の箇所を書き換えると直る。
/* オリジナル */ /* function media_send_to_custom_field($html) { $options = $this->get_custom_field_template_data(); $out = '<script type="text/javascript">' . "\n" . ' // <![CDATA[' . "\n" . ' var win = window.dialogArguments || opener || parent || top;' . "\n" . ' win.send_to_custom_field("' . addslashes($html) . '");' . "\n" . '// ]]>' . "\n" . '</script>' . "\n"; echo $out; if ($options['custom_field_template_use_multiple_insert']) { return; } else { exit(); } } */ /* 修正済み */ function media_send_to_custom_field($html) { $options = $this->get_custom_field_template_data(); $out = '<script type="text/javascript">' . "\n" . ' /* <![CDATA[ */' . "\n" . ' var win = window.dialogArguments || opener || parent || top;' . "\n" . //' win.send_to_custom_field("' . addslashes($html) . '");' . "\n" . ' if(typeof win.send_to_custom_field == "function") {' . "\n" . ' win.send_to_custom_field("' . addslashes($html) . '");' . "\n" . ' } else {' . "\n" . ' win.send_to_editor("' . addslashes($html) . '");' . "\n" . ' }' . "\n" . '/* ]]> */' . "\n" . '</script>' . "\n"; echo $out; if ($options['custom_field_template_use_multiple_insert']) { return; } else { exit(); } }
via http://wordpress.org/support/topic/317991/page/2?replies=56