$detailAttr = $this->config['addOns']['glm-member-db']['shortcodes']['glm-member-detail']['attributes'];
$featuredAttr = $this->config['addOns']['glm-member-db']['shortcodes']['glm-member-featured']['attributes'];
$glmcat = new GlmDataCategories( $this->wpdb, $this->config );
- $categories = $glmcat->getList('', 'T.name');
+ // $categories = $glmcat->getList('', 'T.name');
+ $cats = $glmcat->getListSortedParentChild();
+ $categories = [];
+ foreach($cats as $cat){
+ if( !$cat['parent']['value'] ){
+ $cat['class'] = "glma-category-parent";
+ }else{
+ $cat['class'] = "glma-category-child";
+ }
+ $categories[$cat['id']] = $cat;
+ }
// get the each addOn slugs to pass to the config array later
$addOns = $this->config['addOns'];
<select id="shortcode-categories" class="shortcode-selection" data-type="categories">
<option disabled selected> Select Category </option>
{foreach $categories as $key => $value}
- <option data-type="categories" value="{$key}">{$value.name}</option>
+ <option class="{$value.class}" data-type="categories" value="{$key}">
+ {if $value.class == 'glma-category-child'}
+
+ {/if}
+ {$value.name}
+ </option>
{/foreach}
</select>
<select id="shortcode-blankstart" class="shortcode-selection" data-type="blankstart">
</div>
+<style>
+ .glma-category-parent{
+ font-weight: bold;
+ }
+ .glma-category-child{
+ font-style:italic;
+ padding-left: 10px;
+ }
+ .glma-category-child::before{
+ content: "-";
+ }
+</style>
\ No newline at end of file