PluginProbe
Floating Button – Easily Create Sticky, Fixed & Floating Buttons / 6.0.3
Floating Button – Easily Create Sticky, Fixed & Floating Buttons v6.0.3
trunk 2.0.2 3.0 4.0 4.1.2 4.3 5.0 5.0.1 5.1 5.1.1 5.2 5.3 5.3.1 6.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 All 31 releases
floating-button / classes / Admin / AdminNotices.php

AdminNotices.php in Floating Button – Easily Create Sticky, Fixed & Floating Buttons 6.0.3, at classes/Admin/AdminNotices.php

44 lines 970 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FloatingButton\Admin;
4
5 use FloatingButton\WOW_Plugin;
6
7 defined( 'ABSPATH' ) || exit;
8
9 class AdminNotices {
10
11
12 public function __construct() {
13 add_action( 'admin_notices', [ $this, 'admin_notice' ] );
14 }
15
16 public function admin_notice() {
17 $notice = $_GET['notice'] ?? '';
18
19 if(!isset($_GET['page'])) {
20 return false;
21 }
22
23 if($_GET['page'] !== WOW_Plugin::SLUG) {
24 return false;
25 }
26
27 if ( ! empty( $notice ) && $notice === 'save_item' ) {
28 $this->save_item();
29 } elseif ( ! empty( $notice ) && $notice === 'remove_item' ) {
30 $this->remove_item();
31 }
32 }
33
34 public function save_item() {
35 $text = __( 'Item saved.', 'floating-button' );
36 echo '<div class="wowp-notice notice notice-success is-dismissible">' . esc_html( $text ) . '</div>';
37 }
38
39 public function remove_item() {
40 $text = __( 'Item delete.', 'floating-button' );
41 echo '<div class="wowp-notice notice notice-warning is-dismissible">' . esc_html( $text ) . '</div>';
42 }
43
44 }