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.


Top ↑

Parameters Parameters

$info

(array) (Required) Upgrade schema array.

$version

(string) (Required) Version string for the upgrade.


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-llms-db-ugrader.php

120
121
122
123
124
125
126
127
128
129
130
131
132
133
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 '';
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.