Skip to content

Kirby 3.6.6

How to upgrade Kirby 2 plugins

A new way to define plugins

The biggest change for plugins is a new way how to define plugins. All plugins are now defined by the Kirby::plugin() method. $kirby→set() is deprecated and no longer works.

The biggest advantage of this new definition syntax is a more consistent way of defining multiple plugin types and also composer compatibility.

Kirby::plugin('superwoman/superplugin', [
    'tags'         => [ ... ],
    'fields'       => [ ... ]
    'fieldMethods' => [ ... ]
    // etc.
]);

In Kirby 3 this happens in /site/plugins/MY-PLUGIN/index.php where you define your plugin parts via Kirby::plugin() as well as add any helper functions or similar that your plugin requires.

Please check out the plugin docs for more information on the plugin definition and each plugin type:

Plugin types that are almost compatible

These plugin types just need to be converted to the new wrapper syntax:

Plugin types that are no longer compatible

These plugin types have no chance of being converted without rewriting them from scratch.