函数
_sort_nav_menu_items ( $a, $b )
- Access
- Private
- 参数
-
-
(object)
$a
The first object to compare- Required: 是
-
(object)
$b
The second object to compare- Required: 是
-
(object)
- 返回值
-
- (int) -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b.
- 定义位置
-
-
wp-includes/deprecated.php
, line 3890
-
wp-includes/deprecated.php
- 引入
- 3.0.0
- 弃用
- 4.7.0
Sort menu items by the desired key.
function _sort_nav_menu_items( $a, $b ) { global $_menu_item_sort_prop; _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort()' ); if ( empty( $_menu_item_sort_prop ) ) return 0; if ( ! isset( $a->$_menu_item_sort_prop ) || ! isset( $b->$_menu_item_sort_prop ) ) return 0; $_a = (int) $a->$_menu_item_sort_prop; $_b = (int) $b->$_menu_item_sort_prop; if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop ) return 0; elseif ( $_a == $a->$_menu_item_sort_prop && $_b == $b->$_menu_item_sort_prop ) return $_a $_menu_item_sort_prop, $b->$_menu_item_sort_prop ); }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。