get_comment_statuses

函式
get_comment_statuses ( No parameters )
返回值
  • (string[]) List of comment status labels keyed by status.
定義位置
相關方法
wp_get_comment_statusget_comment_datewp_set_comment_statusget_comment_classget_post_statuses
引入
2.7.0
棄用
-

get_comment_statuses – 這個函式返回一個可用的評論狀態的陣列。它通常用於填充WordPress管理中的評論狀態的下拉選單。

檢索所有WordPress支援的評論狀態。

評論有一組有限的有效狀態值,這提供了評論的狀態值和描述。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_comment_statuses() {
$status = array(
'hold' => __( 'Unapproved' ),
'approve' => _x( 'Approved', 'comment status' ),
'spam' => _x( 'Spam', 'comment status' ),
'trash' => _x( 'Trash', 'comment status' ),
);
return $status;
}
function get_comment_statuses() { $status = array( 'hold' => __( 'Unapproved' ), 'approve' => _x( 'Approved', 'comment status' ), 'spam' => _x( 'Spam', 'comment status' ), 'trash' => _x( 'Trash', 'comment status' ), ); return $status; }
function get_comment_statuses() {
	$status = array(
		'hold'    => __( 'Unapproved' ),
		'approve' => _x( 'Approved', 'comment status' ),
		'spam'    => _x( 'Spam', 'comment status' ),
		'trash'   => _x( 'Trash', 'comment status' ),
	);

	return $status;
}

常見問題

FAQs
檢視更多 >