Yoast\WP\SEO\Llms_Txt\Infrastructure\Content
Post_Collection_Factory::get_post_collection
Determines which collection class is needed.
Метод класса: Post_Collection_Factory{}
Хуков нет.
Возвращает
Post_Collection_Interface.
Использование
$Post_Collection_Factory = new Post_Collection_Factory(); $Post_Collection_Factory->get_post_collection( $collection_type ): Post_Collection_Interface;
- $collection_type(строка) (обязательный)
- The type of collection.
Код Post_Collection_Factory::get_post_collection() Post Collection Factory::get post collection Yoast 28.9
public function get_post_collection( string $collection_type ): Post_Collection_Interface {
switch ( $collection_type ) {
case 'manual':
return $this->manual_post_collection;
case 'auto':
return $this->automatic_post_collection;
default:
throw new Exception( 'Invalid collection type provided' );
}
}