Open raaaahman opened 3 years ago
I am not sure what would be the case when the version
property is necessary for a sender.
Also, I think the icon
property should be a separate model because and icon can be a img
with alt
attribute, can be an <a>
or it can be an svg
with style attributes. For the beginning I'd implement two models for icon
: HtmlIcon
and SVGIcon
. Later on we can implement more types of icons if necessary.
I am not sure what would be the case when the
version
property is necessary for a sender.
In fact, I can't find a good use for it neither... Indeed, it might not be worth implementing at that point.
Also, I think the
icon
property should be a separate model because and icon can be aimg
withalt
attribute, can be an<a>
or it can be ansvg
with style attributes. For the beginning I'd implement two models foricon
:HtmlIcon
andSVGIcon
. Later on we can implement more types of icons if necessary.
Interesting topic, I'm opening a dedicated issue about it: https://github.com/WordPress/wp-notify/issues/47
Note: Senders don't need to be stored in a database or so, they could be loaded from the plugins or themes files like the WordPress taxonomies are.
Would a plugin or theme store its own sender data in its own table? or will we be reusing current WordPress core data structures?
Would a plugin or theme store its own sender data in its own table? or will we be reusing current WordPress core data structures?
I was implying that they could be stored in a php file, maybe registered with some function like:
register_notification_sender( 'my_plugin_name', array( 'icon' => 'path/to/my/icon.png' ) );
The thinking behind is that this data won't change throughout the websites life cycle, so it doesn't really benefit from being in a database.
Except if we need it for joint request maybe. At the moment, it doesn't seem we will be requesting notifications by sender, will it be worth to add this feature?: https://github.com/WordPress/wp-notify/blob/develop/includes/persistence/interface-wp-notify-notification-repository.php
Except if we need it for joint request maybe. At the moment, it doesn't seem we will be requesting notifications by sender, will it be worth to add this feature?: https://github.com/WordPress/wp-notify/blob/develop/includes/persistence/interface-wp-notify-notification-repository.php
No, I agree, I think leaving it as manageable by the theme or plugin makes the most sense. They theme or plugin can decide how to store the sender data, hardcoded, custom table, whatever.
The sender could have the following data associated with it. Here's a draft.
version: Optional. Would help to identify the version of the plugin, theme or WordPress Core if they are the sender.(see comment below)Note: Senders don't need to be stored in a database or so, they could be loaded from the plugins or themes files like the WordPress taxonomies are.