add_action('init', function() {
if (! isset($_REQUEST[ 'photocrati_ajax' ]) || $_REQUEST['action'] !== 'upload_image') {
# not an upload image request so
return;
}
# process upload request here
}, 9);
因为,在次世代动作M_Ajax :: serve_ajax_request(其不点火)调用exit()后,您无法在NextGen操作之后运行。如果您需要在NextGen操作之后执行操作,那么您可以先在操作中运行NextGen操作,然后再操作并退出。
add_action('init', function() {
if (! isset($_REQUEST[ 'photocrati_ajax' ]) || $_REQUEST['action'] !== 'upload_image') {
# not an upload image request so
return;
}
# First do the NextGen action M_Ajax::serve_ajax_request() processing
$controller = C_Ajax_Controller::get_instance();
$controller->index_action();
# Now do your image upload processing here
# Finally, must exit otherwise NextGen action will be done twice
exit;
}, 9);
的$ _REQUEST这个样子的
[photocrati_ajax] => 1
[action] => upload_image
[gallery_id] => 0
[gallery_name] => gallery
[nextgen_upload_image_sec] => 496cc9951b
[name] => image.jpg