• Resolved Tim

    (@timstl)


    Hello,

    Is it possible to add custom icons for tabs, rather than choose from preexisting? I found some information in the plugin changelog that suggested maybe there is a filter I could use, but I haven’t been able to find it. And also a knowledge base article but the instructions seem to be dated. Could someone point me in the right direction?

    Thanks,

    Tim

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hey Tim,
    The pro version has an interface for this where you can use custom icons generated from icomoon (icomoon lets you upload custom svgs or choose from any of their supported icons and is free to use).

    There is no feature in the free version to manage this for you.

    There is a filter in javascript to filter in svg information (this is what the pro version hooks into).

    You can filter in icon names via kadence.icon_options_names

    And the custom svg content via kadence.icon_options

    I don’t have any docs or example put up at this time.

    You can read about javascript filters here: https://developer.www.ads-software.com/block-editor/packages/packages-hooks/

    I hope that helps.

    Thread Starter Tim

    (@timstl)

    Thanks. I’ll check out the pro version in this case, but good to know those filters exist as well.

    Thread Starter Tim

    (@timstl)

    I marked this as resolved because the Pro version is just what I need, but I ran into one issue that I’m having trouble with:

    After generating the files at Icomoon, I uploaded the selection.json. The icons appear in the admin, and are selectable for tab titles. I added them to tabs, and they show up in the admin as expected.

    On the front-end, the paths of these icons are stripped out, and only an empty <svg> tag appears.

    <svg style="display:inline-block;vertical-align:middle" viewbox="0 0 24 24" height="14" width="14" fill="currentColor" xmlns="https://www.w3.org/2000/svg"></svg>

    The selection.json is:

    {"IcoMoonType":"selection","icons":[{"icon":{"paths":["M512 121.6c74.227 0 134.4 60.173 134.4 134.4s-60.173 134.4-134.4 134.4c-74.227 0-134.4-60.173-134.4-134.4v0c0-74.227 60.173-134.4 134.4-134.4v0zM512 697.6c190.080 0 390.4 93.44 390.4 134.4v70.4h-780.8v-70.4c0-40.96 200.32-134.4 390.4-134.4zM512 0c-141.385 0-256 114.615-256 256s114.615 256 256 256c141.385 0 256-114.615 256-256v0c0-141.385-114.615-256-256-256v0zM512 576c-170.88 0-512 85.76-512 256v192h1024v-192c0-170.24-341.12-256-512-256z"],"attrs":[{}],"isMulticolor":false,"isMulticolor2":false,"grid":0,"tags":["icon-by-firm"]},"attrs":[{}],"properties":{"order":2,"id":1,"name":"icon-by-firm","prevSize":32,"code":59648},"setIdx":0,"setId":0,"iconIdx":0},{"icon":{"paths":["M153.718 1024c-84.824 0-153.587-68.763-153.587-153.587s68.763-153.587 153.587-153.587v-0c4.353 0 9.011 0.218 13.408 0.609l165.080-275.22c-15.623-23.653-24.923-52.677-24.923-83.872 0-84.824 68.763-153.587 153.587-153.587s153.587 68.763 153.587 153.587c0 31.195-9.3 60.219-25.28 84.448l0.357-0.576 164.949 275.177q6.704-0.609 13.408-0.609c3.439 0 6.791 0 10.143 0.348l272.478-476.955c-16.719-24.227-26.705-54.22-26.705-86.545 0-84.824 68.763-153.587 153.587-153.587s153.587 68.763 153.587 153.587c0 84.824-68.763 153.587-153.587 153.587-0.009 0-0.017-0-0.026-0l0.001 0c-3.439 0-6.791 0-10.143-0.392l-272.39 476.999c16.734 24.235 26.73 54.241 26.73 86.581 0 84.824-68.763 153.587-153.587 153.587s-153.587-68.763-153.587-153.587c0-31.181 9.292-60.192 25.258-84.415l-0.357 0.577-165.080-275.177c-4.353 0.392-8.707 0.609-13.408 0.609s-9.011-0.218-13.408-0.609l-165.123 275.177c15.635 23.656 24.943 52.686 24.943 83.889 0 84.784-68.718 153.517-153.495 153.543l-0.002 0z"],"attrs":[{"fill":"rgb(110, 111, 114)"}],"width":1331,"isMulticolor":false,"isMulticolor2":false,"grid":0,"tags":["icon-by-product"]},"attrs":[{"fill":"rgb(110, 111, 114)"}],"properties":{"order":3,"id":0,"name":"icon-by-product","prevSize":32,"code":59649},"setIdx":0,"setId":0,"iconIdx":1}],"height":1024,"metadata":{"name":"icomoon"},"preferences":{"showGlyphs":true,"showQuickUse":true,"showQuickUse2":true,"showSVGs":true,"fontPref":{"prefix":"icon-","metadata":{"fontFamily":"icomoon"},"metrics":{"emSize":1024,"baseline":6.25,"whitespace":50},"embed":false},"imagePref":{"prefix":"icon-","png":true,"useClassSelector":true,"color":0,"bgColor":16777215,"classSelector":".icon"},"historySize":50,"showCodes":true,"gridSize":16}}

    Any ideas what I can change to get this working?

    Thanks,

    Tim

    Are you on a multisite? If so you will need to install this plugin so that WordPress doesn’t strip your svg content because of some outdated HTML filtering (there are open tickets and hopefully this will be fixed at some point)

    https://www.ads-software.com/plugins/unfiltered-mu/

    Thread Starter Tim

    (@timstl)

    No, not on multisite.

    The non-custom icons load correctly in the tabs.

    I’m using other SVGs on the site in my theme, but they are all loaded by PHP functions either in ACF Blocks or put directly into my templates.

    I see, this is my issue, bug in tabs. Icon works else where. I’ll update today.

    Ben

    Thread Starter Tim

    (@timstl)

    Hi Ben,

    I installed the available update for Pro, tried re-uploading the icon file, and tried editing the tabs and re-submitting. I’m still seeing the same issue — anything else I need to do?

    Thanks,

    Tim

    Sorry for the delay, I pushed out an update 1.8.0 today. It will fix the tabs issue.

    Ben

    Thread Starter Tim

    (@timstl)

    Worked, thanks for the quick fix.

    Tim

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom tab icons?’ is closed to new replies.