wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



get_post_type › WordPress Function

Desde2.1.0
Obsoleton/a
get_post_type ( $post = null )
Parâmetros:
  • (int|WP_Post|null) $post Optional. Post ID or post object. Default is global $post.
    Required: No
    Padrão: null
Retorna:
  • (string|false) Post type on success, false on failure.
Definido em:
Codex:

Retrieves the post type of the current post or of a given post.



Fonte

function get_post_type( $post = null ) {
	$post = get_post( $post );
	if ( $post ) {
		return $post->post_type;
	}

	return false;
}