WPDev.one
Core Function
View Source on Trac ↗

apply_block_hooks_to_content_from_post_object()

apply_block_hooks_to_content_from_post_object( mixed $content, mixed $post = null, mixed $callback = 'insert_hooked_blocks' )

Run the Block Hooks algorithm on a post object's content.

Parameters 3 required

Name / Type Description
$content
string

Serialized content.

Required
mixed

(WP_Post | null) $post A post object that the content belongs to. If set to `null`, `get_post()` will be called to use the current post as context. Default: `null`.

Required
callable

$callback A function that will be called for each block to generate the markup for a given list of blocks that are hooked to it. Default: 'insert_hooked_blocks'.

Required

Return Value

(string)
The serialized markup.

Function Information

Since Version
6.8.0
Source File
wp-includes/blocks.php
Advertisement