get_post_statuses

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

get_post_statuses: 這個函式為所有可用的文章狀態檢索一個文章狀態物件的陣列,包括自定義狀態。

檢索所有WordPress支援的文章狀態。
文章有一組有限的有效狀態值,這提供了post_status值和描述。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_post_statuses() {
$status = array(
'draft' => __( 'Draft' ),
'pending' => __( 'Pending Review' ),
'private' => __( 'Private' ),
'publish' => __( 'Published' ),
);
return $status;
}
function get_post_statuses() { $status = array( 'draft' => __( 'Draft' ), 'pending' => __( 'Pending Review' ), 'private' => __( 'Private' ), 'publish' => __( 'Published' ), ); return $status; }
function get_post_statuses() {
	$status = array(
		'draft'   => __( 'Draft' ),
		'pending' => __( 'Pending Review' ),
		'private' => __( 'Private' ),
		'publish' => __( 'Published' ),
	);

	return $status;
}

常見問題

FAQs
檢視更多 >