Files
WP-Multi-Wiki/templates/admin/categories.php
2026-03-18 21:56:40 +01:00

46 lines
2.3 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php if ( ! defined( 'ABSPATH' ) ) exit;
$terms = get_terms(array('taxonomy'=>'wmw_category','hide_empty'=>false,'orderby'=>'name','order'=>'ASC'));
?>
<div class="wrap wmw-admin-wrap">
<div class="wmw-admin-header wmw-admin-header--small">
<div class="wmw-admin-header__logo">
<span class="wmw-admin-header__icon">🏷️</span>
<div><h1>Wiki-Kategorien</h1></div>
</div>
<a href="<?php echo admin_url('admin.php?page=wp-multi-wiki'); ?>" class="button">← Dashboard</a>
</div>
<div class="wmw-form-layout">
<div class="wmw-form-main">
<div class="wmw-card">
<h3 class="wmw-card__title">Vorhandene Kategorien</h3>
<?php if(empty($terms) || is_wp_error($terms)): ?>
<p class="description">Noch keine Kategorien. Füge unten deine erste hinzu.</p>
<?php else: ?>
<table class="wp-list-table widefat fixed striped">
<thead><tr><th>Name</th><th>Slug</th><th>Artikel</th><th>Aktionen</th></tr></thead>
<tbody>
<?php foreach($terms as $term): ?>
<tr>
<td><strong><?php echo esc_html($term->name); ?></strong></td>
<td><?php echo esc_html($term->slug); ?></td>
<td><?php echo $term->count; ?></td>
<td>
<a href="<?php echo admin_url('edit-tags.php?action=edit&taxonomy=wmw_category&tag_ID='.$term->term_id); ?>" class="button button-small">✏️ Bearbeiten</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
</div>
</div>
<div class="wmw-form-sidebar">
<div class="wmw-card">
<h3 class="wmw-card__title"> Neue Kategorie</h3>
<p><a href="<?php echo admin_url('edit-tags.php?taxonomy=wmw_category'); ?>" class="button button-primary wmw-btn-full">Kategorien in WordPress verwalten</a></p>
<p class="description">Kategorien können über die Standard-WordPress-Taxonomieseite erstellt und bearbeitet werden.</p>
</div>
</div>
</div>
</div>