Yoast\WP\SEO\Integrations\Watchers
Indexable_Post_Watcher::update_has_public_posts() protected Yoast 1.0
Updates the has_public_posts when the post indexable is built.
{} Это метод класса: Indexable_Post_Watcher{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->update_has_public_posts( $indexable );
- $indexable(Indexable) (обязательный)
- The indexable to check.
Код Indexable_Post_Watcher::update_has_public_posts() Indexable Post Watcher::update has public posts Yoast 15.6.2
protected function update_has_public_posts( $indexable ) {
// Update the author indexable's has public posts value.
try {
$author_indexable = $this->repository->find_by_id_and_type( $indexable->author_id, 'user' );
$author_indexable->has_public_posts = $this->author_archive->author_has_public_posts( $author_indexable->object_id );
$author_indexable->save();
} catch ( Exception $exception ) {
$this->logger->log( LogLevel::ERROR, $exception->getMessage() );
}
// Update possible attachment's has public posts value.
$this->post->update_has_public_posts_on_attachments( $indexable->object_id, $indexable->is_public );
}