ndiego / icon-block

Effortlessly add SVG icons and graphics to your website.
https://nickdiego.com/projects/icon-block/
GNU General Public License v2.0
104 stars 14 forks source link

Request: Enhanced Icon Category Support #40

Open MadtownLems opened 4 months ago

MadtownLems commented 4 months ago

We're trying to use what would effectively be two taxonomies for our Icon categories. Ideally, we'd love to have them separated in the UI:

Animals

Plants

(Note that we don't want them to be separate Icon Types because icons can have terms from multiple taxonomies).

A less-involved approach might be simply letting us opt out of sorting the Icons alphabetically, and just presenting them in the order they are present in the array. That would at least let us group the terms of each taxonomy together. This method would benefit from the ability to add labels/headings in the array, but that's probably getting a bit "out there", especially as it feels like a wonky workaround for just supporting multiple taxonomies, which I assume is out of scope. Something like:

const customIconCategories = [ { name: 'Animals', title: __( 'Zebra', 'ext-icon-block-modifier' ), is_heading: true }, { name: 'cats', title: ( 'Cats', 'ext-icon-block-modifier' ), }, { name: 'dogs', title: ( 'Dogs', 'ext-icon-block-modifier' ), }, { name: 'Plants', title:__('Plants', 'ext-icon-block-modifier', is_heading: true } ];

Cheers!