2011-09-09 1 views
0

내가 게시물에서 무엇을 얻을 알 수 있도록 반환 된 목록의 사용 가능한 필드를 찾을 수 있습니다 어디 $query = new WP_Query(arguments); 또는WP_Query에서 반환 한 게시물의 필드는 어디에서 찾을 수 있습니까?

$worksArray = get_posts(args);를 사용한다고 말할 수 있습니다?

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

그 밖에도 ID 외에도 $ 작업 객체에는 무엇이 있습니까? 반환 된 유형의 클래스 다이어그램/참조를 찾을 수 없습니다. 코덱스의 문서에 따르면 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 
관련 문제