Make WordPress Core

Opened 3 years ago

Closed 3 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:


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)

#1 @obenland
3 years ago

/cc @westonruter @timmydcrawford

Last edited 3 years ago by obenland (previous) (diff)

#2 @westonruter
3 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.

#3 @obenland
3 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed


Note: See TracTickets for help on using tickets.