src/controller/admin/class-image.php
public function set_images( $post_id, $post, $update ) {

		App::setCurrentID( 'EFG' );

		if ( Module::CustomImagesGrifus()->getOption( 'replace-when-add' ) ) {
			$is_insert_post = App::main()->is_after_insert_post( $post, $update );
			$is_update_post = App::main()->is_after_update_post( $post, $update );
			if ( $is_insert_post || $is_update_post ) {
				$this->model->set_images( $post_id );
			}
		}
	}
public function set_images( $post_id, $post, $update ) {

		App::setCurrentID( 'EFG' );

		if ( Module::CustomImagesGrifus()->getOption( 'replace-when-add' ) ) {
			$is_insert_post = App::main()->is_after_insert_post( $post, $update );
			$is_update_post = App::main()->is_after_update_post( $post, $update );
			if ( $is_insert_post || $is_update_post ) {
				$this->model->set_images( $post_id );
			}
		}
	}
Save images to the server when post has been added or edited.

@param int     $post_id → post ID.
@param object  $post    → (WP_Post) post object.
@param boolean $update  → true if update post.