LLMS_DB_Upgrader::get_callback_prefix( array $info, string $version )
Retrieve the callback’s prefix string based on the schema’s namespace declaration.
Description Description
If $info['namespace'] is empty, no prefix will be added. If $info['namespace'] is true, the namespace is assumed to be LLMS\Updates. If $info['namespace'] is a string, that string will be used.
If a namespace is found, \Version_X_X_X will automatically be appended to the namespace. The string X_X_X is the database version for the upgrade substituting underscores for dots.
Parameters Parameters
- $info
-
(array) (Required) Upgrade schema array.
- $version
-
(string) (Required) Version string for the upgrade.
Return Return
(string)
Source Source
File: includes/class-llms-db-ugrader.php
protected function get_callback_prefix( $info, $version ) {
if ( ! empty( $info['namespace'] ) ) {
$ver = explode( '-', $version ); // Drop prerelease data.
$ver = str_replace( '.', '_', $ver[0] );
$ns = true === $info['namespace'] ? 'LLMS\Updates' : $info['namespace'];
return sprintf( '%1$s\\Version_%2$s\\', $ns, $ver );
}
return '';
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 5.6.0 | Introduced. |