Filter
rpress_payments_table_columns
On this page
Filters the columns of the Orders list table.
Default columns are cb, ID, items, due_time, payment, order_status, amount and actions. Add a column here and supply its cell content through rpress_payments_table_column. A print column is removed after this filter runs.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$columns | array | Associative array of column key to header label. |
Return value#
array. The columns array.
Example#
function my_orders_columns( $columns ) {
$columns['my_source'] = esc_html__( 'Source', 'my-plugin' );
return $columns;
}
add_filter( 'rpress_payments_table_columns', 'my_orders_columns' );
function my_orders_column_value( $value, $payment_id, $column_name ) {
if ( 'my_source' === $column_name ) {
$value = esc_html( get_post_meta( $payment_id, 'my_source', true ) );
}
return $value;
}
add_filter( 'rpress_payments_table_column', 'my_orders_column_value', 10, 3 );
Source#
Applied in:
includes/admin/payments/class-payments-table.php(line 1403), inRPRESS_Payment_History_Table::get_columns()
See also#
Was this page helpful?
