KevinBatdorf / code-block-pro

A Gutenberg code block with syntax highlighting powered by VS Code
https://code-block-pro.com
132 stars 10 forks source link

Add filter to globally disable font loading #344

Open zackpyle opened 3 weeks ago

zackpyle commented 3 weeks ago

This PR adds a filter that allows users to globally disable custom font loading.

Changes

Usage

Users can disable font loading globally by adding this to their theme or plugin:


add_filter('code_block_pro_load_fonts', '__return_false');
KevinBatdorf commented 3 weeks ago

It's a good idea but my only concern here is adding a new api I'd have to support forever, and I'm about to start a rewrite of the plugin. In the rewrite I want to have global profiles that would make changes like this trivial. It will be a lot of work though to rewrite it.

Were you not able to do it by nulling the plugin Url?

zackpyle commented 3 weeks ago

I was just worried that since it wasn't specific to the fonts that it wasn't necessary a permanent solution

KevinBatdorf commented 3 weeks ago

The only thing that would mess up is whether I added a new feature that pulled in an external asset which I can't imagine doing.

I think you're safe to do it but I'll think a bit more on adding an API to disable it directly too.