init(); } /** * Initialize */ private function init() { // Check if WooCommerce is active and integration is enabled if ( ! class_exists( 'WooCommerce' ) ) { return; } if ( get_option( 'forwp_account_woocommerce_integration', '0' ) !== '1' ) { return; } // Add social login buttons to WooCommerce login form add_action( 'woocommerce_login_form_end', [ $this, 'render_login_buttons' ], 10 ); // Add social login buttons to WooCommerce registration form add_action( 'woocommerce_register_form_end', [ $this, 'render_register_buttons' ], 10 ); } /** * Render social login buttons on login form */ public function render_login_buttons() { $this->render_buttons(); } /** * Render social login buttons on registration form */ public function render_register_buttons() { $this->render_buttons(); } /** * Render social login buttons */ private function render_buttons() { // Get enabled providers $providers = $this->get_enabled_providers(); if ( empty( $providers ) ) { return; } // Ensure scripts are enqueued $this->enqueue_scripts(); ?>
$provider_name ) : ?>
rest_url( 'forwp-account/v1/' ), 'nonce' => wp_create_nonce( 'forwp_account_nonce' ), ] ); } // Enqueue styles if not already enqueued if ( ! wp_style_is( 'forwp-account-signin', 'enqueued' ) ) { wp_enqueue_style( 'forwp-account-signin', FORWP_ACCOUNT_PLUGIN_URL . 'assets/css/auth.css', [], FORWP_ACCOUNT_VERSION ); } } }