Support » Plugin: Custom Field Template » [Plugin: Custom Field Template] Inserting image to custom post type main content area

  • I’m getting on odd error when custom-field-template plugin is active and I’m inserting an image into the main content area for a custom post type. The Media Center overlay goes white and there is a JavaScript error. The error does not occur when I insert an image into the Featured Image.

    When I deactivated Custom Field Template (which is an awesome plugin!), I was able to insert an image just fine.

    Javascript error:

    <script type="text/javascript">
        /* <![CDATA[ */
        var win = window.dialogArguments || opener || parent || top;
        win.send_to_custom_field("<img src=\"\" [^] alt=\"\" title=\"mobilemedical\" width=\"300\" height=\"36\" class=\"alignleft size-medium wp-image-738\" />");
    /* ]]> */

    win.send_to_custom_field throws the error (doesn’t exist?).

    I’m not sure if this is related to the issues discussed on this thread:

    In any case, for this particular site, we’re manually setting up the one field we were using the Custom Field Template plugin for, but I thought the info might helpful in case other folks are running into this odd interaction with WordPress 3.0, custom post types & inserting images, and the Custom Field Template plugin.


Viewing 8 replies - 1 through 8 (of 8 total)
  • Just wanted to add that I am getting the exact same error. Also have both plugins installed and was coming here to post about it (glad I searched first).

    Same situation – inserting as featured is fine, white screen when inserting into a post.

    Plugin Author Hiroaki Miyashita


    Please upgrade to the version 1.7.2. It should fix this.

    1.7.3 still doesn’t fix the issue for me.

    I have a custom post type called buzz. I didn’t have any of your plugin templates assigned to it while I was getting the error.

    So I just assigned a useless text field to buzz and now it works. Its just a work around; the JS error still needs to be fixed.

    I am developing a plugin that does not deal with posts or pages, but with its own database of information. I am using the wordpress media uploader and I am trying to get the send_to_editor javascript function from wordpress. However, this does not work because of the error custom template error: “win.send_to_custom_field is not a function.” When I deactivate the plugin, I can catch the wp javascript event. I am using custom field template 1.74 and wordpress 3.0.1.

    Any help would be greatly appreciated. 🙂

    This solution works, once the document has loaded, window.send_to_custom_field = window.send_to_editor = function(html) {// code //}



    Still not solved in 1.7.5 – sorry.

    I use the Custom Post Type UI plugin. I wonder which of the two plugins is responsible for the JavaScript error.



    I’m getting the exact same issue with 1.7.5 – just a white overlay screen when trying to insert an image into the main post area.



    Here’s a quick solution that works for me. Just copy/paste into the “Hello” plugin or somewhere that loads in the admin:

    function send_to_custom_field(html) {

    Just in case someone is running into this issue… I upgraded to Custom Field Template 1.7.9 and it seems to be fixed. I can now upload and insert images into posts, no problem.


Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Custom Field Template] Inserting image to custom post type main content area’ is closed to new replies.