• Resolved bytegenius

    (@bytegenius)


    Hi,

    I’m using this plugin on my website. I mostly write Java codes and I wanted to set the default language to “Java”.
    As of now, it is set to “Plain Text”.

    How to change that? or If I can change per category?
    FYI, I use Gutenberg Visual Mode.

Viewing 1 replies (of 1 total)
  • Plugin Author Renatho (a11n)

    (@renathoc)

    Hi!

    You can use this action to override the default language:

    
    add_action( 'enqueue_block_editor_assets', function() {
    	wp_add_inline_script(
    		'syntaxhighlighter-blocks',
    		'if ( syntaxHighlighterData ) { syntaxHighlighterData.settings.language.default = "java" }',
    		'before'
    	);
    } );
    

    I just didn’t understand exactly what you mean about the category. But depending on what you mean about that, you could add as a customization to this code. 😉

Viewing 1 replies (of 1 total)
  • The topic ‘How to Set a Default Language Parameter’ is closed to new replies.