wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



get_post_type › WordPress Function

Da2.1.0
Deprecaton/a
get_post_type ( $post = null )
Parametri:
  • (int|WP_Post|null) $post Optional. Post ID or post object. Default is global $post.
    Richiesto: No
    Default: null
Ritorna:
  • (string|false) Post type on success, false on failure.
Definito a:
Codex:

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



Sorgenti

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

	return false;
}