WP_Customize_Manager::_cmp_priority PHP Method

_cmp_priority() protected method

Helper function to compare two objects by priority, ensuring sort stability via instance_number.
Deprecation: 4.7.0 Use wp_list_sort()
Since: 3.4.0
protected _cmp_priority ( WP_Customize_Panel | WP_Customize_Section | WP_Customize_Control $a, WP_Customize_Panel | WP_Customize_Section | WP_Customize_Control $b ) : integer
$a WP_Customize_Panel | WP_Customize_Section | WP_Customize_Control Object A.
$b WP_Customize_Panel | WP_Customize_Section | WP_Customize_Control Object B.
return integer
    protected function _cmp_priority($a, $b)
    {
        _deprecated_function(__METHOD__, '4.7.0', 'wp_list_sort');
        if ($a->priority === $b->priority) {
            return $a->instance_number - $b->instance_number;
        } else {
            return $a->priority - $b->priority;
        }
    }
WP_Customize_Manager