WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #32474, comment 22


Ignore:
Timestamp:
06/18/2015 06:54:49 PM (6 years ago)
Author:
azaozz
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #32474, comment 22

    initial v1  
    55> Instead, without introducing new filters, we can leverage the existing `pre_option_widget_{$id_base}` and `pre_update_option_widget_{$id_base}` ones.
    66
    7 I meant that if core stops using options for saving the widgets data, the existing `pre_option_widget_*` filters will never run, so all plugins that use them will break. And there is no way for core to add backwards compatibility to prevent that breakage. Of course the authors of these plugins will probably update them if/when that happens, it's just that using low-level filters for commonly needed tasks is not a good idea :)
     7I meant that if core stops using options for saving the widgets data, the existing `pre_option_*` filters will never run, so all plugins that use them will break. And there is no way for core to add backwards compatibility to prevent that breakage. Of course the authors of these plugins will probably update them if/when that happens, it's just that using low-level filters for commonly needed tasks is not a good idea :)
    88
    99> ...plugins now have the ''option'' of filtering the `widget_{$id_base}` options to return `ArrayIterator` objects instead of intrinsic arrays, and `WP_Widget` will handle them successfully.