Skip to content

x-wp/wc-data-type-admin

Repository files navigation

WC Data Type Admin

Admin list-page utilities for WooCommerce data types

Packagist Version Packagist PHP Version Static Badge Static Badge

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

  1. List page handling: Register admin pages for custom data types with List_Page_Handler.
  2. WooCommerce-style list tables: Extend List_Table for a familiar WP_List_Table workflow tuned for WooCommerce objects.
  3. Shared mixins: Reusable list-table behaviors via src/Mixins/*.
  4. Legacy compatibility: Wrappers (XWC_Data_List_Page, XWC_Data_List_Table) keep existing consumers working.
  5. 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 resolution
  • src/List_Table.php: base table implementation shared by legacy and new flows
  • src/Mixins/*: shared list-table behaviors
  • src/Core/*: legacy compatibility wrappers
  • templates/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_Handler
  • XWC\Data\Admin\List_Table
  • XWC_Data_List_Page (legacy)
  • XWC_Data_List_Table (legacy)

Additional project information is available in the repository.

About

Admin list-page utilities for WooCommerce data types.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages