MENU

get_post_ancestors

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

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

目次

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

[php][/php]

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.

よかったらシェアしてね!
  • URLをコピーしました!

この記事を書いた人

WordPress Love! 休日はほぼWordPress仲間と一緒に勉強会や写真を撮りに行っています。現在育児中のため、オフが多いです(>△<<<)

コメント

コメントする

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

目次