$line ) { $parts = array_map( 'trim', explode( '|', $line ) ); $label = (string) ( $parts[0] ?? '' ); $href = (string) ( $parts[1] ?? '' ); if ( '' === $label || '' === $href ) { continue; } $kind = in_array( (string) ( $parts[2] ?? '' ), [ 'download', 'dark', 'light' ], true ) ? (string) $parts[2] : ( 0 === $i ? 'download' : 'light' ); $small = (string) ( $parts[3] ?? '' ); $icon = sanitize_key( (string) ( $parts[4] ?? '' ) ); $size = 'download' === $kind ? 20 : 15; $glyph = ''; if ( in_array( $icon, $own, true ) ) { $glyph = ''; } elseif ( '' !== $icon && function_exists( 'rooster_icon' ) ) { $glyph = rooster_icon( $icon, [ 'width' => $size, 'height' => $size, 'class' => 'rooster-cta-row__icon' ] ); } $other = (string) wp_parse_url( $href, PHP_URL_HOST ); $external = '' !== $other && $other !== $host; $words = '' !== $small ? '' . esc_html( $label ) . '' . esc_html( $small ) . '' : esc_html( $label ); $sr = $external ? ' ' . esc_html__( '(opens in a new tab)', 'ai-eshop-optimizer' ) . '' : ''; $buttons .= '' . $glyph . $words . $sr . ''; } if ( '' === $buttons ) { return; } $note = trim( (string) ( $attributes['note'] ?? '' ) ); $justify = 'left' === (string) ( $attributes['justify'] ?? '' ) ? 'left' : 'center'; $wrapper = AIEO_Engine_Blocks::wrapper( $library, [ 'class' => 'rooster-cta-row rooster-cta-row--' . $justify, 'data-rooster-ui' => 'rooster-one/action' ] ); AIEO_Engine_Blocks::out( sprintf( '
' . AIEO_Engine_Blocks::inline( $note ) . '
' : '' ) );