Changeset 38863 for trunk/src/wp-includes/deprecated.php
- Timestamp:
- 10/21/2016 05:00:29 PM (9 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/deprecated.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/deprecated.php
r38859 r38863 3799 3799 return preg_replace( '%&\s*\{[^}]*(\}\s*;?|$)%', '', $string ); 3800 3800 } 3801 3802 /**3803 * Sort categories by ID.3804 *3805 * Used by usort() as a callback, should not be used directly. Can actually be3806 * used to sort any term object.3807 *3808 * @since 2.3.03809 * @deprecated 4.7.0 Use wp_list_sort()3810 * @access private3811 *3812 * @param object $a3813 * @param object $b3814 * @return int3815 */3816 function _usort_terms_by_ID( $a, $b ) {3817 _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' );3818 3819 if ( $a->term_id > $b->term_id )3820 return 1;3821 elseif ( $a->term_id < $b->term_id )3822 return -1;3823 else3824 return 0;3825 }3826 3827 /**3828 * Sort categories by name.3829 *3830 * Used by usort() as a callback, should not be used directly. Can actually be3831 * used to sort any term object.3832 *3833 * @since 2.3.03834 * @deprecated 4.7.0 Use wp_list_sort()3835 * @access private3836 *3837 * @param object $a3838 * @param object $b3839 * @return int3840 */3841 function _usort_terms_by_name( $a, $b ) {3842 _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' );3843 3844 return strcmp( $a->name, $b->name );3845 }3846 3847 /**3848 * Sort menu items by the desired key.3849 *3850 * @since 3.0.03851 * @deprecated 4.7.0 Use wp_list_sort()3852 * @access private3853 *3854 * @global string $_menu_item_sort_prop3855 *3856 * @param object $a The first object to compare3857 * @param object $b The second object to compare3858 * @return int -1, 0, or 1 if $a is considered to be respectively less than, equal to, or greater than $b.3859 */3860 function _sort_nav_menu_items( $a, $b ) {3861 global $_menu_item_sort_prop;3862 3863 _deprecated_function( __FUNCTION__, '4.7.0', 'wp_list_sort' );3864 3865 if ( empty( $_menu_item_sort_prop ) )3866 return 0;3867 3868 if ( ! isset( $a->$_menu_item_sort_prop ) || ! isset( $b->$_menu_item_sort_prop ) )3869 return 0;3870 3871 $_a = (int) $a->$_menu_item_sort_prop;3872 $_b = (int) $b->$_menu_item_sort_prop;3873 3874 if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop )3875 return 0;3876 elseif ( $_a == $a->$_menu_item_sort_prop && $_b == $b->$_menu_item_sort_prop )3877 return $_a < $_b ? -1 : 1;3878 else3879 return strcmp( $a->$_menu_item_sort_prop, $b->$_menu_item_sort_prop );3880 }
Note: See TracChangeset
for help on using the changeset viewer.