-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add data to notification #90
Conversation
Oh another thing I added here is a timestamp, which I think would be useful to include in this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use a new type
property while we’re here, otherwise no blockers, will need more work on sanitisation once merged.
@@ -211,14 +218,16 @@ function sanitize_notification( $notification ) { | |||
*/ | |||
$data_sanitization_fn = apply_filters( 'hm.workflows.action.data.sanitizer', 'sanitize_text_field' ); | |||
|
|||
if ( ! is_callable( $data_sanitization_fn ) ) { | |||
if ( ! $data_sanitization_fn || ! is_callable( $data_sanitization_fn ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can probably make use of the enhancements Rob suggested, where a more thorough function is checking object items based on the value type. It needs some work on the original ticket anyway, and probably then some.
Continuing work on this as part of #88, will tackle all the feedback here. |
Here is some POC code to add data to the notification itself (instead of or in addition to action data...)
Mostly just getting my head around the internals of this plugin so needs a bit more work - but wanted to share.