block-unit-test
block-unit-test copied to clipboard
Better test for updated content.
The test page is created once and only updated with the content included in the code when the plugin is updated.
However there are 2 issues with the way this is done right now.
Firstly, if you add/remove theme support for align-wide
, and the content has already been created, it will NOT be modified to include the tests for wide aligned blocks.
Secondly, because the plugin relies on the hook upgrader_process_complete
, if you update the plugin in any way other than using the admin UI - it will not be updated. (e.g if updating manually, or through composer)
I think you could handle this in a way that is more compatible with both of these use cases. Some ideas:
- Use a filter on the content to ensure the bundled content is always used.
- Store a hash of the content in post meta and use this to track which version of the content is stored and only update if it has changed.
Intersting points @mattheu! Those are good ideas.