PluginProbe
Datafeedr API / 1.1.2
Datafeedr API v1.1.2
1.4.2 1.0.125 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 1.0.30 1.0.31 1.0.32 1.0.33 All 181 releases
datafeedr-api / src / Subscribers / TestAdminNotice.php

TestAdminNotice.php in Datafeedr API 1.1.2, at src/Subscribers/TestAdminNotice.php

39 lines 755 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace Datafeedr\Api\Subscribers;
2
3 use Datafeedr\Api\Templates\Template;
4 use Datafeedr\Api\Wuwei\Event\Subscriber_Interface;
5
6 /**
7 * Class TestAdminNotice
8 *
9 * @since 2.0.0
10 */
11 class TestAdminNotice extends Subscriber implements Subscriber_Interface {
12
13 /**
14 * {@inheritdoc}
15 */
16 public static function get_subscribed_events() {
17 return array(
18 'admin_notices' => 'handle',
19 );
20 }
21
22 /**
23 * Echo notice if needed.
24 *
25 * @since 2.0.0
26 */
27 public function handle() {
28
29 $classes = 'notice-info';
30 $message = __( 'Testing admin notices and templates. ', 'datafeedr/api' );
31
32 $data = array(
33 'classes' => esc_attr( $classes ),
34 'message' => esc_html( $message ),
35 );
36
37 echo ( new Template( 'admin/notices', $data ) )->render();
38 }
39 }