• https://github.com/westonruter/syntax-highlighting-code-block/wiki/Advanced-Usage#change-block-defaults

    Document says that we can override default but not, because the init() function calls register_editor_assets() directly and ‘syntaxHighlightingCodeBlockType’ declared with ‘const’ so that we cannot override ??

    Please just add hook for default attributes,

    syntax-highlighting-code-block.php:191
    function init() {
    ......
    $attributes = [
        'language'         => [
            'type'    => 'string',
            'default' => '',
        ],
        'highlightedLines' => [
            'type'    => 'string',
            'default' => '',
        ],
        'showLineNumbers'  => [
            'type'    => 'boolean',
            'default' => false,
        ],
        'wrapLines'        => [
            'type'    => 'boolean',
            'default' => false,
        ],
    ];
    $attributes = apply_filters( 'syntax-highlighting-code-block-attributes', $attributes );
    
    ......
    }

    And languages ( not every sites needs All supported languages ?? )

    syntax-highlighting-code-block.php:460
    function get_language_names() {
    	$languages = require __DIR__ . '/language-names.php';
    	return apply_filters( 'syntax-highlighting-code-block-languages', $languages );
    } 

    Thanks in advance

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Hook for default attributes’ is closed to new replies.