Automattic\WooCommerce\Internal\Admin
Translations::potentially_generate_translation_strings()
Run when plugin is activated (can be WooCommerce or WooCommerce Admin).
Метод класса: Translations{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Translations = new Translations(); $Translations->potentially_generate_translation_strings( $filename );
- $filename(строка) (обязательный)
- Activated plugin filename.
Код Translations::potentially_generate_translation_strings() Translations::potentially generate translation strings WC 8.7.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(); } }