Yoast_Notifications::output_ajax_response
Create AJAX response data.
Метод класса: Yoast_Notifications{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
// private - только в коде основоного (родительского) класса $result = $this->output_ajax_response( $type );
- $type(строка) (обязательный)
- Notification type.
Код Yoast_Notifications::output_ajax_response() Yoast Notifications::output ajax response Yoast 27.6
private function output_ajax_response( $type ) {
$html = $this->get_view_html( $type );
// phpcs:disable WordPress.Security.EscapeOutput -- Reason: WPSEO_Utils::format_json_encode is safe.
echo WPSEO_Utils::format_json_encode(
[
'html' => $html,
'total' => self::get_active_notification_count(),
],
);
// phpcs:enable -- Reason: WPSEO_Utils::format_json_encode is safe.
}