• After newest version i get error
    Fatal error: Uncaught TypeError: Return value of Yoast\WP\SEO\Schema_Aggregator\User_Interface\Site_Schema_Response_Header_Integration::serve_custom_response() must be of the type bool, null returned in wp-content/plugins/wordpress-seo/src/schema-aggregator/user-interface/site-schema-response-header-integration.php:62 Stack trace: #0 /wp-includes/class-wp-hook.php(341): Yoast\WP\SEO\Schema_Aggregator\User_Interface\Site_Schema_Response_Header_Integration->serve_custom_response() #1 wp-includes/plugin.php(205): WP_Hook->apply_filters() #2 wp-includes/rest-api/class-wp-rest-server.php(515): apply_filters() #3 wp-includes/rest-api.php(467): WP_REST_Server->serve_request() #4 /wp-includes/class-wp-hook.php(341): rest_api_loaded() #5 in /wp-content/plugins/wordpress-seo/src/schema-aggregator/user-interface/site-schema-response-header-integration.php on line 62

Viewing 1 replies (of 1 total)
  • Same here!

    I had to edit the function like this :

    public function serve_custom_response( $served, $result, $request ): bool {
    if ( \strpos( $request->get_route(), '/yoast/v1/schema-aggregator' ) !== 0 ) {
    return (bool) $served;
    }

    if ( ! $result instanceof WP_REST_Response || $result->is_error() ) {
    return (bool) $served;
    }

    $this->schema_map_header_adapter->set_header_for_request( $result );

    return true;
    }
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.