• Any chance there is a filter to disable all fonts from loading? If not, any chance you’d add one?
    I have enqueued my own monospaced font, so I would love to disable another font from loading that isn’t being used ????

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kevin Batdorf

    (@kbat82)

    You should be able to set the font to system on the code block and it won’t load anything. Is that not working?

    It loads through JavaScript. Two things you can do to short circuit it is by adding the class cbp-ff-loaded to where ever the attribute data-code-block-pro-font-family is found, or by setting window.codeBlockPro.pluginUrl to null (only used for loading fonts currently)

    The code is here: https://github.com/KevinBatdorf/code-block-pro/blob/main/src/front/front.js#L101

    Thread Starter Zack Pyle

    (@zackpyle)

    Ok thanks. I’ll give it a try!

    I have used it in like 100 posts, so it’s not feasible to go in to each and set them all to system :/

    Thread Starter Zack Pyle

    (@zackpyle)

    Thanks Kevin! I’ve created a PR that adds a filter to handle this globally. You can check it out here. The PR adds a code_block_pro_load_fonts filter that is backwards compatible but gives an easy way to disable the fonts from loading globally. Let me know what you think!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.