Skip to content

Commit 9531dd9

Browse files
sirrealwestonruter
andauthored
Change instance cloning logic
Co-authored-by: Weston Ruter <westonruter@gmail.com>
1 parent 71b6a61 commit 9531dd9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/wp-includes/class-wp-script-modules.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -951,10 +951,9 @@ public function print_a11y_script_module_html() {
951951
}
952952

953953
public function clone_without_enqueued_modules(): WP_Script_Modules {
954-
$clone = new WP_Script_Modules();
955-
$clone->registered = $this->registered;
956-
$clone->dependents_map = $this->dependents_map;
957-
$clone->modules_with_missing_dependencies = $this->modules_with_missing_dependencies;
954+
$clone = clone $this;
955+
$clone->queue = array();
956+
$clone->done = array();
958957
return $clone;
959958
}
960959
}

0 commit comments

Comments
 (0)