From bd5e556270806e06d12430be07aec79c04707f49 Mon Sep 17 00:00:00 2001 From: squigglybob Date: Fri, 14 Jul 2023 11:45:22 +0100 Subject: [PATCH] feat: add filters to login allowed js and css (#2116) * feat: add filters to login allowed js and css * fix: if custom login is on, redirect to home on logout rather than login page * feat: add firebase SSO login buttons on custom login register page * feat: add action in login-page.php for adding header php --- dt-login/login-page.php | 3 +++ dt-login/login-template.php | 7 ++++++- dt-login/pages/base.php | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dt-login/login-page.php b/dt-login/login-page.php index d62653bb42..b506c33a7d 100644 --- a/dt-login/login-page.php +++ b/dt-login/login-page.php @@ -42,6 +42,9 @@ public function __construct() { } public function body(){ + + do_action( 'dt_login_login_page_header' ); + require_once( get_template_directory() . '/dt-login/login-template.php' ); } } diff --git a/dt-login/login-template.php b/dt-login/login-template.php index 2ce17b8068..0030a3cd41 100644 --- a/dt-login/login-template.php +++ b/dt-login/login-template.php @@ -7,7 +7,7 @@ if ( isset( $_GET['action'] ) && 'logout' === $_GET['action'] ) { wp_destroy_current_session(); wp_clear_auth_cookie(); - wp_safe_redirect( dt_login_url( 'login' ) ); + wp_safe_redirect( dt_login_url( 'home' ) ); exit; } if ( is_user_logged_in() ) { @@ -446,6 +446,11 @@ +
+ + + +
diff --git a/dt-login/pages/base.php b/dt-login/pages/base.php index 9768696cf4..c1b690dbdf 100644 --- a/dt-login/pages/base.php +++ b/dt-login/pages/base.php @@ -77,6 +77,8 @@ public function _print_scripts(){ 'google-search-widget', ]; + $allowed_js = apply_filters( 'dt_login_allowed_js', $allowed_js ); + global $wp_scripts; if ( isset( $wp_scripts ) ){ @@ -97,6 +99,8 @@ public function _print_styles(){ 'mapbox-gl-css', ]; + $allowed_css = apply_filters( 'dt_login_allowed_css', $allowed_css ); + global $wp_styles; if ( isset( $wp_styles ) ) { foreach ( $wp_styles->queue as $key => $item ) {