Filter
rpress_discount_row_actions
On this page
Filters the row action links under each discount name in the Discount Codes table.
Applied when the Name column is rendered. The array holds HTML links keyed edit, deactivate or activate (depending on the discount status) and delete. Add, remove or replace entries to change what is shown by WP_List_Table::row_actions().
Parameters#
| Parameter | Type | Description |
|---|---|---|
$row_actions | array | Row action HTML links keyed by slug. |
$discount | WP_Post | The discount post for the current row. |
Return value#
array. The row action links to display.
Example#
function my_discount_row_actions( $row_actions, $discount ) {
$url = add_query_arg( array( 'rpress-action' => 'my_duplicate_discount', 'discount' => $discount->ID ) );
$row_actions['duplicate'] = '<a href="' . esc_url( wp_nonce_url( $url, 'my_duplicate_discount' ) ) . '">' . esc_html__( 'Duplicate', 'my-plugin' ) . '</a>';
return $row_actions;
}
add_filter( 'rpress_discount_row_actions', 'my_discount_row_actions', 10, 2 );
Notes#
A custom link that points at an rpress-action is dispatched to the matching rpress_{action} hook on admin_init.
Source#
Applied in:
includes/admin/discounts/class-discount-codes-table.php(line 222), inRPRESS_Discount_Codes_Table::column_name()
Was this page helpful?
