PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0-beta3
Elementor Website Builder – more than just a page builder v4.3.0-beta3
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | modules/global-classes/global-class-post.php +9 -5 4.2.34.3.0-beta3 View file →
@@ -100,12 +100,8 @@
100 100 return $data;
101 101 }
102 102
103 103 private function migrate_data( array &$data, string $meta_key ): void {
104 - if ( ! Migrations_Orchestrator::is_active() ) {
105 - return;
106 - }
107 -
108 104 $post_id = $this->post->ID;
109 105
110 106 Migrations_Orchestrator::make()->migrate(
111 107 $data,
@@ -273,9 +269,13 @@
273 269
274 270 return false !== $result;
275 271 }
276 272
277 - public static function clone_to_other_kit( string $style_id, Kit $source_kit, Kit $target_kit ): ?Global_Class_Post {
273 + public function clone( Kit $target_kit ): ?self {
274 + return self::clone_to_kit( $this->get_class_id(), $this, $target_kit );
275 + }
276 +
277 + public static function clone_to_other_kit( string $style_id, Kit $source_kit, Kit $target_kit ): ?self {
278 278 $source_post = self::find_by_class_id( $style_id, false, $source_kit );
279 279
280 280 if ( ! $source_post ) {
281 281 return null;
@@ -280,8 +280,12 @@
280 280 if ( ! $source_post ) {
281 281 return null;
282 282 }
283 283
284 + return self::clone_to_kit( $style_id, $source_post, $target_kit );
285 + }
286 +
287 + private static function clone_to_kit( string $style_id, self $source_post, Kit $target_kit ): ?self {
284 288 $new_post_id = wp_insert_post( [
285 289 'post_type' => Global_Class_Post_Type::CPT,
286 290 'post_title' => $source_post->get_label(),
287 291 'post_status' => 'publish',