Skip to content

Commit

Permalink
cleanup: translate button by default; WPCS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jrchamp committed Apr 4, 2024
1 parent 1ce938e commit af129ae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion options-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ function shibboleth_options_idps() {

<?php
foreach ( $idps as $idp_code => $idp ) {
if ($idp_code === '__new') {
if ( '__new' === $idp_code ) {
$idp_code_value = '';
} else {
$idp_code_value = $idp_code;
Expand Down
11 changes: 8 additions & 3 deletions shibboleth.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,16 @@ function shibboleth_migrate_old_data() {
*/
$idps = get_site_option( 'shibboleth_idps', array() );
if ( empty( $idps ) ) {
$button_text = get_site_option( 'shibboleth_button_text', '' );
if ( 'Log in with Shibboleth' === $button_text ) {
$button_text = '';
}

$idps['preset'] = array(
'entity_id' => '',
'password_change_url' => get_site_option( 'shibboleth_password_change_url', '' ),
'password_reset_url' => get_site_option( 'shibboleth_password_reset_url', '' ),
'button_text' => get_site_option( 'shibboleth_button_text', '' ),
'button_text' => $button_text,
);
update_site_option( 'shibboleth_idps', $idps );
delete_site_option( 'shibboleth_password_change_url' );
Expand Down Expand Up @@ -704,7 +709,7 @@ function shibboleth_set_user_idp( $user_id, $user_idp = null ) {
}
}

if ( ! empty( $user_idp )) {
if ( ! empty( $user_idp ) ) {
update_user_meta( $user_id, 'shibboleth_account', $user_idp );
return true;
}
Expand Down Expand Up @@ -1134,7 +1139,7 @@ function shibboleth_login_form() {
$button_text = __( 'Log in with Shibboleth', 'shibboleth' );
}
?>
<div class="shibboleth-wrap" <?php echo ($first && $disable) ? 'style="margin-top:0;"' : ''; ?>>
<div class="shibboleth-wrap" <?php echo ( $first && $disable ) ? 'style="margin-top:0;"' : ''; ?>>
<?php
if ( $first && ! $disable ) {
?>
Expand Down

0 comments on commit af129ae

Please sign in to comment.