test
This commit is contained in:
@@ -18,13 +18,13 @@ class Wiaas_Admin_Organization {
|
|||||||
add_filter('woocommerce_customer_meta_fields', array(__CLASS__, 'hide_woocommerce_customer_fields'));
|
add_filter('woocommerce_customer_meta_fields', array(__CLASS__, 'hide_woocommerce_customer_fields'));
|
||||||
|
|
||||||
// save related customers when organization form data has been saved by acf
|
// save related customers when organization form data has been saved by acf
|
||||||
// add_action('acf/save_post', array(__CLASS__, 'maybe_save_related_customers'), 11);
|
// add_action('acf/save_post', array(__CLASS__, 'maybe_save_related_customers'), 999);
|
||||||
|
|
||||||
// load related customers for organization form
|
// load related customers for organization form
|
||||||
add_filter('acf/load_value/name=_wiaas_organization_customers', array(__CLASS__, 'load_related_customer_organizations'), 10, 3);
|
// add_filter('acf/load_value/name=_wiaas_organization_customers', array(__CLASS__, 'load_related_customer_organizations'), 10, 3);
|
||||||
|
|
||||||
// retrieve only customer organizations as options to link to commercial lead
|
// retrieve only customer organizations as options to link to commercial lead
|
||||||
add_filter('acf/fields/taxonomy/query/name=_wiaas_organization_customers', array(__CLASS__, 'filter_customer_organizations'));
|
// add_filter('acf/fields/taxonomy/query/name=_wiaas_organization_customers', array(__CLASS__, 'filter_customer_organizations'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function hide_woocommerce_customer_fields() {
|
public static function hide_woocommerce_customer_fields() {
|
||||||
@@ -64,6 +64,10 @@ class Wiaas_Admin_Organization {
|
|||||||
//get organization id
|
//get organization id
|
||||||
$id = absint(str_replace('term_', '', $id));
|
$id = absint(str_replace('term_', '', $id));
|
||||||
|
|
||||||
|
if (!$id) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$customer_organization_ids = $_POST['acf'][$field['key']];
|
$customer_organization_ids = $_POST['acf'][$field['key']];
|
||||||
|
|
||||||
$customer_organization_ids = is_array($customer_organization_ids) ?
|
$customer_organization_ids = is_array($customer_organization_ids) ?
|
||||||
|
|||||||
Reference in New Issue
Block a user