Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WC_AJAX::variation_bulk_action_toggle_enabled( array $variations, array $data )

Bulk action – Toggle Enabled.


Description Description


Parameters Parameters

$variations

(Required) List of variations.

$data

(Required) Data to set.


Top ↑

Source Source

File: includes/class-wc-ajax.php

	private static function variation_bulk_action_toggle_enabled( $variations, $data ) {
		foreach ( $variations as $variation_id ) {
			$variation = wc_get_product( $variation_id );
			$variation->set_status( 'private' === $variation->get_status( 'edit' ) ? 'publish' : 'private' );
			$variation->save();
		}
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.