PHPackages                             wordpress-gcb/fields - 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. wordpress-gcb/fields

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

wordpress-gcb/fields
====================

Turn a GCB block.fields.json controls schema into a WordPress block attribute schema — the PHP companion to @wordpress-gcb/fields, usable without the GCB plugin.

0.2.0(1mo ago)025↓85.7%GPL-2.0-or-laterPHPPHP &gt;=7.4

Since Jun 5Pushed 1mo agoCompare

[ Source](https://github.com/wordpress-gcb/gcb-fields-php)[ Packagist](https://packagist.org/packages/wordpress-gcb/fields)[ Docs](https://gutenbergcontrolblocks.com)[ RSS](/packages/wordpress-gcb-fields/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

wordpress-gcb/fields (PHP)
==========================

[](#wordpress-gcbfields-php)

Turn a GCB `block.fields.json` controls schema into a WordPress block **attribute** schema, in PHP, with **no dependency on the GCB plugin**. The server-side companion to [`@wordpress-gcb/fields`](https://www.npmjs.com/package/@wordpress-gcb/fields)(npm).

Part of **[GCB](https://gutenbergcontrolblocks.com)** — Gutenberg Control Blocks.

Install
-------

[](#install)

```
composer require wordpress-gcb/fields
```

Usage
-----

[](#usage)

```
use GCBFields\Schema;

$controls = json_decode(
    file_get_contents( __DIR__ . '/blocks/hero/block.fields.json' ),
    true
)['controls'];

register_block_type( __DIR__ . '/blocks/hero', [
    'attributes' => Schema::attributes( $controls ),
] );
```

`Schema::attributes()` returns the `{ type, default }` map WordPress expects — structural controls (group/panel/tools-panel) are skipped, control types map to the right attribute type, and each gets a sensible default (overridable per control via `attributeType` / `default`).

API
---

[](#api)

- `Schema::attributes(array $controls): array` — full controls → attributes map.
- `Schema::attribute_type(string $controlType): string` — one control type → `string|number|boolean|array|object`.
- `Schema::default_value(string $attributeType): mixed` — the empty default for a type.

Links
-----

[](#links)

- **Website:**
- **Source:**
- **npm counterpart:** [`@wordpress-gcb/fields`](https://www.npmjs.com/package/@wordpress-gcb/fields)

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance90

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f9ed331a79729a124e09bdfacdf56b0617a106120027c4fb2731df150ef6dae0?d=identicon)[wordpress-gcb](/maintainers/wordpress-gcb)

---

Top Contributors

[![mark-kojo](https://avatars.githubusercontent.com/u/66767935?v=4)](https://github.com/mark-kojo "mark-kojo (3 commits)")

---

Tags

wordpressfieldsgutenbergblock editorgcb

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wordpress-gcb-fields/health.svg)

```
[![Health](https://phpackages.com/badges/wordpress-gcb-fields/health.svg)](https://phpackages.com/packages/wordpress-gcb-fields)
```

###  Alternatives

[vinkla/extended-acf

Register advanced custom fields with object-oriented PHP

509293.6k18](/packages/vinkla-extended-acf)[log1x/poet

Configuration-based post type, taxonomy, editor color palette, block category, and block registration for Sage 10.

219300.5k1](/packages/log1x-poet)[log1x/acf-editor-palette

A replica Gutenberg color picker field for Advanced Custom Fields.

101308.4k](/packages/log1x-acf-editor-palette)[infinum/eightshift-libs

WordPress libs developed by Eightshift team to use in modern WordPress.

63125.5k3](/packages/infinum-eightshift-libs)[generoi/wp-gutenberg-button-popup

A boilerplate WordPress Gutenberg block

171.7k](/packages/generoi-wp-gutenberg-button-popup)[tiny-pixel/acorn-block-templates

Block templates for Sage 10

191.3k](/packages/tiny-pixel-acorn-block-templates)

PHPackages © 2026

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