Skip to content

Commit

Permalink
feat: add filters to login allowed js and css (#2116)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
squigglybob authored Jul 14, 2023
1 parent b093459 commit bd5e556
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dt-login/login-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}
}
Expand Down
7 changes: 6 additions & 1 deletion dt-login/login-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() ) {
Expand Down Expand Up @@ -446,6 +446,11 @@
</div>
</div>
</div>
<div class="cell">

<?php do_shortcode( '[dt_firebase_login_ui]' ) ?>

</div>
</div>
</div>
<div class="cell medium-3 large-4"></div>
Expand Down
4 changes: 4 additions & 0 deletions dt-login/pages/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ){
Expand All @@ -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 ) {
Expand Down

0 comments on commit bd5e556

Please sign in to comment.