Skip to content

Commit 8918127

Browse files
Pass all the links so we can control link location.
1 parent 16a1d5c commit 8918127

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

‎class-two-factor-core.php‎

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -825,23 +825,29 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg
825825
<?php esc_html_e( 'Having Problems?', 'two-factor' ); ?>
826826
</p>
827827
<ul>
828-
<?php
829-
foreach ( $backup_providers as $backup_provider_key => $backup_provider ) :
828+
<?php
829+
$links = [];
830+
831+
foreach ( $backup_providers as $backup_provider_key => $backup_provider ) {
830832
$backup_link_args['provider'] = $backup_provider_key;
831-
?>
832-
<li>
833-
<a href="<?php echo esc_url( self::login_url( $backup_link_args ) ); ?>">
834-
<?php echo esc_html( $backup_provider->get_alternative_provider_label() ); ?>
835-
</a>
836-
</li>
837-
<?php endforeach; ?>
838-
<?php
833+
$links[] = sprintf(
834+
'<li><a href="$1%s">$2%s</a></li>',
835+
esc_url( self::login_url( $backup_link_args ) ),
836+
esc_html( $backup_provider->get_alternative_provider_label() )
837+
);
838+
}
839+
839840
/*
840841
* Allow plugins to add links to the two-factor login form.
841842
*/
842-
echo apply_filters( 'two_factor_login_support_links', '' );
843-
?>
844-
</ul>
843+
$links = apply_filters( 'two_factor_login_support_links', $links );
844+
845+
// Echo out the filtered links
846+
foreach ( $links as $link ) {
847+
echo wp_kses_post( $link );
848+
}
849+
?>
850+
</ul>
845851
</div>
846852
<?php endif; ?>
847853

0 commit comments

Comments
 (0)