Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #51612, comment 29


Ignore:
Timestamp:
11/24/2020 10:43:34 AM (3 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51612, comment 29

    v1 v2  
    1 May be overthinking this but [49608] seems to introduce two "states" of WP_Block. When it is instantiated it has unfiltered (wrong?) data, then after `render()` is run the data is reset to the filtered values.
     1May be overthinking this but [49608] seems to introduce two "states" of WP_Block. When it is instantiated it has unfiltered (wrong?) data, then after `render()` is run the data is reset to the filtered values. As far as I understand WP_Block was modeled after WP_Post that is (mostly) static in nature.
    22
    33This seems to bring a lot of complexity/possible confusion when using it, and some back-compat concerns. Before [49608] WP_Block was instantiated with the filtered data that was (more or less) immutable while the instance is used. Now the data is mutated after `render()` (hence the need for `WP_Block::reset()`, `__get()`, etc.).