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值和描述。

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

	return $status;
}

常见问题

FAQs
查看更多 >