true ); Groups_Options::update_option(Groups_Post_Access::POST_TYPES, $post_types_option); } function wiaas_db_setup_exclusive_taxonomies() { update_option('radio_button_for_taxonomies_options', array( 'taxonomies' => array( 'shop_order_project', ), 'delete' => 0, )); } function wiaas_db_setup_customer_capabilities() { $customer_role = get_role('customer'); $customer_role->add_cap('read_private_shop_orders'); $customer_role->add_cap('read_private_products'); $customer_role->add_cap('read_shop_order'); $customer_role->add_cap('publish_shop_orders'); // user $customer_role->add_cap('list_users'); $customer_role->add_cap('edit_users'); } function wiaas_db_setup_create_customer_commercial_lead_table() { global $wpdb; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; $sql = " CREATE TABLE {$wpdb->prefix}wiaas_shop_customer_relationships ( `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `customer_id` bigint(20) unsigned NOT NULL, `shop_owner_id` bigint(20) unsigned NOT NULL, `order_type` varchar(44) NOT NULL default '', PRIMARY KEY (`ID`), KEY `relationship` (`customer_id`, `shop_owner_id`), KEY `order_type` (`order_type`) ) COLLATE {$wpdb->collate}; "; dbDelta( $sql ); } function wiaas_create_organization_roles_capabilities() { $roles = array( 'commercial_lead', 'supplier', 'customer', 'administrator'); foreach ($roles as $role) { Groups_Capability::create( array( 'capability' => 'wiaas_' . $role )); } } function update_delivery_forms() { $forms = GFAPI::get_forms(); foreach ($forms as $form) { GFAPI::delete_form($form['id']); } GFExport::import_file(dirname( __FILE__ ) . "/data/delivery-forms/delivery-action-forms.json"); GFExport::import_file(dirname( __FILE__ ) . "/data/delivery-forms/delivery-process-sample-form.json"); }