Skip to content
Docs
Get RestroPress

Filter

rpress_payments_table_columns

Updated
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#

ParameterTypeDescription
$columnsarrayAssociative 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), in RPRESS_Payment_History_Table::get_columns()

See also#

Was this page helpful?