Introduce *_network_meta() functions
|Reported by:||jeremyfelt||Owned by:|
|Component:||Networks and Sites||Keywords:||reporter-feedback|
The get_metadata(), update_metadata(), delete_metadata(), and add_metadata() functions are abstracted well enough for posts, comments, and users that adding in wrappers for network meta is pretty straight forward.
The attached patch introduces get_network_meta(), update_network_meta(), delete_network_meta(), and add_network_meta().
A few caveats:
- The table we're pulling from is sitemeta, which is a bummer. While the functions are named *_network_meta(), we still end up passing site as a parameter to the wrapped function. As it stands, any filters available would still need to use site rather than network. There's a chance we can work around this with some logic on the underlying functions, but I didn't go that far yet.
- Certain network meta likely has more consequence when removed. It may be worth protecting a few of the meta keys so that they are validated properly and are not deleted. See next point.
- This may or may not belong as part of an overall Network strategy that includes better structure around what a WP_Network object looks like and requires. That thought probably belongs somewhere else. :)
Change History (6)
in reply to:
3 years ago
- Keywords has-patch removed
- Milestone Awaiting Review deleted
- Resolution set to invalid
- Status changed from new to closed
17 months ago
- Component changed from Multisite to Networks and Sites
- Focuses multisite added
- Keywords reporter-feedback added
- Milestone set to Future Release
- Resolution invalid deleted
- Status changed from closed to reopened
- Version set to 3.0