This repository has been archived on 2026-10-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
studio-2013/wp-content/plugins/wordpress-seo/admin/class-yoast-notification.php
T
2015-05-01 21:20:47 +02:00

80 lines
1.3 KiB
PHP

<?php
/**
* @package WPSEO\Admin
* @since 1.5.3
*/
/**
* Implements individual notification.
*/
class Yoast_Notification {
/**
* @var string The notification message
*/
private $message;
/**
* @var string The notification type, i.e. 'updated' or 'error'
*/
private $type;
/**
* The Constructor
*
* @param String $message
* @param String $type
*/
public function __construct( $message, $type = 'updated' ) {
$this->message = $message;
$this->type = $type;
}
/**
* @return String
*/
public function get_message() {
return $this->message;
}
/**
* @param String $message
*/
public function set_message( $message ) {
$this->message = $message;
}
/**
* @return String
*/
public function get_type() {
return $this->type;
}
/**
* @param String $type
*/
public function set_type( $type ) {
$this->type = $type;
}
/**
* Return the object properties as an array
*
* @return array
*/
public function to_array() {
return array(
'message' => $this->get_message(),
'type' => $this->get_type()
);
}
/**
* Output the message
*/
public function output() {
echo '<div class="yoast-notice ', esc_attr( $this->get_type() ), '">', wpautop( $this->get_message() ), '</div>', PHP_EOL;
}
}