micropackage / block-loader

Automatic WordPress Gutenberg block loader based on template files
GNU General Public License v3.0
24 stars 5 forks source link

Patch falsey values being converted to true #4

Closed ghost closed 3 years ago

ghost commented 3 years ago

When using Supports Multiple: true, the value gets casted to a false value when pushed through boolval. To solve this boolval is replaced with a ternary condition.

ghost commented 3 years ago

This pull request introduced a bug with the "styles" palette, I will revisit this soon and create a new pull request.

jakubmikita commented 3 years ago

Thanks @dafydd-orphans!

The coding style would be pretty simple here. you're probably missing some spaces and yoda conditions.

$value = ( 'true' === $value ) ? true : false;
ghost commented 3 years ago

Hi @Kubitomakita

Having debugged this further I believe my pull request was correct.

My subsequent issue with custom "styles" not being applied was caused by this comment in each of my block templates which started working with pull request update.

* Supports Custom Class Name: false

The coding style has been updated to match your suggestions.

Thanks!