Yoast\WP\SEO\Dashboard\Domain\Score_Results
Current_Scores_List::to_array
Parses the current score list to the expected key value representation.
Метод класса: Current_Scores_List{}
Хуков нет.
Возвращает
Массив<Массив<Строку,. string|int|array<string, string>>> The score list presented as the expected key value representation.
Использование
$Current_Scores_List = new Current_Scores_List(); $Current_Scores_List->to_array(): array;
Код Current_Scores_List::to_array() Current Scores List::to array Yoast 27.3
public function to_array(): array {
$array = [];
\ksort( $this->current_scores );
foreach ( $this->current_scores as $key => $current_score ) {
$array[] = [
'name' => $current_score->get_name(),
'amount' => $current_score->get_amount(),
'links' => $current_score->get_links_to_array(),
];
if ( $current_score->get_ids() !== null ) {
$array[ $key ]['ids'] = $current_score->get_ids();
}
}
return $array;
}