This function destroy a post for the field.
978742
def destroy_relay_field
      # find post field
      child_field = LatoBlog::PostField.find_by(id: params[:id])
      @post_field = child_field.post_field
      unless @post_field
        @error = true
        respond_to { |r| r.js }
      end
      # find post field child and destroy it
      unless child_field.destroy
        @error = true
        respond_to { |r| r.js }
      end
      # send response to client
      @error = false
      respond_to { |r| r.js }
    end
1062297
public void destroy()
    {
        if (_ajpIn!=null)
            _ajpIn.destroy();
        _ajpIn=null;
        if (_ajpOut!=null)
            _ajpOut.destroy();
        _ajpOut=null;
        _remoteHost=null;
        _remoteAddr=null;
        _serverName=null;
    }
1196280
function clean(post) {
  return reject({
    title: post.title,
    contentFormat: post.contentFormat,
    content: post.content,
    tags: post.tags,
    canonicalUrl: post.canonicalUrl,
    publishStatus: post.publishStatus,
    license: post.license
  });
}
36915
function remove(req, res, next) {
  var params = {"_id": req.params.id};

  logger.debug("Middleware Submissions Remove ", {params: params});
  forms.deleteSubmission(req.connectionOptions, params, submissionsHandler(constants.resultTypes.submissions, req, next));
}
253213
def destroy(self, request, id):
        """"""
        try:
            object = self.model.objects.get(id=id)
            object.delete()
        except self.model.DoesNotExist:
            return self._render(
                request = request,
                template = '404',
                context = {
                    'error': 'The %s could not be found.' % self.model.__name__.lower()
                },
                status = 404,
                prefix_template_path = False
            )

        return self._render(
            request = request,
            template = 'destroy',
            status = 200
        )
579642
def destroy
      result = resource_get.destroy
      call_hook :after_destroy, result
      flash[:notice] = t 'messages.record_destroyed', model: t("models.#{resource_name}")

      respond_to do |wants|
        wants.html { redirect_to(resources_path) }
        wants.json  { head :ok }
      end
    end
1294387
function delete_field() {
        global $DB;

        if (!empty($this->field->id)) {
            // Get the field before we delete it.
            $field = $DB->get_record('data_fields', array('id' => $this->field->id));

            $this->delete_content();
            $DB->delete_records('data_fields', array('id'=>$this->field->id));

            // Trigger an event for deleting this field.
            $event = \mod_data\event\field_deleted::create(array(
                'objectid' => $this->field->id,
                'context' => $this->context,
                'other' => array(
                    'fieldname' => $this->field->name,
                    'dataid' => $this->data->id
                 )
            ));
            $event->add_record_snapshot('data_fields', $field);
            $event->trigger();
        }

        return true;
    }
62110
function destroy(stack) {
  if (stack.length > 0) {
    for (const chunk of stack) {
      if (isTemplateResult(chunk)) {
        chunk.destroy(true);
      }
    }
  }
  stack.length = 0;
}
1064465
def destroy(self, scriptid, params=None):
        ''' 
        '''
        params = update_params(params, {'SCRIPTID': scriptid})
        return self.request('/v1/startupscript/destroy', params, 'POST')
764920
def destroy
      @news = News.find(params[:id])
      category = @news.category
      @news.destroy
  
      respond_to do |format|
        format.html { redirect_to category_news_index_path(category), notice: 'News was successfully deleted.' }
        format.json { head :no_content }
      end
    end
427963
function() {
        for (var i=0, len=this.rules.length; i<len; i++) {
            this.rules[i].destroy();
        }
        delete this.rules;
    }
1020734
function removePostsContent( posts, options ) {

	var _sortPosts = options && typeof options.sortPosts === 'function' ?
				options.sortPosts : sortPosts,
			i = 0,
			len = 0;

	// Posts should be objects separated by commas but not wrapped in []
	posts = JSON.parse( '[' + posts.contents.toString() + ']' );

	len = posts.length;

	for ( i; i < len; i++ ) {

		delete posts[i].content;
	}

	// Sort posts by newest
	posts.sort( _sortPosts );

	return JSON.stringify( posts );
}
650992
def destroy(self, request, pk=None, parent_lookup_organization=None):
        ''''''
        user = get_object_or_404(User, pk=pk)
        org = get_object_or_404(
            SeedOrganization, pk=parent_lookup_organization)
        self.check_object_permissions(request, org)
        org.users.remove(user)
        return Response(status=status.HTTP_204_NO_CONTENT)
506054
function() {
      
      var i, length, field;
      
      // Recursively destroy inputs
      for (i = 0, length = this.inputs.length ; i < length ; i++) {
         field = this.inputs[i];
         field.destroy();
      }
      
      // Destroy group itself
      inputEx.Group.superclass.destroy.call(this);
      
   }
523440
function destroy() {
         // allow recycling object properties
         me.pool.push(this.currentTransform);
         this.currentTransform = undefined;
         me.pool.push(this.anchorPoint);
         this.anchorPoint = undefined;
         me.pool.push(this.pos);
         this.pos = undefined;
         me.pool.push(this._absPos);
         this._absPos = undefined;
         me.pool.push(this._bounds);
         this._bounds = undefined;
         this.onVisibilityChange = undefined;

         if (typeof this.mask !== "undefined") {
           me.pool.push(this.mask);
           this.mask = undefined;
         }

         if (typeof this.tint !== "undefined") {
           me.pool.push(this.tint);
           this.tint = undefined;
         }

         this.ancestor = undefined; // destroy the physic body if defined

         if (typeof this.body !== "undefined") {
           this.body.destroy.apply(this.body, arguments);
           this.body = undefined;
         }

         this.onDestroyEvent.apply(this, arguments);
       }
1234433
function destroy() {
        Modal._count--;
        this._removeEventHandlers();
        this.el.removeAttribute('style');
        this.$overlay.remove();
        this.el.M_Modal = undefined;
      }
442584
def destroy(self, request, pk=None):
        ''''''
        user = self.get_object()
        user.is_active = False
        user.save()
        return Response(status=status.HTTP_204_NO_CONTENT)