get_post_ancestors

Sponsored Link

投稿IDに基づいて、投稿の親を取得します。

Sponsored Link

Retrieve the parents of the post based on the post ID.

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

<?php get_post_ancestors( $post ) ?>

get_post_ancestorsのパラメーター

$post

(mixed) (required) 投稿IDまたは、投稿オブジェクト
デフォルト:なし

(mixed) (required) Post ID or post object.
Default: None

戻り値

(array)
IDまたは空の配列の場合、上位を発見できません。親は、配列内の最初の値として返されます。

(array)
Array of IDs or empty if no ancestors are found. The parent is returned as the first value in the array.

変更ログ

Since: 2.5.0

ソースファイル

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

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

Sponsored Link