PHPackages                             wrd/wp-blocks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wrd/wp-blocks

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wrd/wp-blocks
=============

Simplifies the process for WordPress themes to create and write ACF Pro Blocks.

1.3.7(2mo ago)252MITPHPPHP ^8.1

Since Oct 6Pushed 2mo agoCompare

[ Source](https://github.com/WRD-Agency/wp-blocks)[ Packagist](https://packagist.org/packages/wrd/wp-blocks)[ RSS](/packages/wrd-wp-blocks/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

wrd\\wp-blocks
==============

[](#wrdwp-blocks)

Automatically creates blocks from the theme's blocks directory.

---

Usage
-----

[](#usage)

Use `register_all_theme_blocks` to register all blocks in the the themes' block directory. This defaults to `blocks/`.

You can use the `wrd\wp-blocks\get_theme_blocks_dir` filter to change the location of the theme's blocks dir.

---

Commands
--------

[](#commands)

You can use the following command to quickly generate a block, with optional ACF, CSS and JS files.

```
./vendor/bin/blocks --help

```

---

Registration
------------

[](#registration)

**`register_all_theme_blocks`**

Registers all blocks in the theme's block directory.

**`register_theme_block`**

Registers an individual block. Blocks are defined as a directory with a block.json file. Will also import an Advanced Custom Fields JSON file with the name *acf.json* if it exists.

**`register_block_category`**

Register a new block category.

**`set_include_theme_block_styles_before_render`**

Force WordPress to include block styles individually, with the block when it is rendered.

**`set_allowed_block_types`**

Whitelists the allowed blocks. Optionally whitelists a post type which is given a higher precedence.

**`set_use_block_editor`**

Enables or disables the block editor. Optionally takes a post type which is given a higher precedence.

**`set_use_inner_blocks_wrapper`**

Enable to disable the wrapper around inner blocks. Only works on the front-end.

**`set_use_core_styles`**

Used to dequeue the core block styles &amp; global styles.

---

Templating Functions
--------------------

[](#templating-functions)

**`block_atts`**

Output the block's attributes. You can pass attributes of your own to be merged in.

**`block_is_editor`**

Checks if the block is currently being rendered for preview in the block editor.

**`block_has_style`**

Check if the block has a style selected.

**`get_block_directory`**

Get the absolute filepath for the block's directory, with an optional append.

**`get_block_directory_uri`**

Get the URL for the block's directory, with an optional append.

**`get_prose_blocks`**

Prose blocks are a set of blocks that are typically allowed as text content.

**`the_inner_blocks`**

Display a slot for the user to add child blocks.

**`the_bg_image`**

Display a style attribute for a background image.

**`the_link`**

Easily display an ACF link field.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance83

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~45 days

Total

4

Last Release

87d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32ef50777a788e63fcc43cbdb552375205c6c7d50d6ec9b3a23079c0d9a993a1?d=identicon)[kyletcooper](/maintainers/kyletcooper)

---

Top Contributors

[![wrd-sodapixel](https://avatars.githubusercontent.com/u/161863489?v=4)](https://github.com/wrd-sodapixel "wrd-sodapixel (33 commits)")

---

Tags

packagewordpress

### Embed Badge

![Health badge](/badges/wrd-wp-blocks/health.svg)

```
[![Health](https://phpackages.com/badges/wrd-wp-blocks/health.svg)](https://phpackages.com/packages/wrd-wp-blocks)
```

###  Alternatives

[ocramius/proxy-manager

A library providing utilities to generate, instantiate and generally operate with Object Proxies

5.0k82.4M230](/packages/ocramius-proxy-manager)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[ocramius/package-versions

Provides efficient querying for installed package versions (no runtime IO)

3.2k74.3M117](/packages/ocramius-package-versions)[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M63](/packages/jean85-pretty-package-versions)[icanhazstring/composer-unused

Show unused packages by scanning your code

1.7k7.0M188](/packages/icanhazstring-composer-unused)[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k74.6k86](/packages/pocketmine-pocketmine-mp)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
