Automattic\WooCommerce\Internal\Admin
Coupons::maybe_add_marketing_coupon_script
Maybe add our wc-admin coupon scripts if viewing coupon pages
Метод класса: Coupons{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Coupons = new Coupons(); $Coupons->maybe_add_marketing_coupon_script();
Код Coupons::maybe_add_marketing_coupon_script() Coupons::maybe add marketing coupon script WC 10.5.0
public function maybe_add_marketing_coupon_script() {
$curent_screen = PageController::get_instance()->get_current_page();
if ( ! isset( $curent_screen['id'] ) || $curent_screen['id'] !== 'woocommerce-coupons' ) {
return;
}
WCAdminAssets::register_style( 'marketing-coupons', 'style' );
WCAdminAssets::register_script( 'wp-admin-scripts', 'marketing-coupons', true );
}