Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the $content parameter to the block render callback documentation #4507

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion docs/blocks-dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,14 @@ Because it is a dynamic block it also needs a server component. The rendering ca
<?php
// block.php

function my_plugin_render_block_latest_post( $attributes ) {
/**
* Renders the Latest Post block output for given attributes and content.
*
* @param array $attributes Block attributes.
* @param string|null $content Raw block content, or null if none set.
* @return string Rendered output.
*/
function my_plugin_render_block_latest_post( $attributes, $content ) {
$recent_posts = wp_get_recent_posts( array(
'numberposts' => 1,
'post_status' => 'publish',
Expand Down