Yoast\WP\SEO\Builders

Indexable_Post_Builder::is_public_attachment()protectedYoast 1.0

Determines the value of is_public for attachments.

Метод класса: Indexable_Post_Builder{}

Хуков нет.

Возвращает

true|false|null. False when it has no parent. Null when it has a parent.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->is_public_attachment( $indexable );
$indexable(Indexable) (обязательный)
The indexable.

Код Indexable_Post_Builder::is_public_attachment() Yoast 22.4

protected function is_public_attachment( $indexable ) {
	// If the attachment has no parent, it should not be public.
	if ( empty( $indexable->post_parent ) ) {
		return false;
	}

	// If the attachment has a parent, the is_public should be NULL.
	return null;
}