new file: olm-login.php

This commit is contained in:
Sven Steinert
2026-05-27 14:17:22 +02:00
parent 1d4cf6e727
commit e99acdce47
25 changed files with 36226 additions and 630 deletions

View File

@@ -1,5 +1,8 @@
<?php
defined('ABSPATH') || exit;
$product_item = is_array($product_item ?? null) ? $product_item : [];
$parts = (array) ($product_item['parts'] ?? []);
$page_link_slugs = (array) ($page_link_slugs ?? []);
?>
<section class="kb-docs-version">
<header class="kb-doc-header">
@@ -26,8 +29,19 @@ defined('ABSPATH') || exit;
</header>
<ul class="kb-page-list">
<?php foreach ((array) $pages as $page) : ?>
<?php $slug = (string) get_post_meta($page->ID, '_kb_page_slug', true); ?>
<li><a href="<?php echo esc_url($url_builder::page($product->slug, $version->slug, $slug)); ?>"><?php echo esc_html(get_the_title($page)); ?></a></li>
<?php
$slug = (string) ($page_link_slugs[$page->ID] ?? get_post_meta($page->ID, '_kb_page_slug', true));
$sourceSlug = (string) get_post_meta($page->ID, '_kb_product_slug', true);
$part = (array) ($parts[$sourceSlug] ?? []);
?>
<li>
<a href="<?php echo esc_url($url_builder::page($product->slug, $version->slug, $slug)); ?>">
<?php if (! empty($part['label']) && count($parts) > 1) : ?>
<span class="kb-page-list__part"><?php echo esc_html((string) $part['label']); ?></span>
<?php endif; ?>
<?php echo esc_html(get_the_title($page)); ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</section>