Skip to content

Commit a49f0e0

Browse files
committed
fix: improve classname checks
1 parent 81ee30d commit a49f0e0

1 file changed

Lines changed: 3 additions & 3 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
@@ -103,11 +103,11 @@ public static function render_block( $attrs ) {
103103
$label = $is_signed_in ? $signed_in_label : $signed_out_label;
104104

105105
// Display mode from block style class in className (default = icon + text).
106-
$wrapper_class = (string) $attrs['className'];
107-
if ( \strpos( $wrapper_class, 'is-style-icon-only' ) !== false ) {
106+
$classes = explode( ' ', (string) $attrs['className'] );
107+
if ( in_array( 'is-style-icon-only', $classes, true ) ) {
108108
$show_label = false;
109109
$show_icon = true;
110-
} elseif ( \strpos( $wrapper_class, 'is-style-text-only' ) !== false ) {
110+
} elseif ( in_array( 'is-style-text-only', $classes, true ) ) {
111111
$show_label = true;
112112
$show_icon = false;
113113
} else {

0 commit comments

Comments
 (0)