get_comments

函式
get_comments ( $args = '' )
引數
  • (string|array) $args Optional. Array or string of arguments. See WP_Comment_Query::__construct() for information on accepted arguments. Default empty.
    Required:
    Default: (empty)
返回值
  • (WP_Comment[]|int[]|int) List of comments or number of found comments if `$count` argument is true.
定義位置
相關方法
get_commentget_comment_idget_comment_classedit_commentget_comments_link
引入
2.7.0
棄用
-

get_comments: 這個函式用來檢索一個給定文章或頁面的評論陣列。評論可以根據各種標準進行過濾,如狀態,父,型別等。

檢索評論列表。

評論列表可以是整個部落格的,也可以是個別文章的。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_comments( $args = '' ) {
$query = new WP_Comment_Query;
return $query->query( $args );
}
function get_comments( $args = '' ) { $query = new WP_Comment_Query; return $query->query( $args ); }
function get_comments( $args = '' ) {
	$query = new WP_Comment_Query;
	return $query->query( $args );
}

常見問題

FAQs
檢視更多 >