GC_Customize_Manager::_cmp_priority()

最后更新于:2021-11-27 02:52:11

GC_Customize_Manager::_cmp_priority( GC_Customize_Panel|GC_Customize_Section|GC_Customize_Control$a, GC_Customize_Panel|GC_Customize_Section|GC_Customize_Control$b)

Helper function to compare two objects by priority, ensuring sort stability via instance_number.

参数

$a

(GC_Customize_Panel|GC_Customize_Section|GC_Customize_Control) (Required) Object A.

$b

(GC_Customize_Panel|GC_Customize_Section|GC_Customize_Control) (Required) Object B.

响应

(int)

源文件

文件: gc-includes/class-gc-customize-manager.php

	protected function _cmp_priority( $a, $b ) {
		_deprecated_function( __METHOD__, '4.7.0', 'gc_list_sort' );

		if ( $a->priority === $b->priority ) {
			return $a->instance_number - $b->instance_number;
		} else {
			return $a->priority - $b->priority;
		}
	}