問題描述

(主持人的説明:標題最初是 「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 輔助翻譯的英文資料結果。如果您對結果不滿意,可以加入我們改善翻譯效果:薇曉朵技術論壇。