{"id":36356030,"url":"https://github.com/arraypress/wp-register-bulk-edit","last_synced_at":"2026-01-14T00:49:38.352Z","repository":{"id":331865127,"uuid":"1116954249","full_name":"arraypress/wp-register-bulk-edit","owner":"arraypress","description":"A lightweight library for registering custom bulk edit fields on WordPress post list tables.","archived":false,"fork":false,"pushed_at":"2025-12-15T16:07:53.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T16:24:57.431Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arraypress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-15T16:07:10.000Z","updated_at":"2025-12-15T16:59:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/arraypress/wp-register-bulk-edit","commit_stats":null,"previous_names":["arraypress/wp-register-bulk-edit"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/arraypress/wp-register-bulk-edit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-bulk-edit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-bulk-edit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-bulk-edit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-bulk-edit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/wp-register-bulk-edit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fwp-register-bulk-edit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28407001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T00:40:43.272Z","status":"ssl_error","status_checked_at":"2026-01-14T00:40:42.636Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-11T13:42:08.726Z","updated_at":"2026-01-14T00:49:38.341Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","readme":"# WP Register Bulk Edit\n\nA lightweight library for registering custom bulk edit fields on WordPress post list tables.\n\n## Features\n\n- Simple API for registering bulk edit fields\n- Supports posts and custom post types\n- Automatic sanitization based on field type\n- Permission checking via capabilities\n- Multiple field types: text, textarea, number, select, checkbox, url, email\n- Callable options for dynamic select values\n- No dependencies\n\n## Installation\n\nInstall via Composer:\n\n```bash\ncomposer require arraypress/wp-register-bulk-edit\n```\n\n## Usage\n\n### Basic Example\n\n```php\nregister_bulk_edit_fields( 'download', [\n    'tax_class' =\u003e [\n        'label'        =\u003e __( 'Tax Class', 'my-plugin' ),\n        'type'         =\u003e 'select',\n        'options'      =\u003e [\n            ''  =\u003e __( '— Use Default —', 'my-plugin' ),\n            '1' =\u003e __( 'Reduced Rate', 'my-plugin' ),\n            '2' =\u003e __( 'Zero Rate', 'my-plugin' ),\n        ],\n        'meta_key'     =\u003e '_tax_class_id',\n        'clear_option' =\u003e true,\n    ],\n    'sale_percent' =\u003e [\n        'label'    =\u003e __( 'Sale Discount %', 'my-plugin' ),\n        'type'     =\u003e 'number',\n        'meta_key' =\u003e '_sale_percent',\n        'min'      =\u003e 0,\n        'max'      =\u003e 100,\n        'step'     =\u003e 1,\n    ],\n]);\n```\n\n### Field Configuration Options\n\n| Option              | Type             | Default        | Description                               |\n|---------------------|------------------|----------------|-------------------------------------------|\n| `label`             | string           | `''`           | Field label displayed in the UI           |\n| `type`              | string           | `'text'`       | Field type (see below)                    |\n| `description`       | string           | `''`           | Help text displayed below the field       |\n| `options`           | array\\|callable  | `[]`           | Options for select fields                 |\n| `meta_key`          | string           | Field key      | The meta key to save to                   |\n| `min`               | int\\|float\\|null | `null`         | Minimum value for number fields           |\n| `max`               | int\\|float\\|null | `null`         | Maximum value for number fields           |\n| `step`              | int\\|float\\|null | `null`         | Step value for number fields              |\n| `sanitize_callback` | callable\\|null   | `null`         | Custom sanitization callback              |\n| `capability`        | string           | `'edit_posts'` | Required capability to see/edit field     |\n| `no_change`         | bool             | `true`         | Show \"— No Change —\" option               |\n| `clear_option`      | bool             | `false`        | Show \"— Clear —\" option for select fields |\n| `attrs`             | array            | `[]`           | Additional HTML attributes                |\n\n### Supported Field Types\n\n| Type       | Description         | Auto-Sanitization                        |\n|------------|---------------------|------------------------------------------|\n| `text`     | Standard text input | `sanitize_text_field()`                  |\n| `textarea` | Multi-line text     | `sanitize_textarea_field()`              |\n| `number`   | Numeric input       | `intval()` or `floatval()` based on step |\n| `select`   | Dropdown select     | Validates against options                |\n| `checkbox` | Boolean toggle      | Cast to 0 or 1                           |\n| `url`      | URL input           | `esc_url_raw()`                          |\n| `email`    | Email input         | `sanitize_email()`                       |\n\n### Dynamic Options\n\nUse a callable to generate options dynamically:\n\n```php\nregister_bulk_edit_fields( 'product', [\n    'category' =\u003e [\n        'label'   =\u003e __( 'Category', 'my-plugin' ),\n        'type'    =\u003e 'select',\n        'options' =\u003e function() {\n            $categories = get_terms( [\n                'taxonomy'   =\u003e 'product_cat',\n                'hide_empty' =\u003e false,\n            ] );\n            \n            $options = [ '' =\u003e __( '— Select —', 'my-plugin' ) ];\n            foreach ( $categories as $cat ) {\n                $options[ $cat-\u003eterm_id ] = $cat-\u003ename;\n            }\n            \n            return $options;\n        },\n        'meta_key' =\u003e '_product_category',\n    ],\n]);\n```\n\n### Multiple Post Types\n\n```php\nregister_bulk_edit_fields( [ 'post', 'page', 'product' ], [\n    'featured' =\u003e [\n        'label'    =\u003e __( 'Featured', 'my-plugin' ),\n        'type'     =\u003e 'checkbox',\n        'meta_key' =\u003e '_is_featured',\n    ],\n]);\n```\n\n### Custom Sanitization\n\n```php\nregister_bulk_edit_fields( 'product', [\n    'price' =\u003e [\n        'label'             =\u003e __( 'Price', 'my-plugin' ),\n        'type'              =\u003e 'number',\n        'meta_key'          =\u003e '_price',\n        'step'              =\u003e '0.01',\n        'sanitize_callback' =\u003e function( $value ) {\n            return round( floatval( $value ), 2 );\n        },\n    ],\n]);\n```\n\n## Requirements\n\n- PHP 7.4 or later\n- WordPress 5.0 or later\n\n## License\n\nGPL-2.0-or-later\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fwp-register-bulk-edit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Fwp-register-bulk-edit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fwp-register-bulk-edit/lists"}