@@ -19,11 +19,11 @@ _Example_:
1919``` php
2020<?php
2121
22- function filter_metadata_registration ( $metadata ) {
22+ function wpdocs_filter_metadata_registration ( $metadata ) {
2323 $metadata['apiVersion'] = 1;
2424 return $metadata;
2525};
26- add_filter( 'block_type_metadata', 'filter_metadata_registration ' );
26+ add_filter( 'block_type_metadata', 'wpdocs_filter_metadata_registration ' );
2727
2828register_block_type( __DIR__ );
2929```
@@ -40,11 +40,11 @@ The filter takes two params:
4040_ Example:_
4141
4242``` php
43- function filter_metadata_registration ( $settings, $metadata ) {
43+ function wpdocs_filter_metadata_registration ( $settings, $metadata ) {
4444 $settings['api_version'] = $metadata['apiVersion'] + 1;
4545 return $settings;
4646};
47- add_filter( 'block_type_metadata_settings', 'filter_metadata_registration ', 10, 2 );
47+ add_filter( 'block_type_metadata_settings', 'wpdocs_filter_metadata_registration ', 10, 2 );
4848
4949register_block_type( __DIR__ );
5050```
@@ -352,14 +352,14 @@ On the server, you can filter the list of blocks shown in the inserter using the
352352<?php
353353// my-plugin.php
354354
355- function filter_allowed_block_types_when_post_provided ( $allowed_block_types, $editor_context ) {
355+ function wpdocs_filter_allowed_block_types_when_post_provided ( $allowed_block_types, $editor_context ) {
356356 if ( ! empty( $editor_context->post ) ) {
357357 return array( 'core/paragraph', 'core/heading' );
358358 }
359359 return $allowed_block_types;
360360}
361361
362- add_filter( 'allowed_block_types_all', 'filter_allowed_block_types_when_post_provided ', 10, 2 );
362+ add_filter( 'allowed_block_types_all', 'wpdocs_filter_allowed_block_types_when_post_provided ', 10, 2 );
363363```
364364
365365## Managing block categories
@@ -374,7 +374,7 @@ It is possible to filter the list of default block categories using the `block_c
374374<?php
375375// my-plugin.php
376376
377- function filter_block_categories_when_post_provided ( $block_categories, $editor_context ) {
377+ function wpdocs_filter_block_categories_when_post_provided ( $block_categories, $editor_context ) {
378378 if ( ! empty( $editor_context->post ) ) {
379379 array_push(
380380 $block_categories,
@@ -388,7 +388,7 @@ function filter_block_categories_when_post_provided( $block_categories, $editor_
388388 return $block_categories;
389389}
390390
391- add_filter( 'block_categories_all', 'filter_block_categories_when_post_provided ', 10, 2 );
391+ add_filter( 'block_categories_all', 'wpdocs_filter_block_categories_when_post_provided ', 10, 2 );
392392```
393393
394394### ` wp.blocks.updateCategory `
0 commit comments