Closed GoogleCodeExporter closed 8 years ago
After further inspection of the code, I understand that the Javascript reads
the output of the AJAX call and expects a '1' for a successful operation.
Still, replacing
die($result)
with
print "$result\n";
has the same effect and solves the problem.
Original comment by martijng...@gmail.com
on 19 Dec 2011 at 4:12
Then again, if you insist on using die(), please consider doing it in a
separate hook with an extremely high prio:
add_action('wp_ajax_ngg_ajax_operation', 'ngg_ajax_operation_die', 100 );
function ngg_ajax_operation_die ()
{
die $result;
}
How to pass the result from one function to the other, I leave to your
imagination ;-)
Original comment by martijng...@gmail.com
on 19 Dec 2011 at 4:23
What's about a filter / action hook , just before the die() ?
Original comment by alex.cologne
on 16 Jan 2012 at 12:14
Will close this for now, if there is a need for a filter/hook let me know
Original comment by alex.cologne
on 18 Feb 2012 at 3:07
I am sorry for not replying to this any sooner, I haven't looked at the issue
for a while.
Your suggestion of adding a hook just before the die() will work for me; I added
do_action ('ngg_ajax_final operation');
on line 68 of admin/ajax.php and changed my code to use that action instead of
'wp_ajax_ngg_ajax_operation' with prio > 10.
Still, I think this is not a good solution because the plugin architecture
remains crippled, but it will work. Please do add a hook like you suggested.
Original comment by martijng...@gmail.com
on 12 Apr 2012 at 9:18
Original issue reported on code.google.com by
martijng...@gmail.com
on 19 Dec 2011 at 3:31