| | |
| | | } |
| | | |
| | | use JVBase\registrar\Registrar; |
| | | use JVBase\registry\TaxonomyRegistrar; |
| | | use WP_Error; |
| | | use Exception; |
| | | |
| | |
| | | { |
| | | public function __construct() |
| | | { |
| | | if (empty(Registrar::getFeatured('is_content', 'term'))){ |
| | | if (empty(Registrar::withFeature('is_content', 'term'))){ |
| | | return; |
| | | } |
| | | add_filter(BASE.'handle_bulk_operation', [ $this, 'processOperation' ], 10, 3); |
| | |
| | | // Handle individual taxonomy rebuild |
| | | if (isset($_POST['rebuild_taxonomy']) && wp_verify_nonce($_POST['_wpnonce'], 'rebuild_taxonomy')) { |
| | | $taxonomy = sanitize_text_field($_POST['taxonomy']); |
| | | $registrar = Registrar::getInstance($taxonomy)); |
| | | $registrar = Registrar::getInstance($taxonomy); |
| | | if ($registrar && $registrar->hasFeature('is_content')) { |
| | | $results = $this->rebuildCustomTable($taxonomy); |
| | | // Store results in transient to display after redirect |
| | |
| | | </thead> |
| | | <tbody> |
| | | <?php |
| | | $taxonomies = Registrar::getFeatured('is_content', 'term'); |
| | | $taxonomies = Registrar::withFeature('is_content', 'term'); |
| | | foreach ($taxonomies as $slug): |
| | | $registrar = Registrar::getInstance($slug); |
| | | $taxonomy = BASE . $slug; |
| | |
| | | |
| | | <?php foreach ($results['details'] as $taxonomy => $detail): ?> |
| | | <details> |
| | | <summary class="row btw"> |
| | | <summary class="row x-btw"> |
| | | <strong><?= esc_html(ucfirst($taxonomy)) ?></strong> |
| | | <?php if ($detail['errors'] === 0): ?> |
| | | <span style="color: green;">✓ Success</span> |
| | |
| | | ]; |
| | | |
| | | // Check if this is a content taxonomy |
| | | $registrar = Registrar::getInstance($taxonomy)); |
| | | $registrar = Registrar::getInstance($taxonomy); |
| | | if (!$registrar->hasFeature('is_content')) { |
| | | $results['messages'][] = "Taxonomy {$taxonomy} is not a content taxonomy"; |
| | | return $results; |