x-wp / wc-data-type-admin
Fund package maintenance!
Requires
- php: >=8.0
- x-wp/wc-data-type: ^1|^2
Requires (Dev)
- oblak/wordpress-coding-standard: ^1
- php-stubs/woocommerce-stubs: ^9.0
- php-stubs/wordpress-stubs: ^6.5
- phpstan/extension-installer: ^1.3
- phpstan/phpstan: ^1.10
- phpstan/phpstan-deprecation-rules: ^1.1
- swissspidy/phpstan-no-private: ^0.2.0
- szepeviktor/phpstan-wordpress: ^1.3
- x-wp/di: ^1.0|^2.0
Suggests
- automattic/jetpack-autoloader: Allow for better interoperability with other plugins that use this package.
This package is auto-updated.
Last update: 2026-04-07 08:04:04 UTC
README
WC Data Type Admin
Admin list-page utilities for WooCommerce data types
This library provides admin list-page and list-table utilities for custom WooCommerce data types defined with x-wp/wc-data-type. Define a data type once, then get a consistent admin listing experience with minimal boilerplate.
Key Features
- List page handling: Register admin pages for custom data types with
List_Page_Handler. - WooCommerce-style list tables: Extend
List_Tablefor a familiarWP_List_Tableworkflow tuned for WooCommerce objects. - Shared mixins: Reusable list-table behaviors via
src/Mixins/*. - Legacy compatibility: Wrappers (
XWC_Data_List_Page,XWC_Data_List_Table) keep existing consumers working. - WordPress-native integration: Designed for plugin code already built around WordPress and WooCommerce lifecycles.
Installation
You can install this package via Composer:
composer require x-wp/wc-data-type-admin
Tip
We recommend using automattic/jetpack-autoloader with this package to reduce autoloading conflicts in WordPress environments.
Package Structure
src/List_Page_Handler.php: admin page handler with DI-based table resolutionsrc/List_Table.php: base table implementation shared by legacy and new flowssrc/Mixins/*: shared list-table behaviorssrc/Core/*: legacy compatibility wrapperstemplates/html-admin-page-edsl.php: shared admin page template
Testing
Regression checks:
php tests/regressions.php
Static analysis:
php -d memory_limit=1G vendor/bin/phpstan analyse --debug
Note
The regression script is intentionally lightweight and does not require a full WordPress test bootstrap. PHPStan is configured conservatively for this library; in constrained environments, --debug is the verified non-parallel invocation path.
Documentation
For package-specific usage, start with the public entrypoints:
XWC\Data\Admin\List_Page_HandlerXWC\Data\Admin\List_TableXWC_Data_List_Page(legacy)XWC_Data_List_Table(legacy)
Additional project information is available in the repository.