Yoast\WP\SEO\Introductions\Infrastructure
Introductions_Seen_Repository::get_all_introductions()
Retrieves the introductions.
Метод класса: Introductions_Seen_Repository{}
Хуков нет.
Возвращает
Массив
. The introductions.
Использование
$Introductions_Seen_Repository = new Introductions_Seen_Repository(); $Introductions_Seen_Repository->get_all_introductions( $user_id ): array;
- $user_id(int) (обязательный)
- User ID.
Код Introductions_Seen_Repository::get_all_introductions() Introductions Seen Repository::get all introductions Yoast 24.4
public function get_all_introductions( $user_id ): array { $seen_introductions = $this->user_helper->get_meta( $user_id, self::USER_META_KEY, true ); if ( $seen_introductions === false ) { throw new Invalid_User_Id_Exception(); } if ( \is_array( $seen_introductions ) ) { return $seen_introductions; } /** * Why could $value be invalid? * - When the database row does not exist yet, $value can be an empty string. * - Faulty data was stored? */ return self::DEFAULT_VALUE; }