author | ymh <ymh.work@gmail.com> |
Mon, 08 Sep 2025 19:44:41 +0200 | |
changeset 23 | 417f20492bf7 |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
9 | 1 |
<?php |
2 |
/** |
|
3 |
* Server-side rendering of the `core/shortcode` block. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
*/ |
|
7 |
||
8 |
/** |
|
9 |
* Performs wpautop() on the shortcode block content. |
|
10 |
* |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
16
diff
changeset
|
11 |
* @since 5.0.0 |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
16
diff
changeset
|
12 |
* |
9 | 13 |
* @param array $attributes The block attributes. |
14 |
* @param string $content The block content. |
|
15 |
* |
|
16 |
* @return string Returns the block content. |
|
17 |
*/ |
|
18 |
function render_block_core_shortcode( $attributes, $content ) { |
|
19 |
return wpautop( $content ); |
|
20 |
} |
|
21 |
||
22 |
/** |
|
23 |
* Registers the `core/shortcode` block on server. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
16
diff
changeset
|
24 |
* |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
16
diff
changeset
|
25 |
* @since 5.0.0 |
9 | 26 |
*/ |
27 |
function register_block_core_shortcode() { |
|
16 | 28 |
register_block_type_from_metadata( |
29 |
__DIR__ . '/shortcode', |
|
9 | 30 |
array( |
31 |
'render_callback' => 'render_block_core_shortcode', |
|
32 |
) |
|
33 |
); |
|
34 |
} |
|
35 |
add_action( 'init', 'register_block_core_shortcode' ); |