get_task_runner(); $updater->set_current_item( [ 'iterate_num' => 1, ] ); return $updater; } /** * @param string $post_type * * @return Document|false */ protected function create_post( $post_type = 'post' ) { $admin = $this->factory()->create_and_get_administrator_user(); wp_set_current_user( $admin->ID ); $post = $this->factory()->create_and_get_custom_post( [ 'post_author' => $admin->ID, 'post_type' => $post_type, ] ); $document = self::elementor()->documents->get( $post->ID ); $document->save_template_type(); return $document; } /** * @param array|null $data Optional * * @return Document|false */ protected function create_document_with_data( $data = null ) { $document = $this->create_post(); if ( ! $data ) { $data = Test_Module::$document_mock_default; } // Save document. $document->save( $data ); return $document; } }