Created
May 16, 2025 00:42
-
-
Save davidallenlewis/72ed44b8e3b50410bd1388ce018ffe7d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 webinar date type variation | |
* | |
* @param array $variations Array of block type variation | |
* @param WP_Block $block_type The block type. | |
* @return array | |
*/ | |
function webinar_date_block_variation( $variations, $block_type ) { | |
if ( 'core/paragraph' === $block_type->name ) { | |
$variations[] = array( | |
'name' => 'webinar-date', | |
'title' => 'Webinar Date', | |
'attributes' => array( | |
'metadata' => array( | |
'bindings' => array( | |
'content' => array( | |
'source' => 'acf/field', | |
'args' => array( | |
'key' => 'webinar_date', | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
return $variations; | |
} | |
add_filter( 'get_block_type_variations', 'webinar_date_block_variation', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment