WPCloud Deploy Documentation

Filter Hook: wpcd_wordpress-app_initial_server_attributes_wc

apply_filters( "wpcd_wordpress-app_initial_server_attributes_wc", $attributes, $item, $items, $user, $subscription );

Discussion

This hook is fired just before data is passed off to the server creation routine.

It is triggered only by the SELL SERVERS WITH WOOCOMMERCE add-on.  Servers created by the normal WPCD screens do NOT trigger this hook.

It’s a great place to take any additional fields you’ve added to the server creation popup screen and insert it into the  array of server information that will be stored in the server custom post type record.

  • $attributes is an array of server data that will be used to create the server.  Do not remove anything from this array.  You should only add items to it.  Anything added to it will be stored on the server custom post type record.
  • $item – the WooCommerce item being purchased.
  • $items – All items being puchased (users can sometime purchase more than one item)
  • $user – The user making the purchase
  • $subscription – data about the subscription.
  • $args is an array of data that contains all th

This filter is for servers created when a user is purchasing a server via WooCommerce.  Servers created in wp-admin have a different filter with different parameters.

Reference

Located in:

  • Function: wc_spinup_wpapp
  • File: /includes/core/apps/wordpress-app/class-wordpress-woocommerce.php

Availability

This hook is only available in WPCD versions 4.2.5 or later.

 

 

Share: