autoship_create_scheduled_order_data (filter)

( src/orders.php) Allows developers to add or alter Scheduled Order Data before it is saved on creation or after Scheduled Order processing. It takes the $scheduled_order_data array and the (WooCommerce) $order_id as its parameters.

Code

$scheduled_order_data = apply_filters( 'autoship_create_scheduled_order_data', $scheduled_order_data, $order_id );

Example

/**
 * @param: array $scheduled_order_data
 * @param: int $order_id
 * @return array
 */
function autoship_create_scheduled_order_data_example( $scheduled_order_data, $order_id ) {
	$scheduled_order_data['my_custom_field'] = 'my_custom_value';
	return $scheduled_order_data;
}
add_filter( 'autoship_create_scheduled_order_data', 'autoship_create_scheduled_order_data_example', 10, 2);

Included in these Functions:

Used in the following Code Examples: