'default', // Styles: default, tabs, accordion, grid, timeline 'cats' => '0', // Show Categories? 1 = yes, 0 = no 'cpt' => '0', // Show Custom Post Types? 1 = yes, 0 = no 'woo' => '0' // Show WooCommerce products? 1 = yes, 0 = no ], $atts); // Sanitize style value to allowed options $allowed_styles = ['default', 'tabs', 'accordion', 'grid', 'timeline']; if (!in_array($atts['style'], $allowed_styles, true)) { $atts['style'] = 'default'; } // Determine which sections to show $show_categories = ($atts['cats'] === '1'); $show_cpt = ($atts['cpt'] === '1'); $show_woo = ($atts['woo'] === '1' && class_exists('WooCommerce')); ob_start(); ?>

' . esc_html($cat->name) . ''; } ?>

false, 'public' => true], 'names'); foreach ($post_types as $pt) { $posts = get_posts(['post_type' => $pt, 'posts_per_page' => -1]); if (!empty($posts)) { echo '

' . esc_html(ucfirst($pt)) . '

'; } } ?>