Automattic\WooCommerce\Internal\Admin

Translations::potentially_generate_translation_strings()publicWC 1.0

Run when plugin is activated (can be WooCommerce or WooCommerce Admin).

Метод класса: Translations{}

No Hooks.

Return

null. Nothing.

Usage

$Translations = new Translations();
$Translations->potentially_generate_translation_strings( $filename );
$filename(string) (required)
Activated plugin filename.

Code of Translations::potentially_generate_translation_strings() WC 7.1.0

public function potentially_generate_translation_strings( $filename ) {
	$plugin_domain           = explode( '/', plugin_basename( __FILE__ ) )[0];
	$activated_plugin_domain = explode( '/', $filename )[0];

	// Ensure we're only running only on activation hook that originates from our plugin.
	if ( $plugin_domain === $activated_plugin_domain ) {
		$this->generate_translation_strings();
	}
}