Yeah, using $_LW->save_data
achieves the intended behavior: check, update, and save without impeding the editor.
An observation to note. I was hoping for the option to make the changes but also trigger a $_LW->REGISTERED_MESSAGES['failure']
to bring the editor back and inform them of the incorrect style. It appears editing $_LW->save_data
doesn’t change what appears in the editor on a failure
reload like $_LW->_POST
did. If _POST
to check, then profile custom fields won’t update, and if save_data
to check, then nothing will update. Guess silently correcting things is the only practical approach.
I’ll work on this more when I can and see if I can do some work to generalize it: easily define and check any number of rules, make a base modules that others can put in and use, etc.
Thanks,
Nick