get_post and build_postbit don't work when using AJAX - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html) +--- Forum: General Support (https://community.mybb.com/forum-176.html) +--- Thread: get_post and build_postbit don't work when using AJAX (/thread-207647.html) |
get_post and build_postbit don't work when using AJAX - Spritanium - 2017-01-22 Hi, I'm using this code (hooked into xmlhttp) to re-render a post after an AJAX call completes:
Here is the error returned in the Javascript console:
It seems there are a bunch of variables missing, causing the eval for postbit_classic to fail. But I don't understand why get_post($pid) isn't doing what it's supposed to (the pid is definitely correct). Could anyone help with this?EDIT: get_post isn't even returning an array like it's supposed to. This is what it returns (random post):
I also tried using this instead of get_post:
Same result. There's no reason that shouldn't return an array, so what's going on? |