Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the updraftplus domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /var/www/vhosts/w16609.ws.domainking.cloud/mudabukuro.miracle-dance.com/wp-includes/functions.php on line 6114
get_post()/get_pages()の戻り値 | 無駄ぶくろ~無駄なモノほど面白い
Deprecated:関数 print_emoji_styles は、バージョン 6.4.0 から非推奨になりました ! 代わりに wp_enqueue_emoji_styles を使用してください。 in /var/www/vhosts/w16609.ws.domainking.cloud/mudabukuro.miracle-dance.com/wp-includes/functions.php on line 6114

get_post()/get_pages()の戻り値

固定ページでの get_post()/pages()の戻り値をチェック
(このページの戻り値を表示)

get_post( $id, ARRAY_A ); で、戻り値を「配列」を取得したときは、自分のすべての親(親、祖父母?など)のID番号が戻ってくるのですが、objectで取得すると、自分の直の親だけしか戻ってこないので 必要ならget_ancestors()で取得..みたいな違いがありそうです。

get_post_get_pages

●自分自身 get_post() OBJECT;
ID100323
post_author1
post_date2022-03-09 08:30:20
post_date_gmt2022-03-08 23:30:20
post_content<省略>
post_titleget_post()/get_pages()の戻り値
post_excerpt
post_statuspublish
comment_statusclosed
ping_statusclosed
post_password
post_namepage-100323
to_ping
pinged
post_modified2022-03-09 09:12:46
post_modified_gmt2022-03-09 00:12:46
post_content_filtered
post_parent100123
guidhttps://mudabukuro.miracle-dance.com/?page_id=100323
menu_order0
post_typepage
post_mime_type
comment_count0
filterraw
●自分自身 get_post() 連想配列;
ID100323
post_author1
post_date2022-03-09 08:30:20
post_date_gmt2022-03-08 23:30:20
post_content<省略>
post_titleget_post()/get_pages()の戻り値
post_excerpt
post_statuspublish
comment_statusclosed
ping_statusclosed
post_password
post_namepage-100323
to_ping
pinged
post_modified2022-03-09 09:12:46
post_modified_gmt2022-03-09 00:12:46
post_content_filtered
post_parent100123
guidhttps://mudabukuro.miracle-dance.com/?page_id=100323
menu_order0
post_typepage
post_mime_type
comment_count0
filterraw
ancestors配列(100123)(100325)
page_templatedefault
post_category配列
tags_input配列
●自分自身 get_posts();
項目数:1/1
ID100323
post_author1
post_date2022-03-09 08:30:20
post_date_gmt2022-03-08 23:30:20
post_content<省略>
post_titleget_post()/get_pages()の戻り値
post_excerpt
post_statuspublish
comment_statusclosed
ping_statusclosed
post_password
post_namepage-100323
to_ping
pinged
post_modified2022-03-09 09:12:46
post_modified_gmt2022-03-09 00:12:46
post_content_filtered
post_parent100123
guidhttps://mudabukuro.miracle-dance.com/?page_id=100323
menu_order0
post_typepage
post_mime_type
comment_count0
filterraw
●自分自身 get_pages();
項目数:1/1
ID100323
post_author1
post_date2022-03-09 08:30:20
post_date_gmt2022-03-08 23:30:20
post_content<省略>
post_titleget_post()/get_pages()の戻り値
post_excerpt
post_statuspublish
comment_statusclosed
ping_statusclosed
post_password
post_namepage-100323
to_ping
pinged
post_modified2022-03-09 09:12:46
post_modified_gmt2022-03-09 00:12:46
post_content_filtered
post_parent100123
guidhttps://mudabukuro.miracle-dance.com/?page_id=100323
menu_order0
post_typepage
post_mime_type
comment_count0
filterraw