admin管理员组

文章数量:1389972

I have a custom REST route that imports a CSV file. Everything works so far, but I get a timeout error because it's a really big CSV and it takes a long time. I want to make my REST route start the import process, then return a response while continuing to import.

register_rest_route('lws-admin/v1', '/customer/import', array(
  'methods' => 'POST',
  'callback' => function($request) {
    // *start really long operation*

    return array(
      'message' => 'import started'
    );
  }
));

本文标签: adminAllow custom REST route to return before doing long operation