Automattic\WooCommerce\Internal\Abilities
AbilitiesTracking::find_frame
Find the innermost open invocation of an ability in a given execution state.
Matching the state keeps a recursive call that failed without a closing hook from hiding its outer call.
Метод класса: AbilitiesTracking{}
Хуков нет.
Возвращает
int|null. Index in the frames stack, or null when none is open.
Использование
// private - только в коде основоного (родительского) класса $result = $this->find_frame( $ability_name, $executing ): ?int;
- $ability_name(строка) (обязательный)
- The ability name.
- $executing(true|false) (обязательный)
- Whether the invocation must have started executing.
Код AbilitiesTracking::find_frame() AbilitiesTracking::find frame WC 11.3.0
private function find_frame( string $ability_name, bool $executing ): ?int {
for ( $index = count( $this->frames ) - 1; $index >= 0; $index-- ) {
if ( $ability_name === $this->frames[ $index ]['name'] && $executing === $this->frames[ $index ]['executing'] ) {
return $index;
}
}
return null;
}