returns a boolean as to wether the given post has the give tag attached to it
 Params:
 +categoryid+:: ID of the tag that you want to check
 +postid+:: ID, post_slug, or post_title - if this is nil it will use the @content variable (the current page)
960352
def has_tag?(tagid, postid = nil)
    	post = obtain_record(postid)
      return false if post.blank?
      !Post.includes(:terms => :term_anatomy).where(id: post.id, terms: { id: tagid }, roroacms_term_anatomies: { taxonomy: 'tag' }).blank?
    end
1145381
public function isShowing($in_tag)
    {
        $container = $this->show_area;
        $containee = $in_tag;
        $ret = false;
        $match = "/^" . $containee . "/";
        if (preg_match($match, $container)) {
            $ret = true;
        }

        $match = "/qcol....form$/";
        if (!$ret && preg_match($match, $containee)) {
            $ret = true;
        }

        $match = "/pghd....form$/";
        if (!$ret && preg_match($match, $containee)) {
            $ret = true;
        }

        $match = "/pgft....form$/";
        if (!$ret && preg_match($match, $containee)) {
            $ret = true;
        }

        $match = "/grph...._/";
        if (!$ret && preg_match($match, $containee)) {
            $ret = true;
        }

        return $ret;
    }
1363598
def maintain_slug
        postfix = nil
        total_count = 0

        while self.class.where(parent_id: parent_id, slug: "#{slug}#{postfix}").where("id != ?", id.to_i).exists? do
          total_count += 1
          postfix = "-#{total_count}"
        end

        if postfix
          self.slug = "#{slug}#{postfix}"
        end
      end
391673
private function get_tags( $post_id ) {
		$tag_data = get_the_tags( $post_id );
		$tag_arr  = [];
		if ( $tag_data ) {
			foreach ( $tag_data as $tag ) {
				array_push( $tag_arr, $tag->slug );
			}
		}

		return $tag_arr;
	}
352480
public static function hasPosts($tagID, $postTypeSlug = '')
    {
        $postTypeSlug($postTypeSlug ? $postTypeSlug : PostType::getSlug());
        $queryObject = DB::table(tagsRelationTable($postTypeSlug))->where('tagID', $tagID);

        if($queryObject->count() > 0) {
            return true;
        }

        return false;
    }
647401
private boolean checkRequiredTag(IfdTags metadata, String tagName, int cardinality) {
    return checkRequiredTag(metadata, tagName, cardinality, null);
  }
857022
def resolve_post(self, post):
        
        try:
            cid = post["id"]
        except KeyError:
            cid = post

        params = {
            "cid": cid,
            "resolved": "true"
        }

        return self._rpc.content_mark_resolved(params)
879846
public function hasTags()
    {
        $tags = "tags";
        $postType = getPostType($this->getTable());
        return ($postType->hasTags && isset($this->$tags) && !$this->$tags->isEmpty());
    }
617868
def has_pinned_content(self):
        
        if "query" in self.query:
            q = self.query["query"]
        else:
            q = self.query
        if "pinned_ids" in q:
            return bool(len(q.get("pinned_ids", [])))
        return False
1233716
def has_tag(self, p_key, p_value=""):
        
        tags = self.fields['tags']
        return p_key in tags and (p_value == "" or p_value in tags[p_key])
1164550
def matches? query
      query.reduce(true) do |matches, (key, value)|
        matches = if key == 'tag'
          return false unless tags.present?
          tags.include? value
        else
          attributes[key] == value
        end
      end
    end
201018
def obtain_article_status(check = nil)
      article = 
        if check.blank? && !@content.blank? && @content[0].blank?
          @content
        else
          obtain_record(check, 'page')
        end
      !article.blank? && article.has_attribute?('post_status') ? article.post_status : nil
    end
669688
def has_page?(url)
      schemes = %w(http https)
      if schemes.include? url.scheme
        u = url.dup
        return schemes.any? { |s| u.scheme = s; has_key?(u) }
      end

      has_key? url
    end
2331
function is_addon_connected( $id_or_slug ) {
            $this->_logger->entrance();

            $sites = self::get_all_sites( WP_FS__MODULE_TYPE_PLUGIN );

            $addon_id = self::get_module_id( $id_or_slug );
            $addon    = $this->get_addon( $addon_id );
            $slug     = $addon->slug;
            if ( ! isset( $sites[ $slug ] ) ) {
                return false;
            }

            $site = $sites[ $slug ];

            $plugin = FS_Plugin_Manager::instance( $addon_id )->get();

            if ( $plugin->parent_plugin_id != $this->_plugin->id ) {
                // The given slug do NOT belong to any of the plugin's add-ons.
                return false;
            }

            return ( is_object( $site ) &&
                     is_numeric( $site->id ) &&
                     is_numeric( $site->user_id ) &&
                     FS_Plugin_Plan::is_valid_id( $site->plan_id )
            );
        }
279215
def tag(request, tag_id=None):
    
    html = get_tag_html(tag_id)
    t = template.Template(html)
    c = template.RequestContext(request)

    return HttpResponse(t.render(c))
444505
def has_cover_image?(check = nil)
    	post = obtain_record(check)
    	!post.blank? && !post.cover_image.blank? ? true : false
    end
505978
def is_topic_tail(self):
        
        return self.topic.last_post.id == self.id if self.topic.last_post else False