arraypress/edd-register-columns
Composer 安装命令:
composer require arraypress/edd-register-columns
包简介
Lightweight library for registering custom columns in Easy Digital Downloads tables.
关键字:
README 文档
README
A lightweight library for adding custom columns to Easy Digital Downloads admin tables.
Installation
composer require arraypress/edd-register-columns
Requirements
- PHP 7.4+
- WordPress 5.0+
- Easy Digital Downloads 3.0+
Quick Start
Downloads
edd_register_download_columns( [ 'sku' => [ 'label' => __( 'SKU', 'text-domain' ), 'meta_key' => 'edd_sku', 'sortable' => true, 'position' => 'after:title', ], ] );
Orders
edd_register_order_columns( [ 'tax_amount' => [ 'label' => __( 'Tax', 'text-domain' ), 'display_callback' => function( $order ) { return edd_currency_filter( edd_format_amount( $order->tax ) ); }, 'sortable' => true, 'position' => 'after:amount', ], ] );
Customers
edd_register_customer_columns( [ 'lifetime_value' => [ 'label' => __( 'LTV', 'text-domain' ), 'display_callback' => function( $customer ) { return edd_currency_filter( edd_format_amount( $customer->purchase_value ) ); }, 'position' => 'after:spent', ], ] );
Discounts
edd_register_discount_columns( [ 'usage_percent' => [ 'label' => __( 'Usage %', 'text-domain' ), 'display_callback' => function( $discount ) { if ( $discount->max_uses <= 0 ) return '∞'; return sprintf( '%d%%', ( $discount->use_count / $discount->max_uses ) * 100 ); }, 'sortable' => true, 'position' => 'after:uses', ], ] );
Commissions (EDD Commissions)
edd_register_commission_columns( [ 'commission_type' => [ 'label' => __( 'Type', 'text-domain' ), 'display_callback' => function( $commission ) { return ucfirst( esc_html( $commission->type ) ); }, 'position' => 'after:rate', ], ] );
Licenses (EDD Software Licensing)
edd_register_license_columns( [ 'license_version' => [ 'label' => __( 'Version', 'text-domain' ), 'display_callback' => function( $license, $item ) { $version = edd_software_licensing()->license_meta_db->get_meta( $license->ID, '_edd_sl_version', true ); return ! empty( $version ) ? esc_html( $version ) : '—'; }, 'position' => 'after:title', ], ] );
Subscriptions (EDD Recurring)
edd_register_subscription_columns( [ 'times_billed' => [ 'label' => __( 'Renewals', 'text-domain' ), 'display_callback' => function( $subscription ) { $times_billed = absint( $subscription->get_total_payments() ) - 1; return $times_billed > 0 ? number_format_i18n( $times_billed ) : '0'; }, 'position' => 'after:period', ], ] );
Column Options
[
'label' => '', // Column header label
'meta_key' => '', // Meta key (optional)
'sortby' => '', // Custom sort field (optional)
'position' => '', // 'after:column' or 'before:column'
'sortable' => false, // Enable sorting (where supported)
'numeric' => false, // Use numeric sorting
'display_callback' => null, // Custom display function
'permission_callback' => null, // Permission check function
'width' => null, // Column width (e.g., '100px')
]
Position Examples
'position' => 'after:title', // Place after the title column 'position' => 'before:date', // Place before the date column
Sortable Support
| Table | Sortable |
|---|---|
| Downloads | ✅ Yes |
| Orders | ✅ Yes |
| Customers | ❌ No |
| Discounts | ✅ Yes |
| Commissions | ❌ No |
| Licenses | ✅ Yes |
| Subscriptions | ❌ No |
Removing Columns
edd_register_download_columns( [ 'new_column' => [ /* ... */ ], ], [ 'sales', 'earnings' ] // Remove these columns );
License
GPL-2.0-or-later
arraypress/edd-register-columns 适用场景与选型建议
arraypress/edd-register-columns 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 10 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「orders」 「discounts」 「customers」 「downloads」 「columns」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 arraypress/edd-register-columns 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 arraypress/edd-register-columns 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 arraypress/edd-register-columns 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP client for the Abenity API documented at https://abenity.com/developers/api
Billing package for Laravel 5.5 supporting packages, plans, coupons, addons, payments and subscriptions
2lenet/EasyAdminPlusBundle
A Discounts app for Strata
Add Shopify like fulfillments to your Craft Commerce orders.
Extend the checkout experience with coupons and discount codes.
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-10-28