Skip to content

Kirby 4.5.0

deprecated()

Triggers a deprecation warning if debug mode is active

deprecated(string $message): bool

Parameters

Name Type Default
$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.