Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #28172, comment 2


Ignore:
Timestamp:
05/08/2014 03:07:47 PM (8 years ago)
Author:
Denis-de-Bernardy
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28172, comment 2

    initial v1  
    1 At a conceptual level, side effects like this belong after (or on, or immediately before) the save_post hook, not before it. Consider filtering the option's value instead. There's a hook for that in get_option(). (Don't forget to cache the result using e.g. A transient that gets deleted on save_post. That way, your plugin won't leave side-effects when disabled.)
     1At a conceptual level, side effects like this belong after (or on, or immediately before) the save_post hook, not before the update occurs. Consider filtering the option's value instead. There's a hook for that in get_option(). (Don't forget to cache the result using e.g. A transient that gets deleted on save_post. That way, your plugin won't leave side-effects when disabled.)