Yoast\WP\SEO\Introductions\Application
Introductions_Collector::get_for
Gets the data for the introductions.
Метод класса: Introductions_Collector{}
Хуков нет.
Возвращает
Массив. The list of introductions.
Использование
$Introductions_Collector = new Introductions_Collector(); $Introductions_Collector->get_for( $user_id );
- $user_id(int) (обязательный)
- The user ID.
Код Introductions_Collector::get_for() Introductions Collector::get for Yoast 27.6
public function get_for( $user_id ) {
$bucket = new Introductions_Bucket();
$metadata = $this->get_metadata( $user_id );
foreach ( $this->introductions as $introduction ) {
if ( ! $introduction->should_show() ) {
continue;
}
if ( $this->is_seen( $introduction->get_id(), $metadata ) ) {
continue;
}
$bucket->add_introduction(
new Introduction_Item( $introduction->get_id(), $introduction->get_priority() ),
);
}
return $bucket->to_array();
}