import svg-files from wxr – (upload works, import not)

Found my solution after a little more digging. The problem lies in wordpress-importer Found this from jan 30 on github: https://github.com/WordPress/wordpress-importer/issues/47?_pjax=%23js-repo-pjax-container Then later the solution here: https://www.playnicetogether.com/2015/11/07/wordpress-importer-plugin-content-length-problem-solved/ “the WordPress Importer plugin is not compatible with remote servers that use HTTP compression.” For WordPress v4.6 and above, please use the following: add_filter( ‘http_request_args’, function( $r, $url … Read more

Expected an identifier and instead saw ‘

If you use JSX in your code, then you need to build the script before using it on “standard” WordPress sites where JSX is not available. So, Either build the script.. Or (looking at your code, it’s probably easier to just) use (ES5 with) wp.element.createElement() and not JSX: var MyIcon = function () { var … Read more

WordPress Block.js SVG createElement

Basically, when using wp.element.createElement(), For attribute names having special characters like a hypen/-, the name should be put in single/double quotes: e.g. ‘data-name’ and not simply data-name. createElement( ‘svg’, { ‘data-name’: ‘Layer 1’ // like this data-name: ‘Layer 1’ // not this } ); The same also goes to attribute names like class which is … Read more

Swap SVG icons in child themes

I see that both icon arrays ($ui_icons and $social_icons) in Twenty Nineteen can be accessed publicly, so I managed to replace any icon via the init hook in a child theme. An example: function child_init() { TwentyNineteen_SVG_Icons::$social_icons[‘instagram’] = ‘<svg>… Insert new Instagram icon SVG code here …</svg>’; } add_action( ‘init’, ‘child_init’ );

SVG Upload to WordPress Issue

I’ve established this is a plugin/theme conflict. I will report back when I know more. I tested this on a couple of my other client’s websites that are on different servers but share similar themes/plugins, and sure enough, I can upload SVGs.

SVG icons in Twenty Nineteen

You shouldn’t need to change the viewbox attribute. You can probably just use it. The way I think about is SVGs are like they are drawn on graph paper. The viewbox sets out how many squares there are on the paper and the the path in your examples above are the guides to where to … Read more