encoding = 'utf-8'; if (version_compare(PHP_VERSION, '8.1.0', '>=')) { $map = array( 0x80, 0x10FFFF, 0, 0xFFFF ); $content = mb_encode_numericentity($content, $map, 'UTF-8'); } else { $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'); } $dom->loadHTML( $content ); $xpath = new DOMXpath($dom); $items = $xpath->query('//div[contains(@class, "carousel-item")]'); $class = trim( areoi_get_class_name_str( array( 'carousel', 'slide', ( !empty( $attributes['className'] ) ? $attributes['className'] : '' ), ( !empty( $attributes['style'] ) && empty( $attributes['item_style'] ) ? $attributes['style'] : '' ), ( !empty( $attributes['item_style'] ) ? $attributes['item_style'] : '' ), ( !empty( $attributes['transition'] ) ? $attributes['transition'] : '' ), ( !empty( $attributes['align'] ) ? 'align' . $attributes['align'] : '' ), ) ) . ' ' . areoi_get_display_class_str( $attributes, 'block' ) ); $block_id = ( !empty( $attributes['anchor'] ) ? '#' . esc_attr( $attributes['anchor'] ) : '.block-' . esc_attr( $attributes['block_id'] ) ); $buttons = null; if ( !empty( $attributes['controls'] ) && $items->length > 1 ) { $buttons = ' '; } $indicators = null; if ( !empty( $attributes['indicators'] ) && $items->length > 1 ) { $indicators = '