@hamworks/wp-block-filters
v0.0.4
Published
## Installation
Downloads
6
Keywords
Readme
@hamworks/wp-block-filters
Installation
Install the module
npm install @hamworks/wp-block-filters --save
API
createAttributesFilter
React hooks for post meta.
Parameters
- blockName
string
: block name. - newAttributes :
object
attributes to override.
Returns
Function
: Filter function for
Examples
jsx
import { addFilter } from '@wordpress/hooks';
import { createAttributesFilter } from '@hamworks/wp-block-filters';
addFilter(
'blocks.registerBlockType',
'my-plugin/media-text',
createAttributesFilter('core/media-text', {
isStackedOnMobile: {
type: "boolean",
default: true
},
})
);