Skip to content

Instantly share code, notes, and snippets.

View nikolailehbrink's full-sized avatar
👋

Nikolai Lehbrink nikolailehbrink

👋
View GitHub Profile
@nikolailehbrink
nikolailehbrink / functions.php
Created June 6, 2023 14:34
Automated ACF Blocks Registration: This script auto-registers ACF blocks from a specific WordPress directory.
/**
* This function is used to register Advanced Custom Fields (ACF) blocks
* from a specific directory. This can be useful when you have a lot of
* ACF blocks and want to keep your codebase clean and organized.
*
* This script assumes that each ACF block's code resides in its own folder under the
* /template-parts/blocks/ directory relative to where the script is located (__DIR__).
*/
function register_acf_blocks() {