Yoast\WP\SEO\AI_Generator\Domain
Suggestions_Bucket{}
Устарела с версии 28.4. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.
Class Suggestion_Bucket Represents a collection of Suggestion objects.
Хуков нет.
Использование
$Suggestions_Bucket = new Suggestions_Bucket(); // use class methods
Методы
- public __construct()
- public add_suggestion( Suggestion $suggestion )
- public to_array()
- public _deprecated_function( __METHOD__, 'Yoast SEO 28.4' )
- ERROR: no method name found on line `*`
- ERROR: no method name found on line `*`
Список изменений
| Устарела с | 28.4 |
Код Suggestions_Bucket{} Suggestions Bucket{} Yoast 28.9
class Suggestions_Bucket {
/**
* The suggestions.
*
* @var array<Suggestion>
*/
private $suggestions;
/**
* Class constructor.
*
* @deprecated 28.4
* @codeCoverageIgnore
*/
public function __construct() {
\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
$this->suggestions = [];
}
/**
* Adds a suggestion to the bucket.
*
* @deprecated 28.4
* @codeCoverageIgnore
*
* @param Suggestion $suggestion The suggestion to add.
*
* @return void
*/
public function add_suggestion( Suggestion $suggestion ) {
\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
$this->suggestions[] = $suggestion;
}
/**
* Returns the suggestions as an array.
*
* @deprecated 28.4
* @codeCoverageIgnore
*
* @return array<string>
*/
public function to_array() {
\_deprecated_function( __METHOD__, 'Yoast SEO 28.4' );
return \array_map(
static function ( $item ) {
return $item->get_value();
},
$this->suggestions,
);
}
}