# datafeedr-api/1.0.125/src/Subscribers/TestAdminNotice.php

Datafeedr API, version 1.0.125. 39 lines.

- Page: https://pluginprobe.com/plugins/datafeedr-api/1.0.125/code/src/Subscribers/TestAdminNotice.php
- Raw: https://pluginprobe.com/plugins/datafeedr-api/1.0.125/raw/src/Subscribers/TestAdminNotice.php
- Modified: 2018-02-08T16:35:32+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/datafeedr-api/1.0.125/code/src/Subscribers/TestAdminNotice.php#L10-L20`.

```php
<?php namespace Datafeedr\Api\Subscribers;

use Datafeedr\Api\Templates\Template;
use Datafeedr\Api\Wuwei\Event\Subscriber_Interface;

/**
 * Class TestAdminNotice
 *
 * @since 2.0.0
 */
class TestAdminNotice extends Subscriber implements Subscriber_Interface {

	/**
	 * {@inheritdoc}
	 */
	public static function get_subscribed_events() {
		return array(
			'admin_notices' => 'handle',
		);
	}

	/**
	 * Echo notice if needed.
	 *
	 * @since 2.0.0
	 */
	public function handle() {

		$classes = 'notice-info';
		$message = __( 'Testing admin notices and templates. ', 'datafeedr/api' );

		$data = array(
			'classes' => esc_attr( $classes ),
			'message' => esc_html( $message ),
		);

		echo ( new Template( 'admin/notices', $data ) )->render();
	}
}
```
