diff options
Diffstat (limited to 'plugins/jetpack/wp-cli-templates/block-register-php.mustache')
-rw-r--r-- | plugins/jetpack/wp-cli-templates/block-register-php.mustache | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/jetpack/wp-cli-templates/block-register-php.mustache b/plugins/jetpack/wp-cli-templates/block-register-php.mustache new file mode 100644 index 00000000..02cbf7da --- /dev/null +++ b/plugins/jetpack/wp-cli-templates/block-register-php.mustache @@ -0,0 +1,26 @@ +<?php +/** + * {{ title }} Block. + * + * @since 7.x + * + * @package Jetpack + */ + +jetpack_register_block( + 'jetpack/{{ slug }}', + array( 'render_callback' => 'jetpack_{{ underscoredSlug }}_block_load_assets' ) +); + +/** + * {{ title }} block registration/dependency declaration. + * + * @param array $attr Array containing the {{ title }} block attributes. + * @param string $content String containing the {{ title }} block content. + * + * @return string + */ +function jetpack_{{ underscoredSlug }}_block_load_assets( $attr, $content ) { + Jetpack_Gutenberg::load_assets_as_required( '{{ slug }}' ); + return $content; +} |