Yoast_Notification::render()publicYoast 1.0

Renders the notification as a string.

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

Хуков нет.

Возвращает

Строку. The rendered notification.

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

$Yoast_Notification = new Yoast_Notification();
$Yoast_Notification->render();

Код Yoast_Notification::render() Yoast 24.0

public function render() {
	$attributes = [];

	// Default notification classes.
	$classes = [
		'yoast-notification',
	];

	// Maintain WordPress visualisation of notifications when they are not persistent.
	if ( ! $this->is_persistent() ) {
		$classes[] = 'notice';
		$classes[] = $this->get_type();
	}

	if ( ! empty( $classes ) ) {
		$attributes['class'] = implode( ' ', $classes );
	}

	// Combined attribute key and value into a string.
	array_walk( $attributes, [ $this, 'parse_attributes' ] );

	$message = null;
	if ( $this->options['yoast_branding'] ) {
		$message = $this->wrap_yoast_seo_icon( $this->message );
	}

	if ( $message === null ) {
		$message = wpautop( $this->message );
	}

	// Build the output DIV.
	return '<div ' . implode( ' ', $attributes ) . '>' . $message . '</div>' . PHP_EOL;
}