Yoast\WP\SEO\Introductions\Application

Introductions_Collector::get_for()publicYoast 1.0

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() Yoast 24.4

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();
}