Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions inc/sso/class-sso.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,22 @@ public function startup(): void {

add_action('login_head', [$this, 'enqueue_script']);

/*
* GlotPress uses its own template system with gp_head()/gp_footer()
* instead of wp_head()/wp_footer(). Without this hook the SSO script
* never loads on GlotPress pages, breaking cross-domain login for
* translation sites.
*
* Registration is deferred to plugins_loaded so we can check whether
* GlotPress is actually active before adding the hook.
*/
add_action('plugins_loaded', function (): void {

if (defined('GP_VERSION')) {
add_action('gp_head', [$this, 'enqueue_script']);
}
});

/**
* Allow plugin developers to add additional hooks, if needed.
*
Expand Down
Loading