_wp_object_count_sort_cb

函式
_wp_object_count_sort_cb ( $a, $b )
Access
Private
引數
  • (object) $a The first object to compare.
    Required:
  • (object) $b The second object to compare.
    Required:
返回值
  • (bool) Whether the count value for `$a` is greater than the count value for `$b`.
定義位置
相關方法
_wp_object_name_sort_cb_wp_get_current_userwp_get_current_userwp_set_current_userwp_get_custom_css
引入
3.1.0
棄用
-

_wp_object_count_sort_cb: 這個函式是一個回撥函式,用於按照物件的計數屬性進行排序。

作為一個回撥,根據計數來比較物件。

與 `uasort()`一起使用。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function _wp_object_count_sort_cb( $a, $b ) {
return ( $a->count > $b->count );
}
function _wp_object_count_sort_cb( $a, $b ) { return ( $a->count > $b->count ); }
function _wp_object_count_sort_cb( $a, $b ) {
	return ( $a->count > $b->count );
}

常見問題

FAQs
檢視更多 >