/** * Make sure parent product's assigned terms are refresh when its variations' statuses are changed * * @since 3.8.9 * @access private * @param string $new_status New status * @param string $old_status Old status * @param object $post Variation object */ function _wpsc_action_transition_post_status($new_status, $old_status, $post) { if ($post->post_type != 'wpsc-product' || !$post->post_parent) { return; } _wpsc_refresh_parent_product_terms($post->post_parent); }
public function process_bulk_action() { if (!empty($_REQUEST['wpsc_bulk_edit']['post'])) { $this->save_bulk_edited_items(); return; } $current_action = $this->list_table->current_action(); if (empty($current_action)) { return; } _wpsc_remove_refresh_variation_parent_term_hooks(); check_admin_referer('wpsc_product_variations_bulk_action', 'bulk_action_nonce'); $sendback = $_SERVER['REQUEST_URI']; $callback = 'process_bulk_action_' . $current_action; $post_ids = isset($_REQUEST['post']) ? $_REQUEST['post'] : array(); if (!is_array($post_ids)) { $post_ids = explode(',', $post_ids); } $post_ids = array_map('intval', $post_ids); if (!empty($post_ids) && is_callable(array($this, $callback))) { $sendback = $this->{$callback}($post_ids); } $sendback = remove_query_arg(array('_wp_http_referer', 'bulk_action', 'bulk_action2', 'bulk_action_nonce', 'confirm', 'post', 'last_paged'), $sendback); _wpsc_refresh_parent_product_terms($this->parent_id); _wpsc_add_refresh_variation_parent_term_hooks(); if ($current_action != 'edit') { wp_redirect($sendback); exit; } }