WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51612, comment 35


Ignore:
Timestamp:
11/24/2020 03:55:48 PM (10 months ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51612, comment 35

    initial v1  
    88However thinking that resetting the properties after rendering (i.e. the class properties are different before running render(), while running render(), and after running render()) makes things more complex, and hard to understand and work with. Same for the magic `__get()`.
    99
    10 Probably missing something but what purpose/use case does this solve? Seems these properties can be instantiated with `null`, then set during `render()`. Why do they need to be unset/reset after that? `render_block()` calls `$block->render()` immediately after instantiating WP_Block, so these will be (should be) correct there.
     10Probably missing something but what purpose/use case does this solve? Seems these properties can be instantiated with `null` or the corresponding values from `$parsed_block`, then set/changed during `render()`. Why do they need to be unset/reset after that? `render_block()` calls `$block->render()` immediately after instantiating WP_Block, so these will be (should be) correct there.
    1111
    1212> Right but the sanitization is a series of filters on the individual post fields. Including a `display` filter.