Yoast\WP\SEO\Builders
Indexable_Post_Builder::is_public() protected Yoast 1.0
Determines the value of is_public.
{} Это метод класса: Indexable_Post_Builder{}
Хуков нет.
Возвращает
true/false/null. Whether or not the post type is public. Null if no override is set.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->is_public( $indexable );
- $indexable(Indexable) (обязательный)
- The indexable.
Код Indexable_Post_Builder::is_public() Indexable Post Builder::is public Yoast 15.6.2
protected function is_public( $indexable ) {
if ( $indexable->is_protected === true ) {
return false;
}
if ( $indexable->is_robots_noindex === true ) {
return false;
}
// Attachments behave differently than the other post types, since they inherit from their parent.
if ( $indexable->object_sub_type === 'attachment' ) {
return $this->is_public_attachment( $indexable );
}
if ( ! \in_array( $indexable->post_status, $this->is_public_post_status(), true ) ) {
return false;
}
if ( $indexable->is_robots_noindex === false ) {
return true;
}
return null;
}