Support

Account

Home Forums Gutenberg Block 'Supports' not working as expected Reply To: Block 'Supports' not working as expected

  • Hi Igladdy, thanks the reply!

    I have tried it on both ACF 5.9 and ACF 5.10.

    In ACF 5.9 it works fine. I noticed that in ACF 5.9, when I do a var_dump of the block, the array for padding is a bit different:

        [style] => Array
            (
                [spacing] => Array
                    (
                        [padding] => Array
                            (
                                [top] => 200px
                                [right] => 200px
                                [bottom] => 200px
                                [left] => 200px
                            )
    
                    )
    
                [typography] => Array
                    (
                        [lineHeight] => 2.1
                    )
    
            )
    

    Whereas with ACF 5.10 it’s like this:

    [style] => Array
            (
               [paddingTop] => 200px
               [paddingRight] => 200px
               [paddingBottom] => 200px
               [paddingLeft] => 200px
               [typography] => Array
                    (
                        [lineHeight] => 2.1
                    )
            )
    

    I changed the way the PHP template finds the padding to compensate for this, eg:

    if(isset($block['style']['paddingTop'])) {$inlineStyles .= 'padding-top:' . $block['style']['paddingTop'] . ';' ;}

    But it won’t save as described above.