46 lines
2.3 KiB
PHP
46 lines
2.3 KiB
PHP
<?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>
|