Delete an existing taxonomy term.

@param integer $termId
@param string  $taxonomy

@return boolean

@link http://codex.wordpress.org/XML-RPC_WordPress_API/Taxonomies#wp.deleteTerm
545500
function deleteTerm($termId, $taxonomy)
    {
        $params = array(1, $this->username, $this->password, $taxonomy, $termId);

        return $this->sendRequest('wp.deleteTerm', $params);
    }
596261
public function deleteTag($tagId)
    {
        $result = $this->httpGet(self::WECHAT_TAG_DELETE_PREFIX, [
            'access_token' => $this->getAccessToken(),
            'tagid' => $tagId
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
1082920
public function setTerms($term_ids, $taxonomy = null, $append = false)
    {
        $taxonomy = ($taxonomy) ? $taxonomy : 'post_tag';
        if (!is_array($this->_terms)) {
            $this->_terms = array();
        }
        if (!array_key_exists($taxonomy, $this->_terms)) {
            $this->_terms[$taxonomy] = array();
        }

        $this->_terms[$taxonomy] = ($append)
            ? array_merge($this->_terms[$taxonomy], $term_ids)
            : $term_ids;
        return $this->_terms[$taxonomy];
    }
59594
protected function perform_delete( $force ) {
		switch ( $this->wp_type ) {
			case 'term':
				$delete = wp_delete_term( $this->get_id(), $this->object_type );
				return ( ! is_wp_error( $delete ) && true === $delete );

			case 'post':
				if ( ! $force && 'trash' !== get_post_status( $this->get_id() ) && EMPTY_TRASH_DAYS ) {
					$delete = wp_trash_post( $this->get_id() );
				} else {
					$delete = wp_delete_post( $this->get_id(), true );
				}

				return ( ! is_null( $delete ) && ! is_wp_error( $delete ) && false !== $delete );
		}

		return false;
	}
798880
public function removeTaxonomy(TermTaxonomy $taxonomy)
    {
        if ($this->taxonomies->contains($taxonomy)) {
            $this->taxonomies->remove($taxonomy);
        }

        return $this;
    }
526403
public function addTerm($term_id)
    {
        TermContainer::findOrFail($term_id);

        // Cancel if the user wants to add the same term again
        if ($this->getTaxonomyQuery()->where('term_id', $term_id)->count()) {
            return;
        }

        $this->taxonomies()->attach($term_id);

        Cache::forget($this->getTaxonomyCacheKey());
    }
1060810
public function update(Term $term)
    {
        return wp_update_term($term->id, $this->getSlug(), (array) $term->getAdaptee());
    }
748947
private function deleteTag($id)
    {
        $tags = Tag::find($id);
        if(Tag::hasPosts($id)) {
            return $this->response("You can't delete this Tag. There are posts associated with it.", 403);
        }
        if ($tags->delete()) {
            return true;
        }
        return false;
    }
954276
public function removeTerm($term_name, $taxonomy = '')
    {
        if (! $term = $this->getTerm($term_name, $taxonomy))
            return null;

        if ($taxonomy) {
            $taxonomy = $this->taxonomies->where('taxonomy', $taxonomy)->where('term_id', $term->id)->first();
        } else {
            $taxonomy = $this->taxonomies->where('term_id', $term->id)->first();
        }

        return $this->taxed()->where('taxonomy_id', $taxonomy->id)->delete();
    }
623479
public function scopeTerm($query, $term, $taxonomy = 'major')
    {
        return $query->whereHas('term', function($q) use($term, $taxonomy) {
            $q->where('name', $term);
        });
    }
626980
public function cleanTerms()
    {
        // Remove any terms that were created.
        foreach ($this->terms as $term) {
            $this->getDriver()->termDelete($term);
        }
        $this->terms = array();
    }
1364754
protected function check_is_taxonomy_allowed( $taxonomy ) {
		$taxonomy_obj = get_taxonomy( $taxonomy );
		if ( $taxonomy_obj && ! empty( $taxonomy_obj->show_in_rest ) ) {
			return true;
		}
		return false;
	}
1122151
public function deleteLabel(\stdClass $label)
    {
        // Prevents to delete a label which has children.
        if ($this->hasChildren($label)) {
            throw new \LogicException("Can't delete a label which has children.");
        }
        return taxonomy_term_delete($label->tid);
    }
825492
public function delete($id = null) {
        $this->request->allowMethod(['post', 'delete']);
        $cmsTermTaxonomy = $this->CmsTermTaxonomy->get($id);
        if ($this->CmsTermTaxonomy->delete($cmsTermTaxonomy)) {
            $this->Flash->success('The cms term taxonomy has been deleted.');
        } else {
            $this->Flash->error('The cms term taxonomy could not be deleted. Please, try again.');
        }
        return $this->redirect(['action' => 'index']);
    }
619390
public function createTerm(string $term, string $taxonomy, array $args = []): array
    {
        $args['taxonomy'] = $taxonomy;
        $args['term'] = $term;

        $term = $this->getDriver()->term->create($args);

        return array(
            'id'   => $term->term_id,
            'slug' => $term->slug
        );
    }
886322
public function load($term_id)
    {
        $info = get_term($term_id, $this->getTaxonomyKey());
        if (!is_object($info)) {
            return false;
        }

        $this->_info = (array) $info;

        // extra
        $option = get_option($this->getOptionID($term_id));
        if (!is_object($option) && !is_array($option)) {
            return true;
        }

        foreach ($option as $k => $v) {
            $this->set($k, $v);
        }

        return true;
    }
106330
public void delete(Term term) {
        Log.debug(String.format("Deleting by term %s", term));
        try {
            indexWriter.deleteDocuments(term);
        } catch (IOException e) {
            Log.error(e, "Error while deleting by term %s", term);
            throw new RuntimeException(e);
        }
    }