• Resolved bw10

    (@bw10)


    Really liking the plug-in!

    Curious, how does one set or override the options that are set in this plug-in?

    For example: I see src/save.js there is a setting for “iconWidth”. I’d like to either be able to set this to something other than 48px for all icons or just my custom icon set. I’d even like to set the color too.

    Is something like this possible?

Viewing 1 replies (of 1 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi @bw10,

    Thank you for reaching out and I apologize for the delayed reply! Unfortunately, there is no current way to override the defaults via the plugin directly.

    That said, you can create a block variation that should accomplish what you are looking for. If you create and enqueue a JavaScript file in your theme with the following code, you will see a new block called “Custom Icons” in the Inserter. When you use this block, the icons will be 24px wide by default and have the icon color #FF7700 (orange). The original block will be hidden since we have told WordPress that this new block is the default.

    wp.domReady( () => {
    	wp.blocks.registerBlockVariation( 'outermost/icon-block', {
    		name: 'custom-icons',
    		title: 'Custom Icons',
    		isDefault: true,
    		attributes: { width: 24, iconColorValue: "#FF7700" },
    	} );
    } );
    

    You can of course modify the code to meet your needs. I will try and get a more thorough tutorial on how to do this put together over the weekend. Once complete, I will link here.

    Let me know if I can be of further assistance.

    Best,
    Nick

    • This reply was modified 2 years, 4 months ago by Nick Diego.
Viewing 1 replies (of 1 total)
  • The topic ‘Default Settings (Options)’ is closed to new replies.