Skip to content

Commit 81ee30d

Browse files
committed
fix: update attribute used for the My Account button block logged in
1 parent 0581242 commit 81ee30d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

src/blocks/my-account-button/class-my-account-button-block.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ public static function render_block( $attrs ) {
166166
}
167167

168168
$wrapper_attribute_args = [
169-
'class' => implode( ' ', $extra_classes ),
170-
'href' => \esc_url_raw( $href ),
171-
'data-wp-logged-in' => $is_signed_in ? '1' : '0',
169+
'class' => implode( ' ', $extra_classes ),
170+
'href' => \esc_url_raw( $href ),
171+
'data-newspack-logged-in' => $is_signed_in ? '1' : '0',
172172
];
173173
$wrapper_attributes = \get_block_wrapper_attributes( $wrapper_attribute_args );
174174

src/reader-activation-auth/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@ window.newspackRAS.push( readerActivation => {
103103
const labels = JSON.parse( link.getAttribute( 'data-labels' ) );
104104
const labelEl = link.querySelector( '.newspack-reader__account-link__label' );
105105
if ( labelEl ) {
106-
const isLoggedIn = link.getAttribute( 'data-wp-logged-in' ) === '1';
106+
// Change the label for the My Account button only.
107+
const isLoggedIn = link.getAttribute( 'data-newspack-logged-in' ) === '1';
107108
if ( isLoggedIn ) {
108109
labelEl.textContent = labels.signedin;
109110
return;

0 commit comments

Comments
 (0)