ndiego / icon-block

Effortlessly add SVG icons and graphics to your website.
https://nickdiego.com/projects/icon-block/
GNU General Public License v2.0
104 stars 14 forks source link

Flip Vertical in Editor does not save correctly #4

Closed lagset closed 2 years ago

lagset commented 2 years ago

Environtment

Wordpress 5.8.2

Using this plugin in combination with the plugin wp-rest-blocks which exposes block attributes in the Wordpress RestAPI.

Problem

Playing around with this plugin I encountered the following: The block attribute flipHVertical does not Update in the RestAPI and thus leads to a faulty block when a post with an icon-block which has flipped vertically is reloaded in the editor ("This block contains unexpected or invalid content").

Possible Soloution

I just skimmed through your source code and found that in block.json you defined the following attributes:

  "flipHorizontal": {
      "type": "boolean"
  },
  "flipHVertical": {
      "type": "boolean"
  },

I guess flipHVertical may be a typo and should be replaced by flipVertical.

BTW: great plugin, I am enjoying working with it and it was kind of what I was searching for.