Filter
rpress_report_customer_columns
On this page
Filters the columns of the customers list table.
Applied when the admin Customers table or the customer reports table builds its column list. The array maps column slugs to header labels. Add a slug and a matching rpress_customers_column_{$column_name} filter to render a custom column on the Customers screen.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$columns | array | Column slugs mapped to header labels. |
Return value#
array. The column slug to label map.
Example#
function my_customer_columns( $columns ) {
$columns['loyalty'] = esc_html__( 'Loyalty Points', 'my-plugin' );
return $columns;
}
add_filter( 'rpress_report_customer_columns', 'my_customer_columns' );
Notes#
Fired from two list tables: the Customers screen (columns cb, name, email, num_purchases, amount_spent, date_created) and the customer reports table (columns id, email, num_purchases, amount_spent, fooditems). The default column sets differ.
Source#
Applied in:
includes/admin/customers/class-customer-table.php(line 328), inRPRESS_Customer_Reports_Table::get_columns()includes/admin/reporting/class-customer-reports-table.php(line 133), inRPRESS_Customer_Reports_Table::get_columns()
Was this page helpful?
