wordpress通過文章標題獲取頁面信息,如果多個文章標題一致返回id最小的文章信息。
$page_title
(string) (必須) 文章標題
Default: None
$output
(string) (optional) 返回值類型. OBJECT, ARRAY_N, or ARRAY_A.
Default: OBJECT
$post_type
(string) (optional) 文章類型.
Default: page
(mixed)
OBJECT, ARRAY_N, or ARRAY_A.
當沒有查詢到記錄返回NULL.
返回title為“About” 的文章id
get_page_by_title() 位于wp-includes/post.php.
主題貓WP建站,累計幫助1300+客戶成功建站,為站長提供支持!
立刻開啟你的建站之旅