Created
November 25, 2022 15:14
-
-
Save dsawardekar/676d0d4c5d7f688351e199fdc54484d6 to your computer and use it in GitHub Desktop.
Change Title of Block in Block Catalog Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'block_catalog_block_title', function( $title, $block_name, $block ) { | |
$map = [ | |
"xyz/custom-block" => "My Custom Block", | |
]; | |
if ( ! empty( $map[ $block_name ] ) ) { | |
return $map[ $block_name ]; | |
} | |
return $title; | |
}, 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment