Skip to content

Commit 9fed074

Browse files
committed
chore: update inline comments
1 parent 47dba2a commit 9fed074

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static function render_block( $attrs ) {
102102
$signed_out_label = '' === trim( (string) $attrs['signedOutLabel'] ) ? $default_attrs['signedOutLabel'] : $attrs['signedOutLabel'];
103103
$label = $is_signed_in ? $signed_in_label : $signed_out_label;
104104

105-
/** Display mode from block style class in className (default = icon + text). */
105+
// Display mode from block style class in className (default = icon + text).
106106
$wrapper_class = (string) $attrs['className'];
107107
if ( \strpos( $wrapper_class, 'is-style-icon-only' ) !== false ) {
108108
$show_label = false;
@@ -117,7 +117,7 @@ public static function render_block( $attrs ) {
117117

118118
$account_url = self::get_account_url();
119119

120-
/** Do not render link for authenticated readers if account page doesn't exist. */
120+
// Do not render link for authenticated readers if account page doesn't exist.
121121
if ( empty( $account_url ) && \is_user_logged_in() ) {
122122
return '';
123123
}
@@ -141,26 +141,25 @@ public static function render_block( $attrs ) {
141141
'newspack-reader__account-link',
142142
];
143143

144-
/** Get default wrapper attributes to extract custom classes */
144+
// Get default wrapper attributes to extract custom classes.
145145
$default_wrapper_attributes = \get_block_wrapper_attributes();
146146

147-
/** Extract custom classes (everything except the default block class) */
148-
$default_block_class = 'wp-block-newspack-my-account-button';
149-
$custom_classes = [];
147+
// Extract custom classes (everything except the default block class).
148+
$custom_classes = [];
150149

151-
/** Parse class attribute from default wrapper */
150+
// Parse class attribute from default wrapper.
152151
if ( \preg_match( '/class=["\']([^"\']+)["\']/', $default_wrapper_attributes, $matches ) ) {
153152
$all_classes = \explode( ' ', $matches[1] );
154153
foreach ( $all_classes as $class ) {
155154
$class = \trim( $class );
156-
/** Only include classes that contain "-size" (e.g., has-small-size) */
155+
// Only include classes that contain "-size" (e.g., has-small-size).
157156
if ( ! empty( $class ) && \strpos( $class, '-size' ) !== false ) {
158157
$custom_classes[] = $class;
159158
}
160159
}
161160
}
162161

163-
/** Build wrapper div classes */
162+
// Build wrapper div classes.
164163
$wrapper_div_classes = [ 'wp-block-buttons' ];
165164
if ( ! empty( $custom_classes ) ) {
166165
$wrapper_div_classes = \array_merge( $wrapper_div_classes, $custom_classes );

0 commit comments

Comments
 (0)