wordpresstimber

Timber footer returns svg?


I actually build a site with timber, below is my composer json :

{
  ...,
  "autoload": {
  "psr-4": {
      "App\\": "src/"
    }
 },
 "require": {
    "timber/timber": "1.18",
    "hellonico/timber-dump-extension": "^1.0",
    "guzzlehttp/guzzle": "^7.0"
 },
 "require-dev": {
    "symfony/var-dumper": "^5.3"
 },
 "config": {
    "allow-plugins": {
      "composer/installers": true
    }
 }

}

my footer template : {{function("wp_footer")}}</body></html>

Oddly, this snippet, doesn't outputs registered scripts but some svg tags that I don't know where they come from (image below)footer output.

here how i register my script : wp_register_script('myjs', APP_DIR_URI .'/dist/js/myjs.js', ['jQuery'], "1.0.0", true); wp_enqueue_script('prono');

Could you please explain me why have this issue, is this related to the version of timber or something else ?

Thank you


Solution

  • That comes with a new WordPress block themes and specifically theme.json file. You may find more about this file and how to use it here

    File not just renders svg-filters but creates inline global styles on every page. If you wish to "disable" it (you cannot disable it but you may override such behavior with desired) you may create theme.json file at the root of your theme with following content

    {
        "version": 2,
        "settings": {
            "color": {
                "duotone": null,
                "palette": null,
                "gradients": null
            },
            "typography": {
                "fontSizes": null
            }
        },
        "styles": null,
        "variables": null,
        "presets": null
    }