'academy_courses_category', 'hide_empty' => ! empty( $attributes['hideEmpty'] ), 'number' => max( 1, min( 100, (int) $attributes['max'] ) ), 'orderby' => 'count', 'order' => 'DESC', ]; if ( ! empty( $attributes['parentOnly'] ) ) { $academy_args['parent'] = 0; } $academy_terms = get_terms( $academy_args ); if ( empty( $academy_terms ) || is_wp_error( $academy_terms ) ) { return; } // Layouts where the picture is the tile get a larger image. $academy_big_image = in_array( $academy_layout, [ 'image-cards', 'overlay', 'featured', 'carousel', 'circles' ], true ); $academy_show_desc = ! empty( $attributes['showDescription'] ) && ! in_array( $academy_layout, [ 'pills', 'circles' ], true ); $academy_arrow = ! empty( $attributes['showArrow'] ) && in_array( $academy_layout, [ 'horizontal', 'list' ], true ); // Categories without a picture get a coloured tile with their first letter, // each in the next colour of a small set so a row doesn't look uniform. $academy_tones = [ '#6c5ce7', '#0ea5e9', '#10b981', '#f59e0b', '#ef4444', '#ec4899', '#14b8a6', '#8b5cf6' ]; $academy_wrapper = get_block_wrapper_attributes( [ 'class' => 'academy-categories--' . $academy_layout, 'style' => '--academy-category-columns:' . $academy_columns . ';', ] ); ?>