Filter
rpress_insert_discount_args
On this page
Filters the post arguments used to create a discount post.
Runs in RPRESS_Discount::insert_discount() just before wp_insert_post() creates the blank rpress_discount post. The array holds post_title, post_status, post_type, post_date and post_date_gmt. The discount meta is written afterwards.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$args | array | Arguments for wp_insert_post(). |
$discount_data | array | The discount data that will be saved as meta after the post is created. |
Return value#
array. Arguments passed to wp_insert_post().
Example#
function my_insert_discount_args( $args, $discount_data ) {
$args['post_status'] = 'active';
return $args;
}
add_filter( 'rpress_insert_discount_args', 'my_insert_discount_args', 10, 2 );
Source#
Applied in:
includes/class-rpress-discount.php(line 1080), inRPRESS_Discount::insert_discount()
Was this page helpful?
