| @@ -34,8 +34,13 @@ | ||
| 34 | 34 | const PAGE_META_KEY = '_elementor_page_settings'; |
| 35 | 35 | |
| 36 | 36 | private $main_id; |
| 37 | 37 | |
| 38 | + /** | |
| 39 | + * @var bool | |
| 40 | + */ | |
| 41 | + private $is_saving = false; | |
| 42 | + | |
| 38 | 43 | private static $properties = []; |
| 39 | 44 | |
| 40 | 45 | /** |
| 41 | 46 | * Document post data. |
| @@ -518,8 +523,10 @@ | ||
| 518 | 523 | if ( ! $this->is_editable_by_current_user() ) { |
| 519 | 524 | return false; |
| 520 | 525 | } |
| 521 | 526 | |
| 527 | + $this->set_is_saving( true ); | |
| 528 | + | |
| 522 | 529 | /** |
| 523 | 530 | * Before document save. |
| 524 | 531 | * |
| 525 | 532 | * Fires when document save starts on Elementor. |
| @@ -573,8 +580,10 @@ | ||
| 573 | 580 | * @param $data. |
| 574 | 581 | */ |
| 575 | 582 | do_action( 'elementor/document/after_save', $this, $data ); |
| 576 | 583 | |
| 584 | + $this->set_is_saving( false ); | |
| 585 | + | |
| 577 | 586 | return true; |
| 578 | 587 | } |
| 579 | 588 | |
| 580 | 589 | /** |
| @@ -1099,8 +1108,27 @@ | ||
| 1099 | 1108 | $last_edited = sprintf( __( 'Last edited on %1$s by %2$s', 'elementor' ), '<time>' . $date . '</time>', $display_name ); |
| 1100 | 1109 | } |
| 1101 | 1110 | |
| 1102 | 1111 | return $last_edited; |
| 1112 | + } | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + /** | |
| 1116 | + * @return bool | |
| 1117 | + */ | |
| 1118 | + public function is_saving() { | |
| 1119 | + return $this->is_saving; | |
| 1120 | + } | |
| 1121 | + | |
| 1122 | + /** | |
| 1123 | + * @param $is_saving | |
| 1124 | + * | |
| 1125 | + * @return $this | |
| 1126 | + */ | |
| 1127 | + public function set_is_saving( $is_saving ) { | |
| 1128 | + $this->is_saving = $is_saving; | |
| 1129 | + | |
| 1130 | + return $this; | |
| 1103 | 1131 | } |
| 1104 | 1132 | |
| 1105 | 1133 | /** |
| 1106 | 1134 | * @since 2.0.0 |