From 9ba1d16cef985a22214b12f9f1245ed03793abe9 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 15:32:03 +0000 Subject: [PATCH 1/2] Only define auth login text if it's not set Currently this will cause a notice if someone tries to set this in their own project. --- inc/wordpress/namespace.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inc/wordpress/namespace.php b/inc/wordpress/namespace.php index b657841..1e19004 100644 --- a/inc/wordpress/namespace.php +++ b/inc/wordpress/namespace.php @@ -41,8 +41,11 @@ function load_plugin() { if ( ! empty( $config['oauth2-client-id'] ) && ! empty( $config['cookie'] ) ) { define( 'HM_DELEGATED_AUTH_CLIENT_ID', $config['oauth2-client-id'] ); } + + if ( ! defined( 'HM_DELEGATED_AUTH_LOGIN_TEXT' ) ) { + define( 'HM_DELEGATED_AUTH_LOGIN_TEXT', __( 'Login with WordPress SSO', 'altis' ) ); + } - define( 'HM_DELEGATED_AUTH_LOGIN_TEXT', __( 'Login with WordPress SSO', 'altis' ) ); add_filter( 'delegated_oauth.sync-roles', ( empty( $config['sync-roles'] ) || ! $config['sync-roles'] ) ? '__return_false' : '__return_true' ); require_once Altis\ROOT_DIR . '/vendor/humanmade/delegated-oauth/plugin.php'; From ddae925c1c593b6d4b5e732fe0a0c91e8056e0c8 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Tue, 20 Apr 2021 15:32:55 +0000 Subject: [PATCH 2/2] Remove whitespace --- inc/wordpress/namespace.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/wordpress/namespace.php b/inc/wordpress/namespace.php index 1e19004..0029462 100644 --- a/inc/wordpress/namespace.php +++ b/inc/wordpress/namespace.php @@ -41,7 +41,7 @@ function load_plugin() { if ( ! empty( $config['oauth2-client-id'] ) && ! empty( $config['cookie'] ) ) { define( 'HM_DELEGATED_AUTH_CLIENT_ID', $config['oauth2-client-id'] ); } - + if ( ! defined( 'HM_DELEGATED_AUTH_LOGIN_TEXT' ) ) { define( 'HM_DELEGATED_AUTH_LOGIN_TEXT', __( 'Login with WordPress SSO', 'altis' ) ); }