Created
November 14, 2024 11:40
-
-
Save markhowellsmead/7be6869a0ba31ea346ee679727e73919 to your computer and use it in GitHub Desktop.
Example usage of block bindings
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 | |
register_block_bindings_source('my-custom-prefix/current-year', [ | |
'label' => __('Current year', 'my-custom-prefix'), | |
'get_value_callback' => 'my_custom_prefix_current_year', | |
]); | |
function my_custom_prefix_current_year() | |
{ | |
return date('Y'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment