2011-09-09 17 views
0

は私がポストから取得するために知っているので、私は返されるリストの利用可能なフィールドを見つけることができます$query = new WP_Query(arguments);または$worksArray = get_posts(args);WP_Queryによって返された投稿のフィールドはどこにありますか?

を使用するとしましょうか?

foreach ($worksArray as $work) { 
    $work->ID 
} 

id以外に$ workオブジェクトには何がありますか? 返された型のクラス図/参照が見つかりません。コーデックスの文書にはit returns the list of postsと記載されていますが、参照するリンクはありません何がですか?

(例:$work->the_title()$work->something_else)ページから

+0

は 'ますprint_r($の仕事を)行い' –

+0

ではありませんすべての文書はありますか?それはポストタイプの「投稿」です。文書があるはずです – Odys

+0

見てください。 'get_posts()'ドキュメントの中で:http://codex.wordpress.org/Function_Reference/get_post#Return –

答えて

1

http://codex.wordpress.org/Function_Reference/get_post#Return

返されるフィールドは、次のとおりです。

ID (integer) The post ID 
post_author (integer) The post author's ID 
post_date (string) The datetime of the post (YYYY-MM-DD HH:MM:SS) 
post_date_gmt (string) The GMT datetime of the post (YYYY-MM-DD HH:MM:SS) 
post_content (string) The post's contents 
post_title (string) The post's title 
post_category (integer) The post category's ID. 
post_excerpt (string) The post excerpt 
post_status (string) The post status 
comment_status (string) The comment status (open|closed|registered_only) 
ping_status (string) The pingback/trackback status (open|closed) 
post_password (string) The post password 
post_name (string) The post's URL slug 
to_ping (string) URLs to be pinged 
pinged (string) URLs already pinged 
post_modified (string) The last modified datetime of the post 
post_modified_gmt (string) The last modified GMT datetime of the post 
post_content_filtered (string) 
post_parent (integer) The parent post's ID (for attachments, etc) 
guid (string) A link to the post. 
menu_order (integer) 
post_type (string) (post|page|attachment) 
post_mime_type (string) Mime Type (for attachments, etc) 
comment_count (integer) Number of comments 
関連する問題