Reference

Guide

deprecated()

Triggers a deprecation warning if debug mode is active

deprecated(string $message): bool

Parameters

Name Type Default Description
$message string

Return type

bool

This function is used internally by Kirby, but you can also use it in your plugins to trigger deprecation warnings.

Example:

function someFunction()
{
    deprecated('`somefunction()` is deprecated, use `anotherFunction()` instead. `someFunction()` will be removed in version x.x.x');

    return 'something';
}

When a user uses the someFunction() function and debugging is enabled, the message passed as parameter will be shown.

Source code

kirby/config/helpers.php#L129