Skip to content

Instantly share code, notes, and snippets.

@davidallenlewis
Last active December 15, 2023 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidallenlewis/2d5d04c41dde95679d8b7665eb2615b3 to your computer and use it in GitHub Desktop.
Save davidallenlewis/2d5d04c41dde95679d8b7665eb2615b3 to your computer and use it in GitHub Desktop.
core/quote Block Variation
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