Block Visibility allows you to dynamically control which blocks are visible on your WordPress website and who can see them, which includes the ability to schedule blocks.
This example add-on plugin for Block Visibility illustrates how to extend core functionality with additional visibility controls. The plugin adds an "Example Control" that allows you to toggle the visibility of any block. Use this example as the foundation for your own more sophisticated visibility controls.
For a detailed walkthrough on how to extend Block Visibility and how this plugin was built, refer to the following resources.
- How to add custom controls to Block Visibility (Coming Soon)
- Filter & Slot Reference
- Make sure you are running the latest version of Block Visibility, WordPress, and you are using the Block Editor
- Download and activate the Block Visibility – Add-on Example plugin from GitHub.
- Set up a local WordPress environment.
- In the
wp-content/plugins
folder, clone the GitHub repository:https://github.com/ndiego/block-visibility-add-on-example.git
- Navigate to the
wp-content/plugins/block-visibility-add-on-example
folder in the command line. - Run the
npm install
command to install the plugin's dependencies within a/node_modules/
folder. - Run the
npm run start
command to compile and watch source files for changes while developing.