Yoast\WP\SEO\Abilities\User_Interface\Abilities
Abstract_Score_Ability::is_available
Returns whether the ability is available: the scores are read from the indexables, so they must be built, and the analysis feature the ability depends on must be enabled.
Метод класса: Abstract_Score_Ability{}
Хуков нет.
Возвращает
bool. Whether the ability is available.
Использование
$Abstract_Score_Ability = new Abstract_Score_Ability(); $Abstract_Score_Ability->is_available(): bool;
Код Abstract_Score_Ability::is_available() Abstract Score Ability::is available Yoast 28.9
public function is_available(): bool {
if ( ! $this->should_index_indexables_conditional->is_met() ) {
return false;
}
$feature_name = $this->get_feature_name();
$enabled_features = $this->enabled_analysis_features_repository->get_features_by_keys( [ $feature_name ] )->to_array();
return isset( $enabled_features[ $feature_name ] ) && $enabled_features[ $feature_name ] === true;
}