WPSEO_Taxonomy_Columns::is_indexable
Check if the taxonomy is indexable.
Метод класса: WPSEO_Taxonomy_Columns{}
Хуков нет.
Возвращает
true|false. Whether the term is indexable.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_indexable( $term );
- $term(разное) (обязательный)
- The current term.
Код WPSEO_Taxonomy_Columns::is_indexable() WPSEO Taxonomy Columns::is indexable Yoast 26.9
private function is_indexable( $term ) {
// When the no_index value is not empty and not default, check if its value is index.
$no_index = WPSEO_Taxonomy_Meta::get_term_meta( $term->term_id, $this->taxonomy, 'noindex' );
// Check if the default for taxonomy is empty (this will be index).
if ( ! empty( $no_index ) && $no_index !== 'default' ) {
return ( $no_index === 'index' );
}
if ( is_object( $term ) ) {
$no_index_key = 'noindex-tax-' . $term->taxonomy;
// If the option is false, this means we want to index it.
return WPSEO_Options::get( $no_index_key, false ) === false;
}
return true;
}