@@ -6,13 +6,13 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Prevent direct file access |
| 9 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
| 9 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * Prevent loading the library more than once |
| 13 | 13 | */ |
| 14 | -if( defined( 'WP_ADMIN_NOTIFICATION' ) ) return; |
|
| 15 | -define( 'WP_ADMIN_NOTIFICATION', true ); |
|
| 14 | +if (defined('WP_ADMIN_NOTIFICATION')) return; |
|
| 15 | +define('WP_ADMIN_NOTIFICATION', true); |
|
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Load required classes |
@@ -11,7 +11,9 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Prevent loading the library more than once |
| 13 | 13 | */ |
| 14 | -if( defined( 'WP_ADMIN_NOTIFICATION' ) ) return; |
|
| 14 | +if( defined( 'WP_ADMIN_NOTIFICATION' ) ) { |
|
| 15 | + return; |
|
| 16 | +} |
|
| 15 | 17 | define( 'WP_ADMIN_NOTIFICATION', true ); |
| 16 | 18 | |
| 17 | 19 | /** |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | 13 | // Prevent direct file access |
| 14 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
| 14 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
| 15 | 15 | |
| 16 | -if(!function_exists('_wp_admin_notification_init')) |
|
| 16 | +if (!function_exists('_wp_admin_notification_init')) |
|
| 17 | 17 | { |
| 18 | 18 | /** |
| 19 | 19 | * Initiate admin notifications |
@@ -23,10 +23,10 @@ discard block |
||
| 23 | 23 | $notifier = Amarkal\Admin\Notifications::get_instance(); |
| 24 | 24 | $notifier->init(); |
| 25 | 25 | } |
| 26 | - add_action( 'init', '_wp_admin_notification_init' ); |
|
| 26 | + add_action('init', '_wp_admin_notification_init'); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | -if(!function_exists('wp_admin_notification')) |
|
| 29 | +if (!function_exists('wp_admin_notification')) |
|
| 30 | 30 | { |
| 31 | 31 | /** |
| 32 | 32 | * Register an admin notification. |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param type $class |
| 39 | 39 | * @param type $network |
| 40 | 40 | */ |
| 41 | - function wp_admin_notification( $handle, $html, $type = 'success', $dismissible = false, $class = '', $network = false ) |
|
| 41 | + function wp_admin_notification($handle, $html, $type = 'success', $dismissible = false, $class = '', $network = false) |
|
| 42 | 42 | { |
| 43 | 43 | $notifier = Amarkal\Admin\Notifications::get_instance(); |
| 44 | 44 | $notifier->register_notification($handle, array( |
@@ -51,23 +51,23 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -if(!function_exists('wp_reset_admin_notification')) |
|
| 54 | +if (!function_exists('wp_reset_admin_notification')) |
|
| 55 | 55 | { |
| 56 | 56 | /** |
| 57 | 57 | * Reset a dismissed admin notification. |
| 58 | 58 | * |
| 59 | 59 | * @param string $handle |
| 60 | 60 | */ |
| 61 | - function wp_reset_admin_notification( $handle ) |
|
| 61 | + function wp_reset_admin_notification($handle) |
|
| 62 | 62 | { |
| 63 | - $dismissed = get_site_option( 'wp_dismissed_notices', array() ); |
|
| 63 | + $dismissed = get_site_option('wp_dismissed_notices', array()); |
|
| 64 | 64 | $offset = 0; |
| 65 | - foreach($dismissed as $id) |
|
| 65 | + foreach ($dismissed as $id) |
|
| 66 | 66 | { |
| 67 | - if( $id === $handle ) break; |
|
| 67 | + if ($id === $handle) break; |
|
| 68 | 68 | $offset++; |
| 69 | 69 | } |
| 70 | - array_splice( $dismissed, $offset, 1); |
|
| 71 | - update_site_option( 'wp_dismissed_notices', $dismissed ); |
|
| 70 | + array_splice($dismissed, $offset, 1); |
|
| 71 | + update_site_option('wp_dismissed_notices', $dismissed); |
|
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | \ No newline at end of file |
@@ -64,7 +64,9 @@ |
||
| 64 | 64 | $offset = 0; |
| 65 | 65 | foreach($dismissed as $id) |
| 66 | 66 | { |
| 67 | - if( $id === $handle ) break; |
|
| 67 | + if( $id === $handle ) { |
|
| 68 | + break; |
|
| 69 | + } |
|
| 68 | 70 | $offset++; |
| 69 | 71 | } |
| 70 | 72 | array_splice( $dismissed, $offset, 1); |
@@ -6,12 +6,12 @@ |
||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | // Prevent direct file access |
| 9 | -defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); |
|
| 9 | +defined('ABSPATH') or die('No script kiddies please!'); |
|
| 10 | 10 | |
| 11 | 11 | /** |
| 12 | 12 | * Prevent loading the library more than once |
| 13 | 13 | */ |
| 14 | -if( defined( 'WP_ADMIN_NOTIFICATION' ) ) return; |
|
| 15 | -define( 'WP_ADMIN_NOTIFICATION', true ); |
|
| 14 | +if (defined('WP_ADMIN_NOTIFICATION')) return; |
|
| 15 | +define('WP_ADMIN_NOTIFICATION', true); |
|
| 16 | 16 | |
| 17 | 17 | require_once 'functions.php'; |
@@ -11,7 +11,9 @@ |
||
| 11 | 11 | /** |
| 12 | 12 | * Prevent loading the library more than once |
| 13 | 13 | */ |
| 14 | -if( defined( 'WP_ADMIN_NOTIFICATION' ) ) return; |
|
| 14 | +if( defined( 'WP_ADMIN_NOTIFICATION' ) ) { |
|
| 15 | + return; |
|
| 16 | +} |
|
| 15 | 17 | define( 'WP_ADMIN_NOTIFICATION', true ); |
| 16 | 18 | |
| 17 | 19 | require_once 'functions.php'; |