PHP and closures. It's 1990 again.
This commit is contained in:
@@ -19,8 +19,9 @@ class Migrator {
|
||||
function up() {
|
||||
global $wpdb;
|
||||
|
||||
$migrate = function($model) {
|
||||
dbDelta($this->$model());
|
||||
$_this = $this;
|
||||
$migrate = function($model) use ($_this) {
|
||||
dbDelta($_this->$model());
|
||||
};
|
||||
|
||||
array_map($migrate, $this->models);
|
||||
|
Reference in New Issue
Block a user