| @@ -11,20 +11,8 @@ | ||
| 11 | 11 | * @since 2.3.9 |
| 12 | 12 | * @since 2.7 Dismissed notices are stored in an option instead of a user meta |
| 13 | 13 | */ |
| 14 | 14 | class PLL_Admin_Notices { |
| 15 | - /** | |
| 16 | - * Stores the plugin options. | |
| 17 | - * | |
| 18 | - * @var array | |
| 19 | - */ | |
| 20 | - protected $options; | |
| 21 | - | |
| 22 | - /** | |
| 23 | - * Stores custom notices. | |
| 24 | - * | |
| 25 | - * @var string[] | |
| 26 | - */ | |
| 27 | 15 | private static $notices = array(); |
| 28 | 16 | |
| 29 | 17 | /** |
| 30 | 18 | * Constructor |
| @@ -47,9 +35,8 @@ | ||
| 47 | 35 | * @since 2.3.9 |
| 48 | 36 | * |
| 49 | 37 | * @param string $name Notice name |
| 50 | 38 | * @param string $html Content of the notice |
| 51 | - * @return void | |
| 52 | 39 | */ |
| 53 | 40 | public static function add_notice( $name, $html ) { |
| 54 | 41 | self::$notices[ $name ] = $html; |
| 55 | 42 | } |
| @@ -54,13 +41,13 @@ | ||
| 54 | 41 | self::$notices[ $name ] = $html; |
| 55 | 42 | } |
| 56 | 43 | |
| 57 | 44 | /** |
| 58 | - * Get custom notices. | |
| 45 | + * Get custom notices | |
| 59 | 46 | * |
| 60 | 47 | * @since 2.3.9 |
| 61 | 48 | * |
| 62 | - * @return string[] | |
| 49 | + * @return array | |
| 63 | 50 | */ |
| 64 | 51 | public static function get_notices() { |
| 65 | 52 | return self::$notices; |
| 66 | 53 | } |
| @@ -101,13 +88,8 @@ | ||
| 101 | 88 | * @return bool |
| 102 | 89 | */ |
| 103 | 90 | protected function can_display_notice( $notice ) { |
| 104 | 91 | $screen = get_current_screen(); |
| 105 | - | |
| 106 | - if ( empty( $screen ) ) { | |
| 107 | - return false; | |
| 108 | - } | |
| 109 | - | |
| 110 | 92 | $screen_id = sanitize_title( __( 'Languages', 'polylang' ) ); |
| 111 | 93 | |
| 112 | 94 | /** |
| 113 | 95 | * Filter admin notices which can be displayed |
| @@ -138,9 +120,8 @@ | ||
| 138 | 120 | * |
| 139 | 121 | * @since 2.3.9 |
| 140 | 122 | * |
| 141 | 123 | * @param string $notice |
| 142 | - * @return void | |
| 143 | 124 | */ |
| 144 | 125 | public static function dismiss( $notice ) { |
| 145 | 126 | $dismissed = get_option( 'pll_dismissed_notices', array() ); |
| 146 | 127 | |
| @@ -153,10 +134,8 @@ | ||
| 153 | 134 | /** |
| 154 | 135 | * Handle a click on the dismiss button |
| 155 | 136 | * |
| 156 | 137 | * @since 2.3.9 |
| 157 | - * | |
| 158 | - * @return void | |
| 159 | 138 | */ |
| 160 | 139 | public function hide_notice() { |
| 161 | 140 | if ( isset( $_GET['pll-hide-notice'], $_GET['_pll_notice_nonce'] ) ) { |
| 162 | 141 | $notice = sanitize_key( $_GET['pll-hide-notice'] ); |
| @@ -170,10 +149,8 @@ | ||
| 170 | 149 | /** |
| 171 | 150 | * Displays notices |
| 172 | 151 | * |
| 173 | 152 | * @since 2.3.9 |
| 174 | - * | |
| 175 | - * @return void | |
| 176 | 153 | */ |
| 177 | 154 | public function display_notices() { |
| 178 | 155 | if ( current_user_can( 'manage_options' ) ) { |
| 179 | 156 | // Core notices |
| @@ -206,9 +183,8 @@ | ||
| 206 | 183 | * |
| 207 | 184 | * @since 2.3.9 |
| 208 | 185 | * |
| 209 | 186 | * @param string $name Notice name |
| 210 | - * @return void | |
| 211 | 187 | */ |
| 212 | 188 | public function dismiss_button( $name ) { |
| 213 | 189 | printf( |
| 214 | 190 | '<a class="notice-dismiss" href="%s"><span class="screen-reader-text">%s</span></a>', |
| @@ -221,10 +197,8 @@ | ||
| 221 | 197 | /** |
| 222 | 198 | * Displays a notice if WooCommerce is activated without Polylang for WooCommerce |
| 223 | 199 | * |
| 224 | 200 | * @since 2.3.9 |
| 225 | - * | |
| 226 | - * @return void | |
| 227 | 201 | */ |
| 228 | 202 | private function pllwc_notice() { |
| 229 | 203 | ?> |
| 230 | 204 | <div class="pll-notice notice notice-warning"> |
| @@ -246,10 +220,8 @@ | ||
| 246 | 220 | /** |
| 247 | 221 | * Displays a notice asking for a review |
| 248 | 222 | * |
| 249 | 223 | * @since 2.3.9 |
| 250 | - * | |
| 251 | - * @return void | |
| 252 | 224 | */ |
| 253 | 225 | private function review_notice() { |
| 254 | 226 | ?> |
| 255 | 227 | <div class="pll-notice notice notice-info"> |