next_tag() ) { return $html; } $tags->set_attribute( 'data-rooster-ui', \RoosterLMS\Blocks\Markup::ui( $module ) ); foreach ( Dock::attributes( $key ) as $name => $value ) { if ( 'class' === $name ) { foreach ( explode( ' ', $value ) as $one ) { $tags->add_class( $one ); } } else { $tags->set_attribute( $name, $value ); } } return $tags->get_updated_html(); } private static function panel( string $html, string $key, string $title, string $module ): string { $state = Dock::panel_state( $key ); $tags = new \WP_HTML_Tag_Processor( $html ); if ( ! $tags->next_tag() ) { return $html; } $tags->set_attribute( 'data-rooster-ui', \RoosterLMS\Blocks\Markup::ui( $module ) ); foreach ( $state['classes'] as $one ) { $tags->add_class( $one ); } $tags->set_attribute( 'data-rl-dock-panel', '' ); if ( '' !== $state['style'] ) { $tags->set_attribute( 'style', $state['style'] ); } $html = $tags->get_updated_html(); $end = strpos( $html, '>' ); if ( false === $end ) { return $html; } return substr( $html, 0, $end + 1 ) . Dock::head( $title, Dock::layout( $key ), $state['folded'] ) . substr( $html, $end + 1 ); } }