get_page_statuses

函式
get_page_statuses ( No parameters )
返回值
  • (string[]) Array of page status labels keyed by their status.
定義位置
相關方法
get_post_statusesget_page_templatesget_comment_statusesget_page_templateget_post_status
引入
2.5.0
棄用
-

get_page_statuses函式是一個WordPress函式,用於檢索可用的頁面狀態的陣列: 這個函式不接受任何引數: 該函式返回一個頁面狀態的陣列。

檢索所有的WordPress支援頁面的狀態。

頁面有一組有限的有效狀態值,這提供了post_status值和描述。

function get_page_statuses() {
	$status = array(
		'draft'   => __( 'Draft' ),
		'private' => __( 'Private' ),
		'publish' => __( 'Published' ),
	);

	return $status;
}

常見問題

FAQs
檢視更多 >