Fatal error: Uncaught TypeError: Argument 1 passed to
-
Fatal error: Uncaught TypeError: Argument 1 passed to WP_Rest_Cache_Plugin\Includes\API\Endpoint_Api::add_wordpress_endpoints() must be of the type array, string given, called in …\wp-includes\class-wp-hook.php on line 286
and defined in …\wp-content\plugins\wp-rest-cache\includes\api\class-endpoint-api.php:268
Stack trace: #0 …\wp-includes\class-wp-hook.php(286): WP_Rest_Cache_Plugin\Includes\API\Endpoint_Api->add_wordpress_endpoints(”)
#1 …\wp-includes\plugin.php(208): WP_Hook->apply_filters(”, Array)
#2 …\wp-content\plugins\wp-rest-cache\includes\api\class-endpoint-api.php(249): apply_filters(‘wp_rest_cache/a…’, ”)
#3 …\wp-includes\class-wp-hook.php(286): WP_Rest_Cache_Plugin\Includes\API\Endpoint_Api->save_options(”)
#4 …\wp-content\plugins\wp-rest-cache\includes\api\class-endpoint-api.php on line 268I tried add endpoint and this happened.
function wprc_add_acf_nav_menu_items_endpoint( $allowed_endpoints ) {
if ( ! isset( $allowed_endpoints[ ‘extended/v1’ ] ) || ! in_array( ‘nav_menu_item’, $allowed_endpoints[ ‘extended/v1’ ] ) ) {
$allowed_endpoints[ ‘extended/v1’ ][] = ‘nav_menu_item’;
}
return $allowed_endpoints;
}
add_filter( ‘wp_rest_cache/allowed_endpoints’, ‘ExtendRestApi\wprc_add_acf_nav_menu_items_endpoint’, 10, 1);Even if I delete this code the error does not go away
- The topic ‘Fatal error: Uncaught TypeError: Argument 1 passed to’ is closed to new replies.