WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WC_Helper::_helper_plugin_deactivate() private WC 1.0

Deactivate a plugin.

Это метод класса: WC_Helper{}

Хуков нет.

Возвращает

Null. Ничего.

Использование

$result = WC_Helper::_helper_plugin_deactivate();

Код WC_Helper::_helper_plugin_deactivate() WC 4.5.2

woocommerce/includes/admin/helper/class-wc-helper.php
<?php
private static function _helper_plugin_deactivate() {
	$product_id  = isset( $_GET['wc-helper-product-id'] ) ? absint( $_GET['wc-helper-product-id'] ) : 0;
	$deactivated = false;

	if ( empty( $_GET['wc-helper-nonce'] ) || ! wp_verify_nonce( wp_unslash( $_GET['wc-helper-nonce'] ), 'deactivate-plugin:' . $product_id ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
		self::log( 'Could not verify nonce in _helper_plugin_deactivate' );
		wp_die( 'Could not verify nonce' );
	}

	if ( ! current_user_can( 'activate_plugins' ) ) {
		wp_die( 'You are not allowed to manage plugins on this site.' );
	}

	$local = wp_list_filter(
		array_merge(
			self::get_local_woo_plugins(),
			self::get_local_woo_themes()
		),
		array( '_product_id' => $product_id )
	);

	// Attempt to deactivate this plugin or theme.
	if ( ! empty( $local ) ) {
		$local = array_shift( $local );
		if ( is_plugin_active( $local['_filename'] ) ) {
			deactivate_plugins( $local['_filename'] );
		}

		$deactivated = ! is_plugin_active( $local['_filename'] );
	}

	$redirect_uri = add_query_arg(
		array(
			'page'                 => 'wc-addons',
			'section'              => 'helper',
			'filter'               => self::get_current_filter(),
			'wc-helper-status'     => $deactivated ? 'deactivate-plugin-success' : 'deactivate-plugin-error',
			'wc-helper-product-id' => $product_id,
		),
		admin_url( 'admin.php' )
	);

	wp_safe_redirect( $redirect_uri );
	die();
}