Missing update_handler in the PodsRESTHandlers.php
-
REST POST cause:
“Uncaught TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class PodsRESTHandlers does not have a method \”update_handler\” in /home/sites/public_html/wp-includes/rest-api/endpoints/class-wp-rest-controller.php:469\nStack trace:\n#0 /home/sites/public_html/wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php(600): WP_REST_Controller->update_additional_fields_for_object()\n#1 /home/sites/public_html/wp-includes/rest-api/class-wp-rest-server.php(1292): WP_REST_Terms_Controller->create_item()\n#2 /home/sites/public_html/wp-includes/rest-api/class-wp-rest-server.php(1125): WP_REST_Server->respond_to_request()\n#3 /home/sites/public_html/wp-includes/rest-api/class-wp-rest-server.php(439): WP_REST_Server->dispatch()\n#4 /home/sites/public_html/wp-includes/rest-api.php(459): WP_REST_Server->serve_request()\n#5 /home/sites/public_html/wp-includes/class-wp-hook.php(324): rest_api_loaded()\n#6 /home/sites/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#7 /home/sites/public_html/wp-includes/plugin.php(565): WP_Hook->do_action()\n#8 /home/sites/public_html/wp-includes/class-wp.php(418): do_action_ref_array()\n#9 /home/sites/public_html/wp-includes/class-wp.php(818): WP->parse_request()\n#10 /home/sites/public_html/wp-includes/functions.php(1342): WP->main()\n#11 /home/sites/public_html/wp-blog-header.php(16): wp()\n#12 /home/sites/public_html/index.php(17): require(‘…’)\n#13 {main}\n thrown”,
Dummy update_handler in the PodsRESTHandlers.php resolve problem
/**
* Dummy update handler for WordPress REST API compatibility
*
* @param mixed $value Value to update
* @param object $object The object being updated
* @param string $field_name Field name
* @return bool
*/
public static function update_handler( $value, $object, $field_name ) {
// Пустой метод – реальное сохранение идет через save_handler hook
return true;
}
You must be logged in to reply to this topic.