| @@ 183-194 (lines=12) @@ | ||
| 180 | /** |
|
| 181 | * @param string $key |
|
| 182 | */ |
|
| 183 | public function mark_read( $key ) { |
|
| 184 | if ( ! $key || ! isset( $this->messages[ $key ] ) ) { |
|
| 185 | return; |
|
| 186 | } |
|
| 187 | ||
| 188 | if ( ! isset( $this->messages[ $key ]['read'] ) ) { |
|
| 189 | $this->messages[ $key ]['read'] = array(); |
|
| 190 | } |
|
| 191 | $this->messages[ $key ]['read'][ get_current_user_id() ] = time(); |
|
| 192 | ||
| 193 | $this->update_list(); |
|
| 194 | } |
|
| 195 | ||
| 196 | /** |
|
| 197 | * @param string $key |
|
| @@ 212-228 (lines=17) @@ | ||
| 209 | /** |
|
| 210 | * @param string $key |
|
| 211 | */ |
|
| 212 | public function dismiss( $key ) { |
|
| 213 | if ( $key === 'all' ) { |
|
| 214 | $this->dismiss_all(); |
|
| 215 | return; |
|
| 216 | } |
|
| 217 | ||
| 218 | if ( ! isset( $this->messages[ $key ] ) ) { |
|
| 219 | return; |
|
| 220 | } |
|
| 221 | ||
| 222 | if ( ! isset( $this->messages[ $key ]['dismissed'] ) ) { |
|
| 223 | $this->messages[ $key ]['dismissed'] = array(); |
|
| 224 | } |
|
| 225 | $this->messages[ $key ]['dismissed'][ get_current_user_id() ] = time(); |
|
| 226 | ||
| 227 | $this->update_list(); |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| 231 | * @since 4.06 |
|