Make WordPress Core


Ignore:
Timestamp:
01/19/2021 11:48:59 AM (6 years ago)
Author:
gziolo
Message:

Blocks: Add automatic RTL handlind for block styles registered from metadata

Related Gutenberg issue: https://github.com/WordPress/gutenberg/pull/28274

With this change it is going to be possible to use the same pattern that wp_style_add_data uses for RTL handling. If the block style file with "-rtl.css" is included in addition to the regular style referenced in "block.json" file then it is going to be automatically registered.

Props swisspidy, aristath.
See #52301.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/blocks/register.php

    r49981 r49982  
    270270
    271271                $this->assertSame( 'unit-tests-test-block-style', $result );
     272                $this->assertSame( 'replace', wp_styles()->get_data( 'unit-tests-test-block-style', 'rtl' ) );
    272273        }
    273274
Note: See TracChangeset for help on using the changeset viewer.