get_post()/get_pages()の戻り値
固定ページでの get_post()/pages()の戻り値をチェック
(このページの戻り値を表示)
get_post( $id, ARRAY_A ); で、戻り値を「配列」を取得したときは、自分のすべての親(親、祖父母?など)のID番号が戻ってくるのですが、objectで取得すると、自分の直の親だけしか戻ってこないので 必要ならget_ancestors()で取得..みたいな違いがありそうです。
get_post_get_pages
●自分自身 get_post() OBJECT;
●自分自身 get_post() 連想配列;
●自分自身 get_posts();
●自分自身 get_pages();
| ID | 100323 |
| post_author | 1 |
| post_date | 2022-03-09 08:30:20 |
| post_date_gmt | 2022-03-08 23:30:20 |
| post_content | <省略> |
| post_title | get_post()/get_pages()の戻り値 |
| post_excerpt | |
| post_status | publish |
| comment_status | closed |
| ping_status | closed |
| post_password | |
| post_name | page-100323 |
| to_ping | |
| pinged | |
| post_modified | 2022-03-09 09:12:46 |
| post_modified_gmt | 2022-03-09 00:12:46 |
| post_content_filtered | |
| post_parent | 100123 |
| guid | https://mudabukuro.miracle-dance.com/?page_id=100323 |
| menu_order | 0 |
| post_type | page |
| post_mime_type | |
| comment_count | 0 |
| filter | raw |
| ID | 100323 |
| post_author | 1 |
| post_date | 2022-03-09 08:30:20 |
| post_date_gmt | 2022-03-08 23:30:20 |
| post_content | <省略> |
| post_title | get_post()/get_pages()の戻り値 |
| post_excerpt | |
| post_status | publish |
| comment_status | closed |
| ping_status | closed |
| post_password | |
| post_name | page-100323 |
| to_ping | |
| pinged | |
| post_modified | 2022-03-09 09:12:46 |
| post_modified_gmt | 2022-03-09 00:12:46 |
| post_content_filtered | |
| post_parent | 100123 |
| guid | https://mudabukuro.miracle-dance.com/?page_id=100323 |
| menu_order | 0 |
| post_type | page |
| post_mime_type | |
| comment_count | 0 |
| filter | raw |
| ancestors | 配列(100123)(100325) |
| page_template | default |
| post_category | 配列 |
| tags_input | 配列 |
| 項目数:1/1 | |
| ID | 100323 |
| post_author | 1 |
| post_date | 2022-03-09 08:30:20 |
| post_date_gmt | 2022-03-08 23:30:20 |
| post_content | <省略> |
| post_title | get_post()/get_pages()の戻り値 |
| post_excerpt | |
| post_status | publish |
| comment_status | closed |
| ping_status | closed |
| post_password | |
| post_name | page-100323 |
| to_ping | |
| pinged | |
| post_modified | 2022-03-09 09:12:46 |
| post_modified_gmt | 2022-03-09 00:12:46 |
| post_content_filtered | |
| post_parent | 100123 |
| guid | https://mudabukuro.miracle-dance.com/?page_id=100323 |
| menu_order | 0 |
| post_type | page |
| post_mime_type | |
| comment_count | 0 |
| filter | raw |
| 項目数:1/1 | |
| ID | 100323 |
| post_author | 1 |
| post_date | 2022-03-09 08:30:20 |
| post_date_gmt | 2022-03-08 23:30:20 |
| post_content | <省略> |
| post_title | get_post()/get_pages()の戻り値 |
| post_excerpt | |
| post_status | publish |
| comment_status | closed |
| ping_status | closed |
| post_password | |
| post_name | page-100323 |
| to_ping | |
| pinged | |
| post_modified | 2022-03-09 09:12:46 |
| post_modified_gmt | 2022-03-09 00:12:46 |
| post_content_filtered | |
| post_parent | 100123 |
| guid | https://mudabukuro.miracle-dance.com/?page_id=100323 |
| menu_order | 0 |
| post_type | page |
| post_mime_type | |
| comment_count | 0 |
| filter | raw |