PHPackages                             arraypress/wp-register-bulk-edit-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. arraypress/wp-register-bulk-edit-fields

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

arraypress/wp-register-bulk-edit-fields
=======================================

Lightweight library for registering custom bulk edit fields on WordPress post list tables.

10PHP

Since Feb 1Pushed 3mo agoCompare

[ Source](https://github.com/arraypress/wp-register-bulk-edit-fields)[ Packagist](https://packagist.org/packages/arraypress/wp-register-bulk-edit-fields)[ RSS](/packages/arraypress-wp-register-bulk-edit-fields/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

WP Register Bulk Edit Fields
============================

[](#wp-register-bulk-edit-fields)

A lightweight library for registering custom bulk edit fields on WordPress post list tables.

Features
--------

[](#features)

- Simple API for registering bulk edit fields
- Supports posts and custom post types
- Automatic sanitization based on field type
- Permission checking via capabilities
- Multiple field types: text, textarea, number, select, checkbox, url, email
- Callable options for dynamic select values
- No dependencies

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

[](#installation)

Install via Composer:

```
composer require arraypress/wp-register-bulk-edit-fields
```

Usage
-----

[](#usage)

### Basic Example

[](#basic-example)

```
register_bulk_edit_fields( 'download', [
    'tax_class' => [
        'label'        => __( 'Tax Class', 'my-plugin' ),
        'type'         => 'select',
        'options'      => [
            ''  => __( '— Use Default —', 'my-plugin' ),
            '1' => __( 'Reduced Rate', 'my-plugin' ),
            '2' => __( 'Zero Rate', 'my-plugin' ),
        ],
        'meta_key'     => '_tax_class_id',
        'clear_option' => true,
    ],
    'sale_percent' => [
        'label'    => __( 'Sale Discount %', 'my-plugin' ),
        'type'     => 'number',
        'meta_key' => '_sale_percent',
        'min'      => 0,
        'max'      => 100,
        'step'     => 1,
    ],
]);
```

### Field Configuration Options

[](#field-configuration-options)

OptionTypeDefaultDescription`label`string`''`Field label displayed in the UI`type`string`'text'`Field type (see below)`description`string`''`Help text displayed below the field`options`array|callable`[]`Options for select fields`meta_key`stringField keyThe meta key to save to`min`int|float|null`null`Minimum value for number fields`max`int|float|null`null`Maximum value for number fields`step`int|float|null`null`Step value for number fields`sanitize_callback`callable|null`null`Custom sanitization callback`capability`string`'edit_posts'`Required capability to see/edit field`no_change`bool`true`Show "— No Change —" option`clear_option`bool`false`Show "— Clear —" option for select fields`attrs`array`[]`Additional HTML attributes### Supported Field Types

[](#supported-field-types)

TypeDescriptionAuto-Sanitization`text`Standard text input`sanitize_text_field()``textarea`Multi-line text`sanitize_textarea_field()``number`Numeric input`intval()` or `floatval()` based on step`select`Dropdown selectValidates against options`checkbox`Boolean toggleCast to 0 or 1`url`URL input`esc_url_raw()``email`Email input`sanitize_email()`### Dynamic Options

[](#dynamic-options)

Use a callable to generate options dynamically:

```
register_bulk_edit_fields( 'product', [
    'category' => [
        'label'   => __( 'Category', 'my-plugin' ),
        'type'    => 'select',
        'options' => function() {
            $categories = get_terms( [
                'taxonomy'   => 'product_cat',
                'hide_empty' => false,
            ] );

            $options = [ '' => __( '— Select —', 'my-plugin' ) ];
            foreach ( $categories as $cat ) {
                $options[ $cat->term_id ] = $cat->name;
            }

            return $options;
        },
        'meta_key' => '_product_category',
    ],
]);
```

### Multiple Post Types

[](#multiple-post-types)

```
register_bulk_edit_fields( [ 'post', 'page', 'product' ], [
    'featured' => [
        'label'    => __( 'Featured', 'my-plugin' ),
        'type'     => 'checkbox',
        'meta_key' => '_is_featured',
    ],
]);
```

### Custom Sanitization

[](#custom-sanitization)

```
register_bulk_edit_fields( 'product', [
    'price' => [
        'label'             => __( 'Price', 'my-plugin' ),
        'type'              => 'number',
        'meta_key'          => '_price',
        'step'              => '0.01',
        'sanitize_callback' => function( $value ) {
            return round( floatval( $value ), 2 );
        },
    ],
]);
```

Requirements
------------

[](#requirements)

- PHP 7.4 or later
- WordPress 5.0 or later

License
-------

[](#license)

GPL-2.0-or-later

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance54

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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.

### Community

Maintainers

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

---

Top Contributors

[![arraypress](https://avatars.githubusercontent.com/u/22668877?v=4)](https://github.com/arraypress "arraypress (2 commits)")

### Embed Badge

![Health badge](/badges/arraypress-wp-register-bulk-edit-fields/health.svg)

```
[![Health](https://phpackages.com/badges/arraypress-wp-register-bulk-edit-fields/health.svg)](https://phpackages.com/packages/arraypress-wp-register-bulk-edit-fields)
```

###  Alternatives

[auxiliary/rpage

Highly responsive pagination for Bootstrap.

1091.2k](/packages/auxiliary-rpage)[mdmsoft/yii2-autonumber

Auto number extension for the Yii framework

1830.9k](/packages/mdmsoft-yii2-autonumber)[anime-db/anime-db

The application for making home collection anime

252.1k2](/packages/anime-db-anime-db)

PHPackages © 2026

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