preseto / block-context
WordPress plugin for showing or hiding Gutenberg blocks depending on context.
Package info
github.com/preseto/block-context
Type:wordpress-plugin
pkg:composer/preseto/block-context
Requires
None
Requires (Dev)
- phpcompatibility/phpcompatibility-wp: ^3.0
- phpstan/phpstan: ^2.2
- phpunit/phpunit: ^9.6
- roots/wordpress: ^7.0
- roots/wordpress-core-installer: ^4.0
- wp-cli/wp-cli-bundle: ^2.12
- wp-coding-standards/wpcs: ^3.3
- wp-phpunit/wp-phpunit: ^7.0
- wpackagist-plugin/query-monitor: ^4.0
- wpackagist-theme/twentytwentyfive: ^1.5
- yoast/phpunit-polyfills: ^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-08-19 15:05:51 UTC
README
A WordPress plugin to show or hide WordPress editor (Gutenberg) blocks in context.
Source of the Gutenberg Block Context plugin for WordPress.
Requirements
- WordPress 5.0+ or the Gutenberg Plugin.
- Composer and Node.js for dependency management.
- Docker for the local development environment.
Install
-
Search for "Block Context" under "Plugins → Add New" in your WordPress dashboard.
-
Install as a Composer dependency:
composer require preseto/block-context
Development
-
Clone the plugin repository.
-
Setup the development environment and tools using Node.js and Composer:
npm install composer install -
Start the local development environment (powered by wp-env):
npm run startwhich will be available at http://localhost:8888 (username:
admin, password:password). WordPress core files are installed as theroots/wordpressComposer dependency underwordpress/. -
Build the plugin assets during development:
npm run devor produce a production build:
npm run build -
Lint and test the changes:
npm run lint npm run test
Screenshots
Credits
Created by Kaspars Dambis.
