Does this post have this term?
@param integer $term_id
@return bool
189313
public function hasTerm($term_id)
    {
        $taxonomy_terms = $this->getTerms();
        if (!Arr::iterable($taxonomy_terms)) {
            return false;
        }

        foreach ($taxonomy_terms as $taxonomy_key => $terms) {
            if (!Arr::iterable($terms)) {
                continue;
            }

            foreach ($terms as $term) {
                if ((int) $term->term_id === (int) $term_id) {
                    return true;
                }
            }
        }

        return false;
    }
1259178
public function isSuperadmin($user_id = null)
    {
        if (isset($user_id)) {
            return $this->getSuperadminId() == $user_id;
        }

        return $this->getSuperadminId() == $this->uid;
    }
174054
public function removeTerm($term_id) {
    $term_id = ($term_id instanceof Term) ? $term_id->id : $term_id;
    return $this->related()->where('term_id', $term_id)->delete();
  }
1101979
public function renderAdminColumn($column_name, $term_id)
    {
        $this->load($term_id);
        parent::renderAdminColumn($column_name, $term_id);
    }
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;
	}
948638
public static function hasName( $name, $module_id = null ): bool
	{
		if( !self::isValidName($name) )
		{
			return false;
		}

		$builder = \DB::table("events")->where("name", $name);
		if( is_numeric($module_id) )
		{
			$builder->where("module_id", (int) $module_id );
		}

		return $builder->count(["id"]) > 0;
	}
907521
public function get_custom_taxonomy($custom_taxonomy_id){
    global $wpdb;

    $query = sprintf('SELECT * FROM %s WHERE id = %s',MF_TABLE_CUSTOM_TAXONOMY,$custom_taxonomy_id);
    $custom_taxonomy = $wpdb->get_row( $query, ARRAY_A );
    if($custom_taxonomy){
      $custom_taxonomy = unserialize($custom_taxonomy['arguments']);
      $custom_taxonomy['core']['id'] = $custom_taxonomy_id;
      return $custom_taxonomy;
    }
    return false;
  }
257263
private function get_category( $post_id ) {
		$category_data = get_the_category( $post_id );
		$category_arr  = [];
		foreach ( $category_data as $cat ) {
			array_push( $category_arr, $cat->term_id );
		}

		return $category_arr;
	}
356013
function getTerm($termId, $taxonomy)
    {
        $params = array(1, $this->username, $this->password, $taxonomy, $termId);

        return $this->sendRequest('wp.getTerm', $params);
    }
304586
public static function find($post_id, $load_terms = true)
    {
        $instance = Post\Factory::create(get_called_class());
        $instance->load($post_id, $load_terms);
        return $instance;
    }
829345
public function hasNextPost()
    {
        return ($this->nextPost && $this->nextPost->ID !== $this->get('ID')) ? true : false;
    }
987158
public function scopeGetAllByTermId(Builder $query, $term_id)
    {
        return $query->whereHas('taxonomies', function (Builder $q) use ($term_id) {
            $q->where('term_id', $term_id);
        });
    }
102422
def has_child(self, term):
        """"""
        for parent in self.children:
            if parent.item_id == term or parent.has_child(term):
                return True
        return False
929359
public function getTermId($title, $vocabulary_id, $language_id = null, $type = 0)
    {
        $title = trim($title);
        if ($title == '') {
            return false;
        }

        if (!is_numeric($vocabulary_id)) {
            $vocabulary_id = $this->vocabulary($vocabulary_id);
        }

        $language_id = $this->getLanguage($vocabulary_id, $language_id);

        $search = $this->searchTerm($title, $vocabulary_id, $language_id);
        if ($search !== null) {
            return $search;
        }

        // Add term
        $term = new TermContainer(['vocabulary_id' => $vocabulary_id]);

        if ($type !== 0) {
            $term->type = $type;
        }
        $term->save();

        // Add translation
        $translation = [
            'language_id' => $language_id,
            'title' => $title,
        ];
        $term->translations()->save(new TermData($translation));

        return $term->id;
    }
1287476
function has_sticky( $id, $network_level_or_blog_id = null ) {
            if ( $this->should_use_network_notices( $id, $network_level_or_blog_id ) ) {
                $notices = $this->_network_notices;
            } else {
                $notices = $this->get_site_notices( $network_level_or_blog_id );
            }

            return $notices->has_sticky( $id );
        }
895739
public function getTerm($term_name, $taxonomy = '')
    {
        if ($taxonomy) {
            $term_ids = $this->taxonomies->where('taxonomy', $taxonomy)->pluck('term_id');
        } else {
            $term_ids = $this->getTaxonomies('term_id');
        }

        return Term::whereIn('id', $term_ids)->where('name', $term_name)->first();
    }
593036
public function prev( $in_same_term = false ) {
		if ( isset($this->_prev) && isset($this->_prev[$in_same_term]) ) {
			return $this->_prev[$in_same_term];
		}
		global $post;
		$old_global = $post;
		$post = $this;
		$within_taxonomy = ($in_same_term) ? $in_same_term : 'category';
		$adjacent = get_adjacent_post(($in_same_term), '', true, $within_taxonomy);
		$prev_in_taxonomy = false;
		if ( $adjacent ) {
			$prev_in_taxonomy = new $this->PostClass($adjacent);
		}
		$this->_prev[$in_same_term] = $prev_in_taxonomy;
		$post = $old_global;
		return $this->_prev[$in_same_term];
	}