Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter maxiclo

    (@maxiclo)

    Hi,
    The child theme was NOT active. My bad!

    It works now!!

    Why you don’t put RUST in the standard list and/or an option to activate more languages??

    Thanks a lot for your support!!

    Keep it on this great job!

    Thread Starter maxiclo

    (@maxiclo)

    Hi sorry for the late answer and thanks for looking at this.

    After your notes I have added back the following code to the Child: Theme Functions (functions.php):
    function my_custom_languages( $languages ) {
    $languages[] = array(‘slug’ => ‘rust’, mode => ‘rust’, ‘label’ => ‘RUST’) ;

    return $languages;
    }
    add_filter( ‘advanced_gutenberg_blocks_code_languages’, ‘my_custom_languages’ );

    Unfortunately, RUST language do not appear as a Language option 🙁

    Thread Starter maxiclo

    (@maxiclo)

    Just to confirm that yes:
    RUST is a C-like language

    Thread Starter maxiclo

    (@maxiclo)

    Hi,
    thanks for supporting this!!

    Now:
    function my_custom_languages( $languages ) {
    $languages[] = array(‘slug’ => ‘rust’, mode => ‘rust’, ‘label’ => ‘RUST’) ;

    return $languages;
    }
    add_filter( ‘advanced_gutenberg_blocks_code_languages’, ‘my_custom_languages’ );

    is correctly added to theme Functions – (functions.php) but again, if I select RUST as the language the preview on backend side works but the view post never show up and the page gets stuck trying to load 🙁 (blank page)

    Thread Starter maxiclo

    (@maxiclo)

    I have a child theme installed.

    Unfortunately, I got:

    Your PHP code changes were rolled back due to an error on line 35 of file wp-content/themes/theme-child/functions.php. Please fix and try saving again.

    Uncaught Error: Call to undefined function add_filters() in wp-content/themes/theme-child/functions.php:35

    If I change:
    add_filters( ‘advanced_gutenberg_blocks_code_languages’, ‘my_custom_languages’ );
    with
    add_action( ‘advanced_gutenberg_blocks_code_languages’, ‘my_custom_languages’ );

    The functions.php will update.

    However, if I select RUST as the language the preview on backend side works but the view post never show up and the page gets stuck!!

    Still, works if I select C++ for example as language.

    Thanks for the support!

    • This reply was modified 7 years, 4 months ago by maxiclo.
    Thread Starter maxiclo

    (@maxiclo)

    That is really appreciated. Thanks for this useful plugin!

Viewing 6 replies - 1 through 6 (of 6 total)