generoi / wp-gutenberg-hidden-blocks
添加一个屏幕特定可见性的区块设置
v0.3.0
2021-04-23 23:43 UTC
Requires
- php: >=7.0.0
Requires (Dev)
- squizlabs/php_codesniffer: ^3.4.2
This package is auto-updated.
Last update: 2024-09-11 16:19:37 UTC
README
添加一个屏幕特定可见性的区块设置
安装
composer require generoi/wp-gutenberg-hidden-blocks
使用方法
import { addFilter } from '@wordpress/hooks' import { mobile, tablet, desktop } from '@wordpress/icons'; addFilter('wp-gutenberg-hidden-blocks.screenSizes', 'theme/screen-sizes', () => { return [ { name: 'mobile', label: 'Mobile', icon: mobile }, { name: 'tablet', label: 'Tablet', icon: tablet }, { name: 'desktop', label: 'Desktop', icon: desktop }, ]; });
开发
安装依赖项
composer install
npm install
运行测试
npm run test
构建资产
# Minified assets which are to be committed to git
npm run build:production
# Watch for changes and re-compile while developing the plugin
npm run start