WP_Speculation_Rules::jsonSerialize
Returns the speculation rules data ready to be JSON-encoded.
Метод класса: WP_Speculation_Rules{}
Хуков нет.
Возвращает
Массив<Строку,. array<int, array<string, mixed>>> Speculation rules data.
Использование
$WP_Speculation_Rules = new WP_Speculation_Rules(); $WP_Speculation_Rules->jsonSerialize();
Список изменений
| С версии 6.8.0 | Введена. |
Код WP_Speculation_Rules::jsonSerialize() WP Speculation Rules::jsonSerialize WP 7.0
public function jsonSerialize() {
// Strip the IDs for JSON output, since they are not relevant for the Speculation Rules API.
return array_map(
static function ( array $rules ) {
return array_values( $rules );
},
array_filter( $this->rules_by_mode )
);
}