Return the post type as object

@link http://codex.wordpress.org/Function_Reference/get_post_type_object
@return object
339774
public function presentPostType()
	{
		global $wp_rewrite;

		$postType = get_post_type_object(get_post_type($this->ID));

		if(! $postType)
		{
			return null;
		}

		if (get_option('permalink_structure') && is_array($postType->rewrite))
		{

			$slug = $postType->rewrite['slug'];

			if ($postType->rewrite['with_front'])
			{
				$structure = $wp_rewrite->front . $slug;
			}
			else
			{
				$structure = $wp_rewrite->root . $slug;
			}

			$link = url(user_trailingslashit($structure, 'post_type_archive'));

		}
		else
		{
			$slug = (isset($postType->slug) && $postType->slug) ? $postType->slug : $postType->name;
			$link = url('?post_type=' . $slug);
		}

		$postType->permalink = $link;

		return $postType;
	}
511399
public function getType() : ?string 
    {
        if ( ! $this->hasType()) {
            $this->setType($this->getDefaultType());
        }
        return $this->type;
    }
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;
    }
735409
public function determineObject()
    {
        if (isset($_GET['post'])) {
            return $_GET['post'];
        }

        if (isset($_POST['post_ID'])) {
            return $_POST['post_ID'];
        }

        if (isset($_POST['cuztom']['object'])) {
            return $_POST['cuztom']['object'];
        }
    }
57023
private function register_post_type() {
		$post_type            = $this->get_post_type();
		$this->_post_type_obj = register_post_type( $post_type, $this->get_post_type_args() );
		if ( is_wp_error( $this->_post_type_obj ) ) {
			$this->app->log( $this->_post_type_obj );

			return;
		}
		add_filter( "views_edit-{$post_type}", function ( $views ) {
			unset( $views['mine'] );
			unset( $views['publish'] );

			return $views;
		} );
		add_filter( "bulk_actions-edit-{$post_type}", function ( $actions ) {
			unset( $actions['edit'] );

			return $actions;
		} );
		add_filter( "manage_edit-{$post_type}_sortable_columns", function ( $sortable_columns ) {
			return $this->manage_posts_columns( $sortable_columns, true );
		} );
	}
608395
public function getPostType()
	{
		global $wp_query;

		if(isset($wp_query->post) && $wp_query->post->post_type)
		{
			return $wp_query->post->post_type;
		}
		if (isset($wp_query->query) && isset($wp_query->query['post_type']))
		{
			return $wp_query->query['post_type'];
		}
		else if(isset($wp_query->query_vars) && isset($wp_query->query_vars['post_type']))
		{
			return $wp_query->query_vars['post_type'];
		}

		return false;
	}
1270593
private function getType()
    {
        if ($class = $this->reflection->getClass()) {
            return $class->name;
        }
        if ($this->reflection->isArray()) {
            return 'array';
        }
        if (version_compare(phpversion(), '7.0', '>=')
            and $type = $this->reflection->getType()
        ) {
            return $type;
        }
        return '';
    }
593704
public function indexAction() : object
    {
        $title = "Stylechooser";

        $page = $this->di->get("page");
        $session = $this->di->get("session");

        $active = $session->get(self::$key, null);

        $page->add("anax/stylechooser/index", [
            "styles" => $this->styles,
            "activeStyle" => $active,
            "activeShortDescription" => $this->styles[$active]["shortDescription"] ?? null,
            "activeLongDescription" => $this->styles[$active]["longDescription"] ?? null,
        ]);

        return $page->render([
            "title" => $title,
        ]);
    }
171589
public function toStdObject()
    {
        $object = new \stdClass();
        $object->uid = $this->getUid();
        $object->level = $this->getLevel();
        $object->keyword = $this->getKeyword();
        $object->children = array();
        return $object;
    }
60295
public function getType()
    {
        $userType = get_user_meta($this->ID, self::KEY_TYPE, true);
        return ($userType) ? $userType : self::TYPE_DEFAULT;
    }
824449
protected function getObjectFromPost()
    {
        $oInput = Factory::service('Input');
        $oUri   = Factory::service('Uri');
        $aData  = [
            'ref'             => $oInput->post('ref') ?: null,
            'state'           => $oInput->post('state') ?: null,
            'dated'           => $oInput->post('dated') ?: null,
            'currency'        => $oInput->post('currency') ?: null,
            'terms'           => (int) $oInput->post('terms') ?: 0,
            'customer_id'     => (int) $oInput->post('customer_id') ?: null,
            'additional_text' => $oInput->post('additional_text') ?: null,
            'items'           => [],
            'currency'        => $oInput->post('currency'),
        ];

        if ($oInput->post('items')) {
            foreach ($oInput->post('items') as $aItem) {

                //  @todo convert to pence using a model
                $aData['items'][] = [
                    'id'        => array_key_exists('id', $aItem) ? $aItem['id'] : null,
                    'quantity'  => array_key_exists('quantity', $aItem) ? $aItem['quantity'] : null,
                    'unit'      => array_key_exists('unit', $aItem) ? $aItem['unit'] : null,
                    'label'     => array_key_exists('label', $aItem) ? $aItem['label'] : null,
                    'body'      => array_key_exists('body', $aItem) ? $aItem['body'] : null,
                    'unit_cost' => array_key_exists('unit_cost', $aItem) ? intval($aItem['unit_cost'] * 100) : null,
                    'tax_id'    => array_key_exists('tax_id', $aItem) ? $aItem['tax_id'] : null,
                ];
            }
        }

        if ($oUri->rsegment(5) == 'edit') {
            unset($aData['ref']);
        }

        return $aData;
    }
189026
public function getType()
    {
        if (isset($this->result[0]['type'])) {
            $error = $this->result[0]['type'];
            if (is_string($error)) {
                return $error;
            }
        }

        return 'NewscoopApiException';
    }
755250
public function get_object( $object_type, $object_id, $aux = '' ) {

		global $wpdb;

		if ( 'term' == $object_type ) {
			$object_type = 'taxonomy';
		}

		if ( 'post_type' == $object_type ) {
			$objects = self::$post_types;
		} elseif ( 'taxonomy' == $object_type ) {
			$objects = self::$taxonomies;
		} elseif ( 'media' == $object_type ) {
			$objects = self::$media;
		} elseif ( 'user' == $object_type ) {
			$objects = self::$user;
		} elseif ( 'comment' == $object_type ) {
			$objects = self::$comment;
		} elseif ( 'settings' == $object_type ) {
			$objects = self::$settings;
		} else {
			return false;
		}

		if ( empty( $objects ) || ! is_array( $objects ) ) {
			return false;
		}

		$object_name = null;

		if ( 'media' == $object_type ) {
			return @current( $objects );
		} elseif ( 'user' == $object_type ) {
			return @current( $objects );
		} elseif ( 'comment' == $object_type ) {
			return @current( $objects );
		} elseif ( 'post_type' == $object_type ) {
			$object = get_post( $object_id );

			if ( ! is_object( $object ) || ! isset( $object->post_type ) ) {
				return false;
			}

			$object_name = $object->post_type;
		} elseif ( 'taxonomy' == $object_type ) {
			$object = get_term( $object_id );

			if ( ! is_object( $object ) || ! isset( $object->taxonomy ) ) {
				return false;
			}

			$object_name = $object->taxonomy;
			if ( empty( $aux ) ) {
				$object_name = $wpdb->get_var( $wpdb->prepare( "SELECT `taxonomy` FROM `{$wpdb->term_taxonomy}` WHERE `term_id` = %d", $object_id ) );
			} else {
				$object_name = $aux;
			}
		} elseif ( 'settings' == $object_type ) {
			$object = $object_id;
		} else {
			return false;
		}

		$reserved_post_types = array(
			'revision'
		);

		$reserved_post_types = apply_filters( 'pods_meta_reserved_post_types', $reserved_post_types, $object_type, $object_id, $object_name, $objects );

		if ( empty( $object_name ) || ( 'post_type' == $object_type && ( 0 === strpos( $object_name, '_pods_' ) ) || in_array( $object_name, $reserved_post_types ) ) ) {
			return false;
		} elseif ( 'attachment' == $object_name ) {
			return @current( self::$media );
		}

		$recheck = array();

		// Return first created by Pods, save extended for later
		foreach ( $objects as $pod ) {
			if ( $object_name == $pod['object'] ) {
				$recheck[] = $pod;
			}

			if ( '' == $pod['object'] && $object_name == $pod['name'] ) {
				return $pod;
			}
		}

		// If no objects created by Pods, return first extended
		foreach ( $recheck as $pod ) {
			return $pod;
		}

		return false;
	}
294894
protected function getPostObject(): array
    {
        $oInput             = Factory::service('Input');
        $oUserGroupModel    = Factory::model('UserGroup', 'nails/module-auth');
        $oUserPasswordModel = Factory::model('UserPassword', 'nails/module-auth');

        return [
            'slug'                  => $oInput->post('slug'),
            'label'                 => $oInput->post('label'),
            'description'           => $oInput->post('description'),
            'default_homepage'      => $oInput->post('default_homepage'),
            'registration_redirect' => $oInput->post('registration_redirect'),
            'acl'                   => $oUserGroupModel->processPermissions($oInput->post('acl')),
            'password_rules'        => $oUserPasswordModel->processRules($oInput->post('pw')),
        ];
    }
720031
protected function getPriceTypeObject()
    {
        $arValuePartList = explode('|', $this->sValue);
        $sPriceTypeCode = array_pop($arValuePartList);

        $obPriceType = PriceTypeHelper::instance()->findByCode($sPriceTypeCode);

        return $obPriceType;
    }
1160640
public function getTaxonomyTypes()
    {
        if (!isset($_POST['posttype']) || empty($_POST['posttype'])) {
            echo '0';
            die();
        }

        $post = $_POST['post'];

        $result = array(
            'types' => get_object_taxonomies($_POST['posttype'], 'object'),
            'curr' => get_field('posts_taxonomy_type', $post)
        );

        echo json_encode($result);
        die();
    }
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;
    }