Automattic\WooCommerce\Internal\Orders
OrderActionsRestController::get_args_for_order_actions
Get the accepted arguments for the POST request.
Метод класса: OrderActionsRestController{}
Хуков нет.
Возвращает
Массив[].
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_args_for_order_actions( $action_slug ): array;
- $action_slug(строка) (обязательный)
- The endpoint slug for the order action.
Код OrderActionsRestController::get_args_for_order_actions() OrderActionsRestController::get args for order actions WC 10.4.3
private function get_args_for_order_actions( string $action_slug ): array {
$args = array(
'email' => array(
'description' => __( 'Email address to send the order details to.', 'woocommerce' ),
'type' => 'string',
'format' => 'email',
'context' => array( 'edit' ),
'required' => false,
'validate_callback' => 'rest_validate_request_arg',
),
'force_email_update' => array(
'description' => __( 'Whether to update the billing email of the order, even if it already has one.', 'woocommerce' ),
'type' => 'boolean',
'context' => array( 'edit' ),
'required' => false,
'sanitize_callback' => 'rest_sanitize_boolean',
'validate_callback' => 'rest_validate_request_arg',
),
);
if ( 'send_email' === $action_slug ) {
$args['template_id'] = array(
'description' => __( 'The ID of the template to use for sending the email.', 'woocommerce' ),
'type' => 'string',
'enum' => $this->get_template_id_enum(),
'context' => array( 'edit' ),
'required' => true,
'validate_callback' => 'rest_validate_request_arg',
);
}
return $args;
}