How to handle WordPress account for terminated employee

In general, an account for an employee that has ‘moved away’ (for any number of reasons) should have their access privileges immediately downgraded. I would also change their password to prevent access. There are many instances of a former employee still having access, and doing improper things to the business computer systems. When an employee … Read more

How to update all products with same SKU prefixes when updating stock with CSV?

This how I finally made it to update duplicated product variations with ‘-2’ SKU suffix: function update_imported_product($object, $data) { if ($object->get_type() === ‘variation’){ $product_id = wp_get_post_parent_id($object->get_id()); } else { $product_id = $object->get_id(); } if(isset($product_id)) { $sku_in = get_post_meta($product_id, ‘_sku’, true); // Search and update variations with suffix -2 $args = array( ‘post_type’ => ‘product_variation’, ‘meta_query’ … Read more