Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filter to globally disable font loading #344

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Oct 29, 2024

  1. Add font loading filter check

    Add support for the code_block_pro_load_fonts filter by checking loadFonts value before initiating font loading. This allows users to globally disable custom font loading via a filter when needed.
    
    This change:
    - Short-circuits font loading if loadFonts is false
    - Maintains backward compatibility
    zackpyle authored Oct 29, 2024
    Configuration menu
    Copy the full SHA
    dac1cea View commit details
    Browse the repository at this point in the history
  2. Add filter for font loading control

    Add code_block_pro_load_fonts filter to allow global control over font loading behavior. The filter value is passed to the frontend JavaScript contexts through the codeBlockPro object.
    
    Implementation:
    - Adds new loadFonts property to window.codeBlockPro
    - Default value of true maintains existing behavior
    - Can be disabled via add_filter('code_block_pro_load_fonts', '__return_false')
    zackpyle authored Oct 29, 2024
    Configuration menu
    Copy the full SHA
    a91866d View commit details
    Browse the repository at this point in the history