deletes the post
976725
def destroy
      Post.disable_post(params[:id])
      respond_to do |format|
        format.html { redirect_to admin_pages_path, notice: I18n.t("controllers.admin.pages.destroy.flash.success") }
      end
    end
350689
private void postDelete(Membership membership) throws Exception
   {
      for (MembershipEventListener listener : listeners)
      {
         listener.postDelete(membership);
      }
   }
725666
function delete() {
            $option_name = $this->get_option_manager_name();

            if ( $this->_is_network_storage ) {
                delete_site_option( $option_name );
            } else if ( $this->_blog_id > 0 ) {
                delete_blog_option( $this->_blog_id, $option_name );
            } else {
                delete_option( $option_name );
            }
        }
568627
public function deleteAction()
    {
        $model = $this->getModel();
        $model->applyRequest($this->getRequest());

        $model->delete();
        $this->_reroute(array($this->getRequest()->getActionKey() => 'index', MUTil_Model::REQUEST_ID => null));
    }
739974
def destroy
      @post = LatoBlog::Post.find_by(id: params[:id])
      return unless check_post_presence

      unless @post.destroy
        flash[:danger] = @post.post_parent.errors.full_messages.to_sentence
        redirect_to lato_blog.edit_post_path(@post.id)
        return
      end

      flash[:success] = LANGUAGES[:lato_blog][:flashes][:post_destroy_success]
      redirect_to lato_blog.posts_path(status: 'deleted')
    end
931392
public function delete(Post $post)
    {
        $response = $this->api->process(new DeletePost($post));
        if ($response->getStatusCode() == 200) {
            return true;
        } else {
            return false;
        }
    }
136019
public function delete()
	{
		JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

		// Get items to remove from the request.
		$cid = $this->input->get('cid', array(), 'array');
		$extension = $this->input->getCmd('extension', null);

		if (!is_array($cid) || count($cid) < 1)
		{
			JError::raiseWarning(500, JText::_($this->text_prefix . '_NO_ITEM_SELECTED'));
		}
		else
		{
			// Get the model.
			/** @var CategoriesModelCategory $model */
			$model = $this->getModel();

			// Make sure the item ids are integers
			$cid = ArrayHelper::toInteger($cid);

			// Remove the items.
			if ($model->delete($cid))
			{
				$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
			}
			else
			{
				$this->setMessage($model->getError());
			}
		}

		$this->setRedirect(JRoute::_('index.php?option=' . $this->option . '&extension=' . $extension, false));
	}
479631
public function delete( $post_id, $key, $meta_value = '' ) {
		if ( $post_id <= 0 ) {
			return false;
		}

		return delete_post_meta( $post_id, $this->get_meta_key( $key ), $meta_value );
	}
1273590
protected function _deleteObject( $post_id ) {
		$post = get_post( $post_id );
		if ( ! $post ) {
			return false;
		}

		$deleted = wp_delete_post( $post_id, true );
		if ( $deleted ) {
			$this->_debug( 'Deleted post with ID: ' . $post_id );
			return true;
		}

		$this->_debug( 'Post removal failed for ID: ' . $post_id );
		return false;
	}
942597
def remove_relation(post_id, tag_id):
        '''
        
        '''
        entry = TabPost2Tag.delete().where(
            (TabPost2Tag.post_id == post_id) &
            (TabPost2Tag.tag_id == tag_id)
        )
        entry.execute()
        MCategory.update_count(tag_id)
158178
def delete(self):
        
        self._requester.requestJsonAndCheck(
            "DELETE",
            self._parentUrl("") + "/reactions/" + str(self.id),
            headers={'Accept': Consts.mediaTypeReactionsPreview}
        )
334343
def delete(self):
        
        resp = self._client.delete(type(self).api_endpoint, model=self)

        if 'error' in resp:
            return False
        self.invalidate()
        return True
967170
def delete_project():
    
    assert request.method == "POST", "POST request expected received {}".format(request.method)
    if request.method == "POST":
        try:
            selections = json.loads(request.form["selections"])
            utils.drop_project(selections["project"])
            return jsonify({"response": "deleted {}".format(selections["project"])})
        except Exception as e:
            logging.error(e)
    return jsonify({"0": "__EMPTY"})
138501
def delete_item(self):
        
        data = self.get_selected_item()
        if data.get('author') != self.reddit.user.name:
            self.term.flash()
            return

        prompt = 'Are you sure you want to delete this? (y/n): '
        if not self.term.prompt_y_or_n(prompt):
            self.term.show_notification('Canceled')
            return

        with self.term.loader('Deleting', delay=0):
            data['object'].delete()
            # Give reddit time to process the request
            time.sleep(2.0)

        if self.term.loader.exception is None:
            self.reload_page()
824494
def drop_post(self):
        """"""
        post_index = self.version.find('.post')
        if post_index >= 0:
            self.version = self.version[:post_index]
435886
private function deletePost($id, $postType)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess($postType, 'delete', $id, true)) {
            return $this->noPermission();
        }

        // Check if this post type has posts
        // Post type should not be able to be deleted if it has posts
        if(Post::isInMenuLinks($id, $postType)) {
            return $this->response("You can't delete this Post because It is being used in menu links", 403);
        }

        $post = (new Post())->setTable($postType);
        $post = $post->find($id);

        if(!$post) {
            // create delete task
            Task::create('post', 'delete', [$id], ['postType' => $postType]);
            return $this->response('Post doesn\'n exist in the database. If it exist in archive, it will be deleted after 10 min.', 500);
        }

        if ($post->delete()) {
            // Delete categories relations of this post
            DB::table(categoriesRelationTable($postType))->where('postID', $id)->delete();
            // Delete tags relations of this post
            DB::table(tagsRelationTable($postType))->where('postID', $id)->delete();
            return true;
        }
        return false;
    }
1365633
def delete_post(self, blogname, id):
        
        url = "/v2/blog/{}/post/delete".format(blogname)
        return self.send_api_request('post', url, {'id': id}, ['id'])