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

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

fieldify/fields
===============

WordPress custom fields library.

0.0.1(2y ago)322[22 issues](https://github.com/fieldifywp/fields/issues)GPL-2.0-or-laterPHP

Since Jan 31Pushed 1y ago1 watchersCompare

[ Source](https://github.com/fieldifywp/fields)[ Packagist](https://packagist.org/packages/fieldify/fields)[ RSS](/packages/fieldify-fields/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Fieldify
========

[](#fieldify)

[Documentation](https://fieldifywp.github.io/)

Composer package for creating react-powered fields, blocks and settings in the WordPress editor with only PHP.

Installation
------------

[](#installation)

From your theme or plugin directory:

```
composer require fieldify/fields
```

Currently, this package is not available on Packagist. To install from GitHub, add the following to your composer.json file:

```
{
	"require": {
		"fieldify/fields": "dev-main"
	},
	"repositories": [
		{
			"type": "git",
			"url": "git@github.com:fieldifywp/fields.git"
		},
		{
			"type": "git",
			"url": "git@github.com:blockifywp/utilities.git"
		}
	]
}
```

Configuration
-------------

[](#configuration)

To enable the Fieldify package, add the following to your theme or plugin:

```
// Require the Composer autoloader.
require_once __DIR__ . '/vendor/autoload.php';

// Configure main plugin file or theme functions.php.
Fieldify::register( __FILE__ );
```

Usage
-----

[](#usage)

### Blocks

[](#blocks)

Block registration matches WordPress core block registration with the addition of a 'panels' argument for grouping controls in the block sidebar. Attributes must specify the 'panel' key to be grouped.

Block names must include a namespace and be in kebab-case in the following format: `namespace/my-block`.

```
register_custom_block( 'namespace/my-block', [
	'title'           => __( 'My Block', 'text-domain' ),
	'description'     => __( 'My custom block', 'text-domain' ),
	'category'        => 'custom',
	// Uncomment to use dashicons.
	// 'icon'		  => 'admin-site',
	'icon'            => [
		'src' => get_icon( 'wordpress', 'star-filled' ),
	],
	'keywords'        => [ 'my', 'block' ],
	'render_callback' => static function ( array $attributes, string $content ): string {
		return '' . ( $attributes['content'] ?? 'no content' ) . '';
	},
	'style'           => plugin_dir_url( __FILE__ ) . '/assets/my-block.css',
	'supports'        => [
		'color'   => [
			'text'       => true,
			'background' => false,
		],
		'spacing' => [
			'blockGap' => true,
			'margin'   => true,
		],
	],
	'panels'          => [
		'conditional' => [
			'title' => 'Conditional',
		],
		'text'        => [
			'title' => 'Text',
		],
		'number'      => [
			'title' => 'Number',
		],
		'media'       => [
			'title' => 'Media',
		],
		'ui'          => [
			'title' => 'UI',
		],
		'custom'      => [
			'title' => 'Custom',
		],
	],
	// Uncomment to use inner blocks.
	//'template'      => [],
	//'template_lock' => false,
	'attributes'      => [
		'verticalAlign'      => [
			'type'    => 'string',
			'toolbar' => 'BlockVerticalAlignmentToolbar',
		],
		'horizontalAlign'    => [
			'type'    => 'string',
			'toolbar' => 'BlockAlignmentToolbar',
		],
		'hideContentSetting' => [
			'type'    => 'boolean',
			'label'   => 'Hide content setting',
			'control' => 'toggle',
			'default' => false,
			'panel'   => 'conditional',
		],
		'content'            => [
			'type'    => 'string',
			'control' => 'text',
			'default' => 'My block content',
			'panel'   => 'conditional',
			'show_if' => [
				[
					'attribute' => 'hideContentSetting',
					'operator'  => '!==',
					'value'     => true,
				],
			],
		],
		'checkbox'           => [
			'type'    => 'boolean',
			'label'   => __( 'Checkbox', 'text-domain' ),
			'control' => 'checkbox',
			'panel'   => 'ui',
		],
		'number'             => [
			'type'    => 'number',
			'label'   => __( 'Number', 'text-domain' ),
			'control' => 'number',
			'panel'   => 'number',
		],
		'unit'               => [
			'type'    => 'string',
			'label'   => __( 'Unit', 'text-domain' ),
			'control' => 'unit',
			'panel'   => 'number',
		],
		'range'              => [
			'type'    => 'number',
			'label'   => __( 'Range', 'text-domain' ),
			'control' => 'range',
			'min'     => 0,
			'max'     => 100,
			'step'    => 1,
			'panel'   => 'number',
		],
		'dropdown'           => [
			'type'    => 'string',
			'label'   => __( 'Dropdown', 'text-domain' ),
			'control' => 'select',
			'options' => [
				[
					'value' => 'option1',
					'label' => 'Option 1',
				],
				[
					'value' => 'option2',
					'label' => 'Option 2',
				],
				[
					'value' => 'option3',
					'label' => 'Option 3',
				],
			],
			'panel'   => 'ui',
		],
		'paragraphContent'   => [
			'type'    => 'string',
			'label'   => __( 'Paragraph content', 'text-domain' ),
			'control' => 'textarea',
			'panel'   => 'text',
		],
		'hiddenField'        => [
			'type'    => 'string',
			'label'   => __( 'Hidden field', 'text-domain' ),
			'control' => 'hidden',
			'panel'   => 'text',
		],
		'image'              => [
			'type'    => 'string',
			'label'   => __( 'Image picker', 'text-domain' ),
			'control' => 'image',
			'panel'   => 'media',
		],
		'youtubeUrl'         => [
			'type'    => 'string',
			'label'   => __( 'YouTube URL', 'text-domain' ),
			'control' => 'embed',
			'panel'   => 'media',
		],
		'galleryImages'      => [
			'type'    => 'array',
			'label'   => __( 'Gallery images', 'text-domain' ),
			'control' => 'gallery',
			'panel'   => 'media',
		],
		'iconPicker'         => [
			'type'    => 'object',
			'label'   => __( 'Select Icon', 'text-domain' ),
			'control' => 'icon',
			'panel'   => 'custom',
		],
		'colorOrGradient'    => [
			'type'    => 'string',
			'label'   => __( 'Color or Gradient', 'text-domain' ),
			'control' => 'color',
			'panel'   => 'ui',
		],
		'repeater'           => [
			'type'      => 'array',
			'label'     => __( 'Repeater', 'text-domain' ),
			'control'   => 'repeater',
			'panel'     => 'custom',
			'subfields' => [
				'item' => [
					'type'    => 'string',
					'label'   => __( 'Item', 'text-domain' ),
					'control' => 'text',
				],
			],
		],
	],
] );
```

*Attributes*

Block attributes are defined as an associative array with the attribute name as the key and an array of options as the value.

### Meta Boxes

[](#meta-boxes)

```
register_custom_meta_box( 'my-meta-box', [
	'title'      => 'My Meta Box',
	'post_types' => [ 'post' ],
	'context'    => 'side',
	'priority'   => 'default',
	'fields'     => [
		'hideContentSetting' => [
			'default' => false,
			'control' => 'toggle',
		],
		'content' => [
			'label'   => 'Content',
			'control' => 'text',
			'default' => 'My meta box content',
			'show_if' => [
				[
					'field'    => 'hideContentSetting',
					'operator' => '!==',
					'value'    => true,
				],
			],
		],
	],
] );
```

*Fields*

Meta box fields are defined as an associative array with the field name as the key and an array of options as the value.

### Settings

[](#settings)

```
register_custom_settings('my-settings', [
	'title' => 'My Settings',
	'fields' => [
		'content' => [
			'type' => 'string',
			'default' => 'My settings content',
		],
	],
]);
```

### Supported Controls

[](#supported-controls)

#### Core controls

[](#core-controls)

Most WordPress core control component types are supported. Available props can be found for each component in the WordPress block editor reference guide:

- text
- toggle
- checkbox
- number
- unit
- range
- textarea
- select - (with additional support for [React Select](https://react-select.com/home) props, e.g. `creatable`, `searchable`, `multiple`, etc.)

#### Custom controls

[](#custom-controls)

- image
- embed
- gallery
- icon
- color
- repeater
    - subfields: *array*
    - sortable: *boolean*
    - direction: *string* (row|column)

### Utility functions

[](#utility-functions)

- **register\_block**: *string $id, array $args*
    - Registers a block with the given id and options.
- **register\_meta\_box**: *string $id, array $args*
    - Registers a meta box with the given id and options.
- **register\_settings**: *string $id, array $args*
    - Registers a settings panel with the given id and options.
- **get\_icon**: *string $set, string $name, $size = null*
    - Returns svg icon markup.
- **block\_is\_rendering\_preview**
    - Used in block render callback to determine if block is being rendered in the editor preview.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity31

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

838d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cd6eb8aff0903d87eb674d1ba3c5f3653899c0d7661504eb0deb7798ed86b643?d=identicon)[arraypress](/maintainers/arraypress)

![](https://www.gravatar.com/avatar/baa8d5e8f35d37d8cbce60c8604aede77a961b13311acfbad9a227ccf00e99dc?d=identicon)[blockify](/maintainers/blockify)

---

Top Contributors

[![seothemes](https://avatars.githubusercontent.com/u/24793388?v=4)](https://github.com/seothemes "seothemes (94 commits)")

---

Tags

composer-packagecustom-fieldsphpwordpress

### Embed Badge

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

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

###  Alternatives

[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4561.2M5](/packages/athari-yalinqo)[malukenho/mcbumpface

Bumping into packages

116714.7k24](/packages/malukenho-mcbumpface)[inovector/mixpostapp

Standalone application with the Laravel Package of Mixpost Lite pre-installed and configured

1232.9k](/packages/inovector-mixpostapp)[joserick/laravel-livewire-discover

Discover and autoload multiples components of livewire by convention (componentNamespace)

2736.6k2](/packages/joserick-laravel-livewire-discover)[neysi/directprint

Easy and direct file print from PHP

218.3k](/packages/neysi-directprint)

PHPackages © 2026

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