diff --git a/packages/components/src/server-side-render/README.md b/packages/components/src/server-side-render/README.md index ee18a7f4294ed..55b0be7630dab 100644 --- a/packages/components/src/server-side-render/README.md +++ b/packages/components/src/server-side-render/README.md @@ -32,5 +32,25 @@ Output uses the block's `render_callback` function, set when defining the block. ## API Endpoint -The API endpoint for getting the output for ServerSideRender is `/wp/v2/block-renderer/:block`. It accepts any params, which are used as `attributes` for the block's `render_callback` method. - +The API endpoint for getting the output for ServerSideRender is `/wp/v2/block-renderer/:block`. It will use the block's `render_callback` method. + +If you pass `attributes` to `ServerSideRender`, the block must also be registered and have its attributes defined in PHP. + +```php +register_block_type( + 'core/archives', + array( + 'attributes' => array( + 'showPostCounts' => array( + 'type' => 'boolean', + 'default' => false, + ), + 'displayAsDropdown' => array( + 'type' => 'boolean', + 'default' => false, + ), + ), + 'render_callback' => 'render_block_core_archives', + ) +); +```