Opened 7 years ago
Closed 7 years ago
#40783 closed defect (bug) (invalid)
More accurate media widgets instance schema
Reported by: | obenland | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 4.8 |
Component: | Widgets | Keywords: | close |
Focuses: | Cc: |
Description
WP_Widget_Media::get_instance_schema()
currently covers not only the widget title but also attachment_id
and url
of an attachment. While in their current implementation media widgets are always based on a single attachment or URL, I'm not sure we can make the assumption that future implementations will continue to fit that model (like in a Gallery Widget).
In an attempt to future-prove WP_Widget_Media
, should we move attachment_id
and url
into the subclasses that actually use them?
Change History (3)
#2
@
7 years ago
- Keywords close added
@obenland I think it makes sense to include these in the base widget's schema in the PHP class because these same properties are also being used in the base JS class. If a subclass is not using these, then I think it would be up to them to remove the url
and attachment_id
fields in the schema while also overriding the relevant JS methods.
/cc @westonruter @timmydcrawford