{"id":34910559,"url":"https://github.com/arraypress/edd-register-columns","last_synced_at":"2026-05-26T14:04:40.568Z","repository":{"id":321287743,"uuid":"1082017336","full_name":"arraypress/edd-register-columns","owner":"arraypress","description":"Lightweight library for registering custom columns in Easy Digital Downloads tables.","archived":false,"fork":false,"pushed_at":"2025-12-07T16:17:28.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-27T21:09:53.182Z","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-10-23T16:01:56.000Z","updated_at":"2025-12-07T16:17:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"7fc6c482-59d3-48bb-a9e8-5988909db6a6","html_url":"https://github.com/arraypress/edd-register-columns","commit_stats":null,"previous_names":["arraypress/edd-register-columns"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arraypress/edd-register-columns","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-columns","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-columns/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-columns/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-columns/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arraypress","download_url":"https://codeload.github.com/arraypress/edd-register-columns/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arraypress%2Fedd-register-columns/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33523687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: 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":"2025-12-26T11:08:03.396Z","updated_at":"2026-05-26T14:04:40.555Z","avatar_url":"https://github.com/arraypress.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Easy Digital Downloads - Register Columns\n\nA lightweight library for adding custom columns to Easy Digital Downloads admin tables.\n\n## Installation\n\n```bash\ncomposer require arraypress/edd-register-columns\n```\n\n## Requirements\n\n- PHP 7.4+\n- WordPress 5.0+\n- Easy Digital Downloads 3.0+\n\n## Quick Start\n\n### Downloads\n\n```php\nedd_register_download_columns( [\n    'sku' =\u003e [\n        'label'            =\u003e __( 'SKU', 'text-domain' ),\n        'meta_key'         =\u003e 'edd_sku',\n        'sortable'         =\u003e true,\n        'position'         =\u003e 'after:title',\n    ],\n] );\n```\n\n### Orders\n\n```php\nedd_register_order_columns( [\n    'tax_amount' =\u003e [\n        'label'            =\u003e __( 'Tax', 'text-domain' ),\n        'display_callback' =\u003e function( $order ) {\n            return edd_currency_filter( edd_format_amount( $order-\u003etax ) );\n        },\n        'sortable'         =\u003e true,\n        'position'         =\u003e 'after:amount',\n    ],\n] );\n```\n\n### Customers\n\n```php\nedd_register_customer_columns( [\n    'lifetime_value' =\u003e [\n        'label'            =\u003e __( 'LTV', 'text-domain' ),\n        'display_callback' =\u003e function( $customer ) {\n            return edd_currency_filter( edd_format_amount( $customer-\u003epurchase_value ) );\n        },\n        'position'         =\u003e 'after:spent',\n    ],\n] );\n```\n\n### Discounts\n\n```php\nedd_register_discount_columns( [\n    'usage_percent' =\u003e [\n        'label'            =\u003e __( 'Usage %', 'text-domain' ),\n        'display_callback' =\u003e function( $discount ) {\n            if ( $discount-\u003emax_uses \u003c= 0 ) return '∞';\n            return sprintf( '%d%%', ( $discount-\u003euse_count / $discount-\u003emax_uses ) * 100 );\n        },\n        'sortable'         =\u003e true,\n        'position'         =\u003e 'after:uses',\n    ],\n] );\n```\n\n### Commissions (EDD Commissions)\n\n```php\nedd_register_commission_columns( [\n    'commission_type' =\u003e [\n        'label'            =\u003e __( 'Type', 'text-domain' ),\n        'display_callback' =\u003e function( $commission ) {\n            return ucfirst( esc_html( $commission-\u003etype ) );\n        },\n        'position'         =\u003e 'after:rate',\n    ],\n] );\n```\n\n### Licenses (EDD Software Licensing)\n\n```php\nedd_register_license_columns( [\n    'license_version' =\u003e [\n        'label'            =\u003e __( 'Version', 'text-domain' ),\n        'display_callback' =\u003e function( $license, $item ) {\n            $version = edd_software_licensing()-\u003elicense_meta_db-\u003eget_meta( $license-\u003eID, '_edd_sl_version', true );\n            return ! empty( $version ) ? esc_html( $version ) : '—';\n        },\n        'position'         =\u003e 'after:title',\n    ],\n] );\n```\n\n### Subscriptions (EDD Recurring)\n\n```php\nedd_register_subscription_columns( [\n    'times_billed' =\u003e [\n        'label'            =\u003e __( 'Renewals', 'text-domain' ),\n        'display_callback' =\u003e function( $subscription ) {\n            $times_billed = absint( $subscription-\u003eget_total_payments() ) - 1;\n            return $times_billed \u003e 0 ? number_format_i18n( $times_billed ) : '0';\n        },\n        'position'         =\u003e 'after:period',\n    ],\n] );\n```\n\n## Column Options\n\n```php\n[\n    'label'               =\u003e '',       // Column header label\n    'meta_key'            =\u003e '',       // Meta key (optional)\n    'sortby'              =\u003e '',       // Custom sort field (optional)\n    'position'            =\u003e '',       // 'after:column' or 'before:column'\n    'sortable'            =\u003e false,    // Enable sorting (where supported)\n    'numeric'             =\u003e false,    // Use numeric sorting\n    'display_callback'    =\u003e null,     // Custom display function\n    'permission_callback' =\u003e null,     // Permission check function\n    'width'               =\u003e null,     // Column width (e.g., '100px')\n]\n```\n\n## Position Examples\n\n```php\n'position' =\u003e 'after:title',   // Place after the title column\n'position' =\u003e 'before:date',   // Place before the date column\n```\n\n## Sortable Support\n\n| Table | Sortable |\n|-------|----------|\n| Downloads | ✅ Yes |\n| Orders | ✅ Yes |\n| Customers | ❌ No |\n| Discounts | ✅ Yes |\n| Commissions | ❌ No |\n| Licenses | ✅ Yes |\n| Subscriptions | ❌ No |\n\n## Removing Columns\n\n```php\nedd_register_download_columns(\n    [\n        'new_column' =\u003e [ /* ... */ ],\n    ],\n    [ 'sales', 'earnings' ] // Remove these columns\n);\n```\n\n## License\n\nGPL-2.0-or-later","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fedd-register-columns","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farraypress%2Fedd-register-columns","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farraypress%2Fedd-register-columns/lists"}