Skip to content

Commit

Permalink
Update documentation and remove <li> from the string.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Sep 23, 2024
1 parent 61121cd commit 5ac8a23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions class-two-factor-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -826,22 +826,22 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg
foreach ( $backup_providers as $backup_provider_key => $backup_provider ) {
$backup_link_args['provider'] = $backup_provider_key;
$links[] = sprintf(
'<li><a href="%1$s">%2$s</a></li>',
'<a href="%1$s">%2$s</a>',
esc_url( self::login_url( $backup_link_args ) ),
esc_html( $backup_provider->get_alternative_provider_label() )
);
}
}

/**
* Filters the backup links displayed on the two-factor login form.
* Filters the html links displayed on the two-factor login form.
*
* Plugins can use this filter to modify or add links to the two-factor authentication
* login form, allowing users to select backup methods for authentication.
* login form, allowing users to select backup methods for authentication or provide documentation links.
*
* @since 0.9.2
*
* @param array $links An array of backup links displayed on the two-factor login form.
* @param array<string> $links An array of links displayed on the two-factor login form.
*/
$links = apply_filters( 'two_factor_login_backup_links', $links );
?>
Expand All @@ -854,7 +854,7 @@ public static function login_html( $user, $login_nonce, $redirect_to, $error_msg
<ul>
<?php
foreach ( $links as $link ) {
echo $link;
echo '<li>' . $link . '</li>';
}
?>
</ul>
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Here is a list of action and filter hooks provided by the plugin:
- `two_factor_enabled_providers_for_user` filter overrides the list of two-factor providers enabled for a user. First argument is an array of enabled provider classnames as values, the second argument is the user ID.
- `two_factor_user_authenticated` action which receives the logged in `WP_User` object as the first argument for determining the logged in user right after the authentication workflow.
- `two_factor_token_ttl` filter overrides the time interval in seconds that an email token is considered after generation. Accepts the time in seconds as the first argument and the ID of the `WP_User` object being authenticated.
- `two_factor_login_backup_links` filters the backup links displayed on the two-factor login form.

== Frequently Asked Questions ==

Expand Down

0 comments on commit 5ac8a23

Please sign in to comment.