get_post_type

Sponsored Link

現在の投稿か、特定の投稿の投稿タイプを取得します。

Sponsored Link

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

get_post_typeのファンクションタグ使用方法

<?php get_post_type( $post ) ?>

get_post_typeのパラメーター

$post

(mixed) (optional) 投稿オブジェクトか投稿ID。
Default: false

(mixed) (optional) Post object or post ID.
Default: false

戻り値

(boolean|string)
投稿タイプまたは失敗した場合にFALSEを返します。

(boolean|string)
post type or false on failure.

注釈

  • Uses: $wpdb
  • Uses: $posts The Loop post global

変更ログ

Since: 2.1.0

ソースファイル

get_post_type() は、wp-includes/post.php内に位置しています。

get_post_type() is located in wp-includes/post.php.

関連ファンクションタグ

Post Types: register_post_type(), add_post_type_support(), remove_post_type_support(), post_type_supports(), post_type_exists(), set_post_type(), get_post_type(), get_post_types(), get_post_type_object(), get_post_type_capabilities(), get_post_type_labels(), is_post_type_hierarchical(), is_post_type_archive(), post_type_archive_title()

Sponsored Link