id; } /** * Enqueues the admin scripts needed on the plugins screen. */ public function enqueue_scripts_and_styles() { if ( ! $this->is_admin_plugins_screen() || ! WC_Payments_Subscription_Service::store_has_active_wcpay_subscriptions() ) { return; } // The backbone modal requires the WC admin styles to be loaded. wp_enqueue_style( 'woocommerce_admin_styles' ); wp_register_script( 'wcpay-subscriptions-plugin', plugins_url( 'includes/subscriptions/assets/js/plugin-page.js', WCPAY_PLUGIN_FILE ), [ 'jquery', 'wc-backbone-modal' ], WCPAY_VERSION_NUMBER, true ); wp_enqueue_script( 'wcpay-subscriptions-plugin' ); WC_Payments_Utils::enqueue_style( 'wcpay-subscriptions-plugin-styles', plugins_url( 'includes/subscriptions/assets/css/plugin-page.css', WCPAY_PLUGIN_FILE ), [], WCPAY_VERSION_NUMBER, 'all' ); } /** * Enqueues templates for plugin deactivation warnings on the admin plugin screen. */ public function output_notice_template() { if ( ! $this->is_admin_plugins_screen() ) { return; } wc_get_template( 'html-subscriptions-plugin-notice.php', [], '', dirname( __DIR__ ) . '/subscriptions/templates/' ); // Load a slightly different notice for folks still using the legacy WCPay Subscriptions functionality. if ( WC_Payments::get_gateway()->is_subscriptions_plugin_active() ) { wc_get_template( 'html-woo-payments-deactivate-warning.php', [], '', dirname( __DIR__ ) . '/subscriptions/templates/' ); } else { wc_get_template( 'html-wcpay-deactivate-warning.php', [], '', dirname( __DIR__ ) . '/subscriptions/templates/' ); } } }