Yoast_Integration_Toggles::sort_toggles_callback()
Callback for sorting integration toggles by their order.
{@internal Once the minimum PHP version goes up to PHP 7.0, the logic in the function can be replaced with the spaceship operator <=>.}
Метод класса: Yoast_Integration_Toggles{}
Хуков нет.
Возвращает
int
. An integer less than, equal to, or greater than zero indicating respectively that feature A is considered to be less than, equal to, or greater than feature B.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->sort_toggles_callback( $feature_a, $feature_b );
- $feature_a(Yoast_Feature_Toggle) (обязательный)
- Feature A.
- $feature_b(Yoast_Feature_Toggle) (обязательный)
- Feature B.
Код Yoast_Integration_Toggles::sort_toggles_callback() Yoast Integration Toggles::sort toggles callback Yoast 24.1
protected function sort_toggles_callback( Yoast_Feature_Toggle $feature_a, Yoast_Feature_Toggle $feature_b ) { return ( $feature_a->order - $feature_b->order ); }