Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

im using the media finder plugin which works fine in 2.9 wordpress, but since the 3.0 wordpress, the json sans eval library which the plugin uses works no more.

not sure what was involved in the upgrade from 2.9 to 3.0 core wise with json.

here is a screenshot what firebug in firefox spits out, the actual json is parsed, but its not displayed. (media finder lets you search vid the media manager in your post)

so since json eval sans is non validating, not sure if wp 3.0 doesnt like that.

here is the url to the plugin

http://wordpress.org/extend/plugins/media-finder/

here is the screen shot of the error in the plugin

http://imgur.com/RFGXm.jpg

anyone can assist would be a life saver, or even what is involved in converting the code from json sans eval to json2.js which wp is packed with now

the code that would need to be converted to json2 would be the line

xhr = $.post(ajaxurl, params, function(data) {

data = jsonParse(data);

share|improve this question

1 Answer 1

up vote 2 down vote accepted

When I comment out the line:

@header('Content-type: application/json; charset=UTF-8');

it works for me

p.s.

  1. there is also a closing php opening tag in it without the word php
  2. there is a closing php tag at the bottom which can be gone
  3. there is a notice on an undefined index.
  4. better would be to use $charset = get_option('blog_charset');

I have no idea if this: http://wordpress.org/support/topic/plugin-json-api-content-length-header has something do with it, or this: http://core.trac.wordpress.org/ticket/11537 or this: http://wordpress.org/support/topic/wordpress-gone-wild?replies=3 , did not dive in it.

share|improve this answer
1  
just noticing, as it might be irritating: "there is also a closing php tag in it without the word php" -> closing php tags never have the word php in there. it#s just ?> –  hakre Nov 17 '10 at 22:29
1  
sorry... opening tag I ment (the second line confused me), check the code of the plugin (noticed it because it failed to run on my server, had to add "php") –  edelwater Nov 17 '10 at 23:46
1  
wow, well this something the plugin author should fix. it's something everybody of us should do for shared code: add the php in opening tags as the short version (w/o php) does not run on every server. This is really something the plugin author should be noticed about. –  hakre Nov 18 '10 at 0:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.