WP-CLI fatal error
-
I’m getting the following when using WP-CLI:
Fatal error: Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, array callback must have exactly two members in /var/www/html/wp-includes/rest-api/class-wp-rest-server.php:1631I eventually traced this to
[...]/event-tickets/src/Tickets/Commerce/Order_Modifiers/API/Coupons.php, in which there are three occasions where WP’s register_rest_route() is called with invalid parameters, this being the offending parameter:'schema' => $this->get_schema()I’m not sure quite what is being intended there, but as you’ll see it gets past the
_doing_it_wrong()checks inregister_rest_route()and causes the fatal error. I’ve commented out those three lines in my local copy, but I’d appreciate it if you could look into this and fix it before the next version, since it does cause WP-CLI to fail — which could be important for some people!
The topic ‘WP-CLI fatal error’ is closed to new replies.