WordPress at Your Fingertips
function is not described

WC_AJAX::variation_bulk_action_toggle_enabled() private WC 1.0

Bulk action - Toggle Enabled.

{} It's a method of the class: WC_AJAX{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_AJAX::variation_bulk_action_toggle_enabled( $variations, $data );
$variations(array) (required)
List of variations.
$data(array) (required)
Data to set.

Code of WC_AJAX::variation_bulk_action_toggle_enabled() WC 5.9.0

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();
	}
}