| @@ -166,26 +166,12 @@ | ||
| 166 | 166 | $this->print_notices_for_dev_mode(); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | public function eligible_notices( $notices = [], $queue = [] ) { |
| 170 | - $_sorted_queue = []; | |
| 171 | 170 | $notices = empty( $notices ) ? $this->notices : $notices; |
| 172 | 171 | $queue = empty( $queue ) ? $this->queue : $queue; |
| 173 | 172 | |
| 174 | - if ( ! empty ( $queue ) ) { | |
| 175 | - array_walk( $queue, function ( $value, $key ) use ( &$_sorted_queue, $notices ) { | |
| 176 | - $notice = isset( $notices[ $key ] ) ? $notices[ $key ] : null; | |
| 177 | - if ( ! is_null( $notice ) ) { | |
| 178 | - if ( ! $notice->dismiss->is_dismissed() && ! $notice->is_expired() ) { | |
| 179 | - $_sorted_queue[ $notice->options( 'start' ) ] = $key; | |
| 180 | - } | |
| 181 | - } | |
| 182 | - } ); | |
| 183 | - } | |
| 184 | - | |
| 185 | - ksort( $_sorted_queue ); | |
| 186 | - | |
| 187 | - return $_sorted_queue; | |
| 173 | + return $this->get_sorted_queue( $notices, $queue ); | |
| 188 | 174 | } |
| 189 | 175 | |
| 190 | 176 | public function scripts() { |
| 191 | 177 | if ( ! $this->dev_mode ) { |
| @@ -230,5 +216,5 @@ | ||
| 230 | 216 | } |
| 231 | 217 | } |
| 232 | 218 | } |
| 233 | 219 | } |
| 234 | -} | |
| 220 | +} | |