%s
', get_block_wrapper_attributes( [ 'class' => 'rooster-docs__chapters' ] ), esc_html__( "The manual's chapters print here.", 'ai-eshop-optimizer' ) ) ); } return; } $current = AIEO_Docs::current_term(); $post_id = is_singular() ? (int) get_queried_object_id() : 0; $path = $current ? array_merge( [ (int) $current->term_id ], get_ancestors( (int) $current->term_id, 'category', 'taxonomy' ) ) : []; $id = wp_unique_id( 'rooster-docs-' ); $phone = function_exists( 'rooster_device_class' ) && 'mobile' === rooster_device_class(); $on = static function ( string $directive ) use ( $phone ): string { return $phone ? '' : ' ' . $directive; }; $pages = static function ( WP_Term $term ) use ( $post_id ): string { $out = ''; foreach ( AIEO_Docs::pages( $term ) as $post ) { $is_current = (int) $post->ID === $post_id; $out .= '' . esc_html( $manual->name ) . '
'; $filter = ''; if ( ! empty( $attributes['filter'] ) ) { $filter = '' . '
'; } $tree = '' . esc_html__( 'No page matches.', 'ai-eshop-optimizer' ) . '
'; if ( $phone ) { $where = $chapter_now ? $chapter_now->name : $manual->name; $wrapper = get_block_wrapper_attributes( [ 'class' => 'rooster-docs__chapters is-compact', 'aria-label' => __( 'Chapters', 'ai-eshop-optimizer' ), 'data-rooster-ui' => 'rooster-one/docs-chapters', 'data-wp-interactive' => 'rooster-docs/chapters', ] ); $bar = ''; $sheet = ''; AIEO_Engine_Blocks::out( sprintf( '', $wrapper, $bar . $sheet ) ); return; } $wrapper = get_block_wrapper_attributes( [ 'class' => 'rooster-docs__chapters', 'aria-label' => __( 'Chapters', 'ai-eshop-optimizer' ), 'data-rooster-ui' => 'rooster-one/docs-chapters', 'data-wp-interactive' => 'rooster-docs/chapters', 'data-wp-context' => wp_json_encode( [ 'manual' => $manual->slug, 'remember' => $remember ] ), 'data-wp-init' => 'callbacks.init', ] ); AIEO_Engine_Blocks::out( sprintf( '', $wrapper, $manual_p . $filter . $tree ) );