Get post type
@return string
511661
public function getPostType()
    {
        global $wp_query;

        // If taxonomy or category page and post type not isset then it's the "post" post type
        if (is_home() || ((is_tax() || is_category() || is_tag()) && is_a(get_queried_object(),
                    'WP_Term') && !get_post_type())) {
            return 'post';
        }

        $postType = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : false;
        if (!$postType && isset($wp_query->query['category_name']) && !empty($wp_query->query['category_name'])) {
            $postType = 'post';
        }

        if (is_array($postType)) {
            $postType = end($postType);
        }

        return $postType;
    }
843662
protected function get_data()
    {
        $post_type = $this->input->get('post_type');
        if( !post_type_exists($post_type) ){
            $this->error(sprintf($this->__('Post type %s does not exist.'), $post_type), 404);
        }
        if( !current_user_can('edit_posts') ){
            $this->error($this->__('Sorry, but you have no permission.'), 403);
        }
        $paged = max(intval($this->input->get('paged')), 1) - 1;
        $args = [
            'post_type' => $post_type,
            'suppress_filters' => false,
            'orderby' => 'title',
            'order' => 'ASC',
            'offset' => $paged * get_option('posts_per_page'),
            's' => $this->input->get('s'),
        ];
        if( $this->is_public_search ){
            // This is public search.
            $args = array_merge($args, [
                'post_status' => ['publish']
            ]);
        }else{
            // This is private search.
            $args = array_merge($args, [
                'post_status' => ['publish', 'draft', 'future'],
            ]);
            if( !current_user_can('edit_others_posts') ){
                $args['author'] = get_current_user_id();
            }
        }
        $data = [];
        foreach( get_posts($args) as $post){
            $data[] = [
                'id' => $post->ID,
                'name' => get_the_title($post),
            ];
        }
        return $data;
    }
1346377
public function getActCatType()
    {
        $sType = false;
        $aData = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aSeoData");
        if ($aData && isset($aData["oxparams"])) {
            $oStr = getStr();
            $iEndPos = $oStr->strpos($aData["oxparams"], "#");
            $sType = $oStr->substr($aData["oxparams"], 0, $iEndPos);
        } elseif ($aList = $this->getSelectionList()) {
            reset($aList);
            $sType = key($aList);
        }

        return $sType;
    }
950180
public function getType()
    {
        $map = [
            'input' => self::TYPE_FIELD_TEXT,
            'textarea' => self::TYPE_FIELD_TEXT_AREA,
            'select' => self::TYPE_FIELD_SELECT,
        ];
        $tagName = strtolower($this->tagName());
        $typeField = isset($map[$tagName]) ? $map[$tagName] : self::TYPE_NODE;
        if (($typeField == self::TYPE_FIELD_TEXT) && (strtolower($this->attribute('type')) == 'file')) {
            $typeField = self::TYPE_FIELD_FILE;
        }
        return $typeField;
    }
1282384
public static function get( $post ) {
		$post = is_a( $post, 'WP_Post' ) ? $post : get_post( $post );
		$type = $post->post_type;
		if ( 'page' === $type ) {
			$template_slug = get_page_template_slug( $post->ID );
			if ( ! empty( $template_slug ) ) {
				$type .= '-' . wp_basename( $template_slug, '.php' );
			}
		}
		return $type;
	}
801869
public static function getContentType() {
    if(null === self::$contentType) {
      self::$contentType = @trim($_SERVER['HTTP_CONTENT_TYPE']);
      if(!self::$contentType) {
        self::$contentType = @trim($_SERVER['CONTENT_TYPE']);
        if(!self::$contentType) {
          self::$contentType = false;
        }
      }
    }
    return self::$contentType;
  }
549704
public function getRequestedPostType()
    {
        if (!is_a($this->query, 'WP_Query')) {
            return null;
        }

        if (isset($this->query->query) && isset($this->query->query['post_type'])) {
            return $this->data['post_type'] = $this->query->query['post_type'];
        } else {
            return $this->data['post_type'] = null;
        }
    }
1023186
public function metaBoxPostTypes()
    {
	global $modularityOptions;
	$enabled = isset($modularityOptions['enabled-post-types']) && is_array($modularityOptions['enabled-post-types']) ? $modularityOptions['enabled-post-types'] : array();

	$postTypes = array_filter(get_post_types(), function ($item) {
	    $disallowed = array_merge(
		array_keys(\Modularity\ModuleManager::$available),
		array(
		    'attachment',
		    'revision',
		    'nav_menu_item',
		    'custom_css',
		    'customize_changeset'
		)
	    );

	    if (in_array($item, $disallowed)) {
		return false;
	    }

	    if (substr($item, 0, 4) == 'acf-') {
		return false;
	    }

	    return true;
	});

	include MODULARITY_TEMPLATE_PATH . 'options/partials/modularity-post-types.php';
    }
413666
public function getObjectType() {
		$type = $this->object->getType();
		$subtype = $this->object->getSubtype() ? : 'default';
		$keys = [
			"interactions:$type:$subtype",
			$this->object instanceof Comment ? "interactions:comment" : "interactions:post",
		];
		foreach ($keys as $key) {
			if (elgg_language_key_exists($key, $this->language)) {
				return elgg_echo($key, array(), $this->language);
			}
		}
		return elgg_echo('interactions:post', $this->language);
	}
1298803
public function getSortType()
    {
        $sortType = isset($this->requestParams[self::PARAM_SORT_TYPE]) ?
            $this->requestParams[self::PARAM_SORT_TYPE] : self::DEFAULT_SORT_TYPE;
        $sortType= mb_strtolower($sortType);

        if(!in_array($sortType, ['string', 'numeric'])) {
            $sortType = self::DEFAULT_SORT_TYPE;
        }

        return $sortType;
    }
1256200
public function getRequestedPostTypeArchivePermalink()
    {
        $requested_post_type = $this->getRequestedPostType();

        if (!is_null($requested_post_type)) {
            $this->data['post_type_permalink']  = get_post_type_archive_link($requested_post_type);
        } else {
            $this->data['post_type_permalink'] = false;
        }

        return;
    }
117747
public function getPostTypeObject($post_type)
    {
        if ( ! isset($this->postTypes[ $post_type ])) {
            return false;
        }

        return $this->postTypes[ $post_type ];
    }
647024
static public function getPostInputInfo()
    {
        if ($input = file_get_contents('php://input')) {
            if (strpos(trim($input), '{') === 0 || strpos(trim($input), '[') === 0) {
                $posts = json_decode($input, true);
            } elseif (strpos(trim($input), '<') === 0) {
                $posts = XmlFormatter::decodeElement($input, false);
            } else {
                parse_str($input, $posts);
            }
            
            return [$input, $posts];
        }
        return [];
    }
336805
public function type()
    {
        $lang = $this->lang();
        $html = [
            '<!doctype html>',
            '<!--[if lt IE 7]><html class="no-js lt-ie9 lt-ie8 lt-ie7 ie6" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
            '<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8 ie7" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
            '<!--[if IE 8]><html class="no-js lt-ie9 ie8" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '"> <![endif]-->',
            '<!--[if gt IE 8]><!--><html class="no-js" xmlns="http://www.w3.org/1999/xhtml" '
            . 'lang="' . $lang . '" dir="' . $this->dir . '" '
            . 'prefix="og: http://ogp.me/ns#" '
            . '> <!--<![endif]-->',
        ];
        return implode($this->eol, $html) . $this->eol;
    }
401970
public function get_type()
	{
		if (isset($this->file->headers['content-type']))
		{
			if (!isset($this->file->headers['content-encoding'])
				&& ($this->file->headers['content-type'] === 'text/plain'
					|| $this->file->headers['content-type'] === 'text/plain; charset=ISO-8859-1'
					|| $this->file->headers['content-type'] === 'text/plain; charset=iso-8859-1'
					|| $this->file->headers['content-type'] === 'text/plain; charset=UTF-8'))
			{
				return $this->text_or_binary();
			}

			if (($pos = strpos($this->file->headers['content-type'], ';')) !== false)
			{
				$official = substr($this->file->headers['content-type'], 0, $pos);
			}
			else
			{
				$official = $this->file->headers['content-type'];
			}
			$official = trim(strtolower($official));

			if ($official === 'unknown/unknown'
				|| $official === 'application/unknown')
			{
				return $this->unknown();
			}
			elseif (substr($official, -4) === '+xml'
				|| $official === 'text/xml'
				|| $official === 'application/xml')
			{
				return $official;
			}
			elseif (substr($official, 0, 6) === 'image/')
			{
				if ($return = $this->image())
				{
					return $return;
				}
				else
				{
					return $official;
				}
			}
			elseif ($official === 'text/html')
			{
				return $this->feed_or_html();
			}
			else
			{
				return $official;
			}
		}
		else
		{
			return $this->unknown();
		}
	}
491234
public function status_type() {
		$status_code_type = (!empty($this->statuscode))
			? (int)mb_substr($this->statuscode, 0, 1)
			: 0;

		if ($status_code_type === 1) {
			$status_type = 'informational';
		} elseif ($status_code_type === 2) {
			$status_type = 'success';
		} elseif ($status_code_type === 3) {
			$status_type = 'redirect';
		} elseif ($status_code_type === 4) {
			$status_type = 'client_err';
		} elseif ($status_code_type === 5) {
			$status_type = 'server_err';
		} else {
			$status_type = 'bad';
		}
		return $status_type;
	}
666110
function getTypes()
    {
        $t = array();
        foreach ($this->getElements('xrd:Type') as $elem) {
            $c = $this->parser->content($elem);
            if ($c) {
                $t[] = $c;
            }
        }
        return $t;
    }