問題描述
(主持人的說明:標題最初是 「wordpress post 物件中的所有變數是什麼?」)
有沒有人知道儲存在 WordPress Post 物件中的變數?
最佳解決方案
Post 物件大部分是查詢 wp_posts 資料庫表中的一些附加元件。很容易轉載一個內容,看看:
object(stdClass)
public 'ID' => int
public 'post_author' => string
public 'post_date' => string
public 'post_date_gmt' => string
public 'post_content' => string
public 'post_title' => string
public 'post_excerpt' => string
public 'post_status' => string
public 'comment_status' => string
public 'ping_status' => string
public 'post_password' => string
public 'post_name' => string
public 'to_ping' => string
public 'pinged' => string
public 'post_modified' => string
public 'post_modified_gmt' => string
public 'post_content_filtered' => string
public 'post_parent' => int
public 'guid' => string
public 'menu_order' => int
public 'post_type' => string
public 'post_mime_type' => string
public 'comment_count' => string
public 'filter' => string
次佳解決方案
如果您是使用 $post(使用 var_dump 檢索) 可以訪問的內容:
-
ID
-
post_author
-
post_date
-
post_date_gmt
-
post_content
-
post_title
-
post_excerpt
-
post_status
-
comment_status
-
ping_status
-
post_password
-
post_name
-
to_ping
-
ping 通
-
post_modified
-
post_modified_gmt
-
post_content_filtered
-
post_parent
-
GUID
-
menu_order
-
post_type
-
post_mime_type
-
comment_count
-
祖先
-
過濾
參考文獻
注:本文內容整合自 Google/Baidu/Bing 輔助翻譯的英文資料結果。如果您對結果不滿意,可以加入我們改善翻譯效果:薇曉朵技術論壇。