WordPress.org

Ready to get started?Download WordPress

Forums

Custom Field Template
Inserting image to custom post type main content area (9 posts)

  1. catriona
    Member
    Posted 3 years ago #

    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=\"http://mydomainname.com/wp-content/uploads/2010/06/mobilemedical1-300x36.jpg\" [^] alt=\"\" title=\"mobilemedical\" width=\"300\" height=\"36\" class=\"alignleft size-medium wp-image-738\" />");
    /* ]]> */
    </script>

    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: http://wordpress.org/support/topic/317991/page/2

    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.

    Thanks!
    Cat

    http://wordpress.org/extend/plugins/custom-field-template/

  2. adam533
    Member
    Posted 3 years ago #

    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.

  3. Hiroaki Miyashita
    Member
    Plugin Author

    Posted 3 years ago #

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

  4. Patrick Daly
    Member
    Posted 3 years ago #

    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.

  5. NickHardeman
    Member
    Posted 3 years ago #

    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 //}

  6. newwws
    Member
    Posted 3 years ago #

    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.

  7. in1985
    Member
    Posted 3 years ago #

    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.

  8. unitdp
    Member
    Posted 3 years ago #

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

    <script>
    function send_to_custom_field(html) {
    	window.send_to_editor(html);
    }
    </script>
  9. ancawonka
    Member
    Posted 3 years ago #

    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.

    PHEW!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic