Yoast_Notifications::get_view_html()privateYoast 1.0

Get the HTML to return in the AJAX request.

Метод класса: Yoast_Notifications{}

Хуков нет.

Возвращает

true|false|Строку.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->get_view_html( $type );
$type(строка) (обязательный)
Notification type.

Код Yoast_Notifications::get_view_html() Yoast 22.4

private function get_view_html( $type ) {

	switch ( $type ) {
		case 'error':
			$view = 'errors';
			break;

		case 'warning':
		default:
			$view = 'warnings';
			break;
	}

	// Re-collect notifications.
	self::collect_notifications();

	/**
	 * Stops PHPStorm from nagging about this variable being unused. The variable is used in the view.
	 *
	 * @noinspection PhpUnusedLocalVariableInspection
	 */
	$notifications_data = self::get_template_variables();

	ob_start();
	include WPSEO_PATH . 'admin/views/partial-notifications-' . $view . '.php';
	$html = ob_get_clean();

	return $html;
}