Created
December 29, 2022 14:43
-
-
Save elpuas/ddc57876d706927dc3c9133606ab5598 to your computer and use it in GitHub Desktop.
Flip Cards Variations
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
const FLIP_CARDS = 'loop-patterns/flip-cards'; | |
wp.domReady( function() { | |
wp.blocks.registerBlockVariation( 'core/query', { | |
name: FLIP_CARDS, | |
title: 'Flip Cards', | |
description: 'Flip Cards Query', | |
isActive: ( { namespace, query } ) => { | |
return ( | |
namespace === FLIP_CARDS | |
&& query.postType === 'post' | |
); | |
}, | |
icon: 'format-gallery', | |
attributes: { | |
namespace: FLIP_CARDS, | |
className: 'lp-flip-cards', | |
tagName:'section', | |
query: { | |
perPage: 3, | |
pages: 0, | |
offset: 0, | |
postType: 'post', | |
order: 'desc', | |
orderBy: 'date', | |
author: '', | |
search: '', | |
exclude: [], | |
sticky: '', | |
inherit: false, | |
}, | |
}, | |
scope: [ 'inserter' ], | |
innerBlocks: [], | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment