Last active
December 15, 2023 16:41
-
-
Save davidallenlewis/2d5d04c41dde95679d8b7665eb2615b3 to your computer and use it in GitHub Desktop.
core/quote Block Variation
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
import { registerBlockVariation } from '@wordpress/blocks'; | |
import { addFilter } from '@wordpress/hooks'; | |
const VARIATION_NAME = 'allswater/custom-quote-test'; | |
registerBlockVariation( 'core/quote', { | |
name: VARIATION_NAME, | |
title: 'Quote Variation', | |
//isActive: [ namespace, authorCredentials ], | |
isActive: ( { namespace, authorCredentials } ) => { | |
return ( | |
namespace === VARIATION_NAME | |
); | |
}, | |
attributes: { | |
namespace: VARIATION_NAME, | |
authorCredentials: { | |
type: 'string' | |
}, | |
}, | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment