Skip to content

0.10.0

Choose a tag to compare

@tfrommen tfrommen released this 08 Mar 12:22
· 141 commits to master since this release

⚠ This release includes some breaking changes. ⚠

  • BREAKING: Remove amf/provider_class filter.
  • BREAKING: Introduce amf/provider filter.
  • Introduce Audio::set_album and Audio::set_artist methods.
  • Introduce Playable::set_bitrate method.
  • Move set_meta method from Playable interface to Media base class.
  • Introduce Media::add_meta method.
  • Ensure that all metadata provided in the meta property gets saved.

How to address the breaking changes mentioned above?

Plugins that register a custom provider do this by hooking into the amf/provider_class filter, where they return the fully-qualified name of the provider class. As of this release of Asset Manager Framework, instead of the mentioned filter callback, plugin authors would need to hook into the new amf/provider filter and return a provider instance.

Here is a sample diff:

-add_filter( 'amf/provider_class', function () {
-    return MyProvider::class;
+add_filter( 'amf/provider', function () {
+    return new MyProvider();
} );

Since you have access to the current provider instance, passed as first argument to your filter callback, you can also decorate the existing provider.