Completed
Push — master ( ecb930...c8869f )
by Askupa
01:34
created
Notifications.php 1 patch
Braces   +11 added lines, -4 removed lines patch added patch discarded remove patch
@@ -41,8 +41,9 @@  discard block
 block discarded – undo
41 41
         if( !key_exists( $handle, $this->notifications ) )
42 42
         {
43 43
             $this->notifications[$handle] = $options;
44
+        } else {
45
+            trigger_error( "The handle <strong>$handle</strong> has already been registered. Please choose a different handle for your notification." );
44 46
         }
45
-        else trigger_error( "The handle <strong>$handle</strong> has already been registered. Please choose a different handle for your notification." );
46 47
     }
47 48
 
48 49
     public function render_notifications()
@@ -57,7 +58,9 @@  discard block
 block discarded – undo
57 58
     {
58 59
         foreach( $this->notifications as $handle => $notification )
59 60
         {
60
-            if( $notification['network'] ) $this->render_notification( $handle, $notification );
61
+            if( $notification['network'] ) {
62
+                $this->render_notification( $handle, $notification );
63
+            }
61 64
         }
62 65
     }
63 66
 
@@ -74,7 +77,9 @@  discard block
 block discarded – undo
74 77
 
75 78
     public function render_script()
76 79
     {
77
-        if( 0 === count( $this->notifications ) ) return;
80
+        if( 0 === count( $this->notifications ) ) {
81
+            return;
82
+        }
78 83
         ?>
79 84
         <script>
80 85
         jQuery(document).ready(function($){
@@ -91,7 +96,9 @@  discard block
 block discarded – undo
91 96
 
92 97
     private function render_notification( $id, $n )
93 98
     {
94
-        if( in_array( $id, $this->dismissed_notices ) ) return;
99
+        if( in_array( $id, $this->dismissed_notices ) ) {
100
+            return;
101
+        }
95 102
 
96 103
         printf( 
97 104
             '<div id="%s" class="notice notice-%s %s%s"><p>%s</p></div>',
Please login to merge, or discard this patch.
functions.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
 /**
17 17
  * Prevent loading the library more than once
18 18
  */
19
-if( defined( 'AMARKAL_ADMIN_NOTIFICATION' ) ) return false;
19
+if( defined( 'AMARKAL_ADMIN_NOTIFICATION' ) ) {
20
+    return false;
21
+}
20 22
 define( 'AMARKAL_ADMIN_NOTIFICATION', true );
21 23
 
22 24
 if(!function_exists('_amarkal_admin_notification_init'))
@@ -70,7 +72,9 @@  discard block
 block discarded – undo
70 72
         $offset = 0;
71 73
         foreach($dismissed as $id)
72 74
         {
73
-            if( $id === $handle ) break;
75
+            if( $id === $handle ) {
76
+                break;
77
+            }
74 78
             $offset++;
75 79
         }
76 80
         array_splice( $dismissed, $offset, 1);
Please login to merge, or discard this patch.