Description
OnceBlock is a comprehensive solution for managing reusable block content in WordPress. This plugin allows you to create, organize, and deploy block presets across your website with ease.
Key Features
- Native WordPress: Works with pure WordPress – no external dependencies required
- Custom Post Type: Dedicated “Block Presets” post type for managing reusable content
- Gutenberg Ready: Full integration with the native WordPress block editor
- Usage Tracking: Monitor which presets are used where and how often
- REST API: Full REST API support for headless implementations
- Shortcode Support: Easy insertion via shortcodes
[bpmgr_block id="123"] - Statistics Dashboard: Comprehensive usage analytics and reporting
- Taxonomies: Organize presets with categories and tags
- ACF Integration (Optional): Automatic registration of ACF blocks from theme folders if ACF Pro is installed
- Developer Friendly: Extensive hooks and filters for customization
Perfect For
- Agencies managing multiple client sites
- Developers building custom themes with reusable components
- Content managers who need consistent design elements
- Sites with complex layouts that need to be replicated
- Teams collaborating on content creation
Usage Examples
In PHP templates: bpmgr_render_block_preset(123);
In content: [bpmgr_block id="123"]
REST API: GET /wp-json/bpmgr/v1/block-presets, GET /wp-json/bpmgr/v1/block-presets/123, GET /wp-json/bpmgr/v1/block-presets/123/render
ACF Integration
The plugin automatically scans specified theme folders for ACF blocks and registers them in the Gutenberg editor. Default folders include:
general/acf-blocks/public/acf-blocks/login-register/acf-blocks/members/acf-blocks/
You can customize these folders in the plugin settings.
Developer Information
Hooks and Filters
The plugin provides numerous hooks for customization:
Filters:
– bpmgr_block_preset_content – Filter block preset output
REST API Endpoints
GET /wp-json/bpmgr/v1/block-presets– List all presetsGET /wp-json/bpmgr/v1/block-presets/{id}– Get specific presetGET /wp-json/bpmgr/v1/block-presets/{id}/render– Get rendered preset
File Structure
onceblock/
├── onceblock.php
├── uninstall.php
├── readme.txt
├── LICENSE
├── languages/
│ └── index.php
├── assets/
│ └── js/
│ └── block-preset.js
├── includes/
│ ├── class-bpmgr-post-types.php
│ ├── class-bpmgr-acf-blocks.php
│ ├── class-bpmgr-gutenberg-blocks.php
│ ├── class-bpmgr-helper-functions.php
│ └── class-bpmgr-admin.php
└── admin/
├── settings-page.php
├── tools-page.php
├── statistics-page.php
├── css/
│ └── admin.css
└── js/
├── admin.js
└── statistics-chart.js
For more information and documentation, visit: https://neodavet.github.io/davetportfolio/
Screenshots




Blocks
This plugin provides 1 block.
- Block Preset
Installation
- Upload the plugin files to
/wp-content/plugins/onceblock/ - Activate the plugin through the ‘Plugins’ screen in WordPress
- Navigate to Settings > Blocks Presets to configure the plugin
- Start creating block presets under the new “Block Presets” menu
FAQ
-
Does this plugin require ACF?
-
No! This plugin works with pure WordPress and has no external dependencies. ACF integration is completely optional and can be enabled in settings if you have Advanced Custom Fields Pro installed.
-
Is this compatible with my theme?
-
The plugin is designed to work with any WordPress theme. It doesn’t modify your theme files but provides hooks and filters for integration.
-
Can I use this with page builders?
-
Yes, block presets work within the Gutenberg editor and are compatible with most page builders that support WordPress blocks.
-
How do I customize the block folders?
-
Go to Settings > Blocks Presets and modify the “ACF Block Folders” setting to specify which theme folders should be scanned for ACF blocks.
Reviews
There are no reviews for this plugin.
Contributors & Developers
“OnceBlock – Build Once, Insert Anywhere” is open source software. The following people have contributed to this plugin.
ContributorsTranslate “OnceBlock – Build Once, Insert Anywhere” into your language.
Interested in development?
Browse the code, check out the SVN repository, or subscribe to the development log by RSS.
Changelog
1.0.7
- Changed: the Plugin URI now points to the renamed GitHub repository (neodavet/onceblock)
- Added: automatic deployment from GitHub to WordPress.org
1.0.6
- Changed: the plugin is now named OnceBlock – Build Once, Insert Anywhere (slug
onceblock) - Removed: the unprefixed legacy
blockpost type, the[block_preset]shortcode,do_cpt_block(), the “Enable Legacy Post Type” setting and the migration tool - Fix: the REST API routes and PHP helpers only ever return published block presets
- Fix: the Statistics chart script is now enqueued instead of printed inline
- Security: rendered preset content is passed through
wp_kses_post()in the block render callback
1.0.5
- Removed “Tested up to” from the plugin header; it is now declared only in readme.txt, as WordPress.org requires
1.0.4
- Changed: the plugin author is now listed as David Tavares Cuevas
- Changed: the Plugin URI now points to the GitHub repository
1.0.3
- Changed: block preset pages now use the URL base
/block-preset/(previously/bpmgr_block_preset/); the old URL redirects to the new one - Fix: single preset pages returned a 404 after activation because rewrite rules were flushed before the post types were registered
- Fix: the admin script failed to initialize (
$ is not defined), which broke the new Duplicate action and other admin script features
1.0.2
- Renamed the plugin to Block Presets Manager (slug
block-presets-manager) and changed the internal code prefix tobpmgr - Fix: resolved a fatal error on the Tools page caused by a duplicated function and form handler
- Removed the manual
load_plugin_textdomain()call (translations are loaded automatically by WordPress.org) - Updated “Tested up to” to WordPress 7.1
- New: “Duplicate” row action in the Block Presets list (creates a draft copy including categories, tags and custom fields)
- New: secure AJAX handlers for duplicating and previewing presets (nonce and capability checks)
- Code quality: cleared all remaining Plugin Check warnings (documented direct queries on the plugin’s own table, unused callback parameters, JSON output encoding)
1.0.1
- Security: REST API endpoint for a single block preset no longer exposes draft/private/trashed presets to unauthenticated requests
- Security: removed a duplicate, conflicting registration of the plugin settings that had silently dropped path-safety validation on the ACF block folders setting
- Fix: resolved a fatal error that occurred whenever
bpmgr_render_block_preset(),do_cpt_block(), or related helper functions were called from a theme - Fix: resolved a fatal error on
plugins_loadedcaused by a missing text domain loader - Fix: resolved a fatal error on activation caused by
register_activation_hook()/register_deactivation_hook()being registered too late; plugin settings and the usage-tracking table are now correctly created on activation - Fix: the
[bpmgr_block]and[block_preset]shortcodes now actually register and render (they previously never worked) - Fix: the Tools page “Export Block Presets” action now produces a valid downloadable JSON file instead of a broken response
- i18n: the block editor script’s translatable strings are now loaded via
wp_set_script_translations(), so they can actually be translated - i18n: added missing localized strings for the admin JS, and switched a count-based message to use proper singular/plural forms
- Hardened nonce verification, redirects, and JSON output across the admin screens
- Updated “Tested up to” to WordPress 7.0
- Full WordPress Coding Standards (WPCS) compliance pass
- Removed unused legacy admin code superseded by the current settings screen
1.0.0
- Initial release
- Custom post type for block presets
- ACF blocks auto-registration
- Usage tracking and statistics
- REST API endpoints
- Migration tools
- Shortcode support
- Legacy function compatibility
- Admin interface with tools and statistics
- Comprehensive uninstall cleanup
