WordPress.org

Ready to get started?Download WordPress

Forums

Drag & Drop for Post Thumbnails
Brilliant plugin, what is the zero character? (6 posts)

  1. c.note
    Member
    Posted 2 years ago #

    Hi,
    This is a really great plugin but I noticed a zero character appears at the bottom of the Feature Image widget box just after I drag and upload an image. Doesn't have any affect on the actions but it planted a seed of doubt.
    Thanks

    Screenshot at tinypic

    http://wordpress.org/extend/plugins/drag-drop-for-post-thumbnails/

  2. Tobias Nygren
    Member
    Plugin Author

    Posted 1 year ago #

    Hi c.note!

    Sorry for my late reply. This little zerochar is bugging me to death. I don't know why this happens yet, but I tried a lot of things and I think the problem is related to the way I parse the output. Hopefully I will figure this out until next release. (FYI: I'm using nonces to authenticate just as the rest of the admin, so this is as secure as rest of wp admin).

  3. RonStrilaeff
    Member
    Posted 1 year ago #

    Tobias, I have a clue on the origin of that stray zero char ...

    Stick this in your browser's address bar:
    http://tobiasnygren.se/wp-admin/admin-ajax.php

    Use any other wordpress site's domain name ... the admin-ajax.php must be returning a false or zero after some internal function.

  4. Tobias Nygren
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you so much for digging Ron! That means I have to filter the return data, I have to look in to this asap.

    "If the AJAX request fails when the request url is wp-admin/admin-ajax.php, it will return either -1 or 0 depending on the reason it failed. Additionally, if an AJAX request succeeds, it will return a 0."
    http://codex.wordpress.org/AJAX_in_Plugins#Error_Return_Values

  5. RonStrilaeff
    Member
    Posted 1 year ago #

    I'm working with some ajax post/response logic and notice that occasionally I get a zero char in my response when the php-ajax side does not execute a die() or exit() statement. It can be successful, but still not terminated properly. Hope this is another useful clue.

  6. Jonathan Lundström
    Member
    Posted 1 year ago #

    Hello Tobias!

    This problem is easily resolved by using die(); instead of a traditional return/echo in the admin ajax function. If you do not run die it will continue to execute, therefore returning unwanted numerics. Let me know how this works out for you :)

    Best regards,
    Jonathan

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.