@@ -113,8 +113,8 @@ |
||
113 | 113 | $label = ( 'category' === $term->taxonomy || 'tag' === $term->taxonomy ) ? $term->taxonomy : 'term'; |
114 | 114 | ?> |
115 | 115 | <term><term_id><?php echo esc_html( $term->term_id ); ?></term_id><term_taxonomy><?php echo esc_html( $term->taxonomy ); ?></term_taxonomy><?php |
116 | - if ( ! empty( $parent_slugs[ $term->parent ] ) ) { |
|
117 | - echo '<term_parent>' . esc_html( $parent_slugs[ $term->parent ] ) . '</term_parent>'; |
|
116 | + if ( ! empty( $parent_slugs[$term->parent] ) ) { |
|
117 | + echo '<term_parent>' . esc_html( $parent_slugs[$term->parent] ) . '</term_parent>'; |
|
118 | 118 | } |
119 | 119 | if ( ! empty( $term->name ) ) { |
120 | 120 | echo '<term_name>' . FrmXMLHelper::cdata( $term->name ) . '</term_name>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
306 | 306 | } |
307 | 307 | $plugins = get_plugins(); |
308 | - if ( isset( $plugins[ $plugin ] ) && ! empty( $plugins[ $plugin ]['Version'] ) ) { |
|
309 | - return $plugins[ $plugin ]['Version']; |
|
308 | + if ( isset( $plugins[$plugin] ) && ! empty( $plugins[$plugin]['Version'] ) ) { |
|
309 | + return $plugins[$plugin]['Version']; |
|
310 | 310 | } |
311 | 311 | return false; |
312 | 312 | } |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
378 | 378 | |
379 | 379 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
380 | - $new_values[ $col ] = $values[ $col ]; |
|
380 | + $new_values[$col] = $values[$col]; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | $new_values['options'] = self::maybe_filter_options( $values['options'] ); |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
389 | 389 | |
390 | 390 | if ( isset( $values['id'] ) ) { |
391 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
391 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
392 | 392 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
393 | 393 | } |
394 | 394 | |
@@ -397,9 +397,9 @@ discard block |
||
397 | 397 | foreach ( $new_values as $k => $v ) { |
398 | 398 | if ( is_array( $v ) ) { |
399 | 399 | if ( $k === 'default_value' ) { |
400 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
400 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
401 | 401 | } else { |
402 | - $new_values[ $k ] = serialize( $v ); |
|
402 | + $new_values[$k] = serialize( $v ); |
|
403 | 403 | } |
404 | 404 | } |
405 | 405 | unset( $k, $v ); |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | } |
420 | 420 | |
421 | 421 | if ( isset( $values['id'] ) ) { |
422 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
422 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | return $new_id; |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
480 | 480 | global $frm_duplicate_ids; |
481 | 481 | |
482 | - $where = array( |
|
482 | + $where = array( |
|
483 | 483 | array( |
484 | 484 | 'or' => 1, |
485 | 485 | 'fi.form_id' => $old_form_id, |
@@ -525,8 +525,8 @@ discard block |
||
525 | 525 | |
526 | 526 | $values = apply_filters( 'frm_duplicated_field', $values ); |
527 | 527 | $new_id = self::create( $values ); |
528 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
529 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
528 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
529 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
530 | 530 | unset( $field ); |
531 | 531 | }//end foreach |
532 | 532 | } |
@@ -564,11 +564,11 @@ discard block |
||
564 | 564 | |
565 | 565 | // serialize array values |
566 | 566 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
567 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
567 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
568 | 568 | if ( 'field_options' === $opt ) { |
569 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
569 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
570 | 570 | } |
571 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
571 | + $values[$opt] = serialize( $values[$opt] ); |
|
572 | 572 | } |
573 | 573 | } |
574 | 574 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | 'id' => $id, |
721 | 721 | 'field_key' => $id, |
722 | 722 | ); |
723 | - $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
723 | + $type = FrmDb::get_var( 'frm_fields', $where, $col ); |
|
724 | 724 | } |
725 | 725 | |
726 | 726 | return $type; |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | continue; |
747 | 747 | } |
748 | 748 | |
749 | - $fields[ $result->id ] = $result; |
|
749 | + $fields[$result->id] = $result; |
|
750 | 750 | $count ++; |
751 | 751 | if ( $limit == 1 ) { |
752 | 752 | $fields = $result; |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | $count = 0; |
793 | 793 | foreach ( $results as $result ) { |
794 | 794 | $count ++; |
795 | - $fields[ $result->id ] = $result; |
|
795 | + $fields[$result->id] = $result; |
|
796 | 796 | if ( ! empty( $limit ) && $count >= $limit ) { |
797 | 797 | break; |
798 | 798 | } |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | } |
862 | 862 | |
863 | 863 | if ( ! empty( $sub_fields ) ) { |
864 | - $index = $k + $index_offset; |
|
864 | + $index = $k + $index_offset; |
|
865 | 865 | $index_offset += count( $sub_fields ); |
866 | 866 | array_splice( $results, $index, 0, $sub_fields ); |
867 | 867 | } |
@@ -906,7 +906,7 @@ discard block |
||
906 | 906 | $query_type = ( $limit == ' LIMIT 1' || $limit == 1 ) ? 'row' : 'results'; |
907 | 907 | |
908 | 908 | if ( is_array( $where ) ) { |
909 | - $args = array( |
|
909 | + $args = array( |
|
910 | 910 | 'order_by' => $order_by, |
911 | 911 | 'limit' => $limit, |
912 | 912 | ); |
@@ -937,9 +937,9 @@ discard block |
||
937 | 937 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
938 | 938 | |
939 | 939 | self::prepare_options( $result ); |
940 | - $results[ $r_key ]->field_options = $result->field_options; |
|
941 | - $results[ $r_key ]->options = $result->options; |
|
942 | - $results[ $r_key ]->default_value = $result->default_value; |
|
940 | + $results[$r_key]->field_options = $result->field_options; |
|
941 | + $results[$r_key]->options = $result->options; |
|
942 | + $results[$r_key]->default_value = $result->default_value; |
|
943 | 943 | |
944 | 944 | unset( $r_key, $result ); |
945 | 945 | } |
@@ -1142,23 +1142,23 @@ discard block |
||
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | public static function is_option_true_in_array( $field, $option ) { |
1145 | - return isset( $field[ $option ] ) && $field[ $option ]; |
|
1145 | + return isset( $field[$option] ) && $field[$option]; |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | public static function is_option_true_in_object( $field, $option ) { |
1149 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
1149 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
1150 | 1150 | } |
1151 | 1151 | |
1152 | 1152 | public static function is_option_empty_in_array( $field, $option ) { |
1153 | - return ! isset( $field[ $option ] ) || empty( $field[ $option ] ); |
|
1153 | + return ! isset( $field[$option] ) || empty( $field[$option] ); |
|
1154 | 1154 | } |
1155 | 1155 | |
1156 | 1156 | public static function is_option_empty_in_object( $field, $option ) { |
1157 | - return ! isset( $field->field_options[ $option ] ) || empty( $field->field_options[ $option ] ); |
|
1157 | + return ! isset( $field->field_options[$option] ) || empty( $field->field_options[$option] ); |
|
1158 | 1158 | } |
1159 | 1159 | |
1160 | 1160 | public static function is_option_value_in_object( $field, $option ) { |
1161 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
1161 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
1162 | 1162 | } |
1163 | 1163 | |
1164 | 1164 | /** |
@@ -1176,10 +1176,10 @@ discard block |
||
1176 | 1176 | |
1177 | 1177 | public static function get_option_in_array( $field, $option ) { |
1178 | 1178 | |
1179 | - if ( isset( $field[ $option ] ) ) { |
|
1180 | - $this_option = $field[ $option ]; |
|
1181 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
1182 | - $this_option = $field['field_options'][ $option ]; |
|
1179 | + if ( isset( $field[$option] ) ) { |
|
1180 | + $this_option = $field[$option]; |
|
1181 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
1182 | + $this_option = $field['field_options'][$option]; |
|
1183 | 1183 | } else { |
1184 | 1184 | $this_option = ''; |
1185 | 1185 | } |
@@ -1188,7 +1188,7 @@ discard block |
||
1188 | 1188 | } |
1189 | 1189 | |
1190 | 1190 | public static function get_option_in_object( $field, $option ) { |
1191 | - return isset( $field->field_options[ $option ] ) ? $field->field_options[ $option ] : ''; |
|
1191 | + return isset( $field->field_options[$option] ) ? $field->field_options[$option] : ''; |
|
1192 | 1192 | } |
1193 | 1193 | |
1194 | 1194 | /** |
@@ -33,10 +33,10 @@ |
||
33 | 33 | 'turnstile' => 'FrmTurnstileSettings', |
34 | 34 | ); |
35 | 35 | |
36 | - if ( ! isset( $settings_classes[ $active_captcha ] ) ) { |
|
36 | + if ( ! isset( $settings_classes[$active_captcha] ) ) { |
|
37 | 37 | $active_captcha = 'recaptcha'; |
38 | 38 | } |
39 | 39 | |
40 | - return $settings_classes[ $active_captcha ]; |
|
40 | + return $settings_classes[$active_captcha]; |
|
41 | 41 | } |
42 | 42 | } |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | |
256 | 256 | if ( is_wp_error( $resp ) ) { |
257 | 257 | $error_string = $resp->get_error_message(); |
258 | - $errors[ 'field' . $args['id'] ] = __( 'There was a problem verifying your captcha', 'formidable' ); |
|
259 | - $errors[ 'field' . $args['id'] ] .= ' ' . $error_string; |
|
258 | + $errors['field' . $args['id']] = __( 'There was a problem verifying your captcha', 'formidable' ); |
|
259 | + $errors['field' . $args['id']] .= ' ' . $error_string; |
|
260 | 260 | return $errors; |
261 | 261 | } |
262 | 262 | |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | if ( $invalid_message === __( 'The reCAPTCHA was not entered correctly', 'formidable' ) ) { |
284 | 284 | $invalid_message = ''; |
285 | 285 | } |
286 | - $errors[ 'field' . $args['id'] ] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message ); |
|
286 | + $errors['field' . $args['id']] = ( $invalid_message === '' ? $frm_settings->re_msg : $invalid_message ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | return $errors; |
@@ -299,8 +299,8 @@ discard block |
||
299 | 299 | $frm_vars['captcha_scores'] = array(); |
300 | 300 | } |
301 | 301 | $form_id = is_object( $this->field ) ? $this->field->form_id : $this->field['form_id']; |
302 | - if ( ! isset( $frm_vars['captcha_scores'][ $form_id ] ) ) { |
|
303 | - $frm_vars['captcha_scores'][ $form_id ] = $score; |
|
302 | + if ( ! isset( $frm_vars['captcha_scores'][$form_id] ) ) { |
|
303 | + $frm_vars['captcha_scores'][$form_id] = $score; |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | protected static function post_data_includes_token() { |
330 | 330 | $settings = FrmCaptchaFactory::get_settings_object(); |
331 | 331 | // phpcs:ignore WordPress.Security.NonceVerification.Missing |
332 | - return ! empty( $_POST[ $settings->token_field ] ); |
|
332 | + return ! empty( $_POST[$settings->token_field] ); |
|
333 | 333 | } |
334 | 334 | |
335 | 335 | /** |
@@ -216,16 +216,16 @@ |
||
216 | 216 | namespace WPMailSMTP { |
217 | 217 | class Options { |
218 | 218 | /** |
219 | - * @return Options |
|
220 | - */ |
|
219 | + * @return Options |
|
220 | + */ |
|
221 | 221 | public static function init() { |
222 | 222 | } |
223 | 223 | /** |
224 | - * @param string $group |
|
225 | - * @param string $key |
|
226 | - * @param bool $strip_slashes |
|
227 | - * @return mixed|null |
|
228 | - */ |
|
224 | + * @param string $group |
|
225 | + * @param string $key |
|
226 | + * @param bool $strip_slashes |
|
227 | + * @return mixed|null |
|
228 | + */ |
|
229 | 229 | public function get( $group, $key, $strip_slashes = true ) { |
230 | 230 | } |
231 | 231 | } |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | foreach ( $data as $key => $messages ) { |
479 | 479 | if ( in_array( $key, array( 'unread', 'dismissed' ), true ) ) { |
480 | 480 | foreach ( $messages as $key_msg => $message ) { |
481 | - $data[ $key ][ $key_msg ]['cta'] = self::inbox_clean_messages_cta( $message['cta'] ); |
|
481 | + $data[$key][$key_msg]['cta'] = self::inbox_clean_messages_cta( $message['cta'] ); |
|
482 | 482 | } |
483 | 483 | } |
484 | 484 | } |
@@ -557,11 +557,11 @@ discard block |
||
557 | 557 | */ |
558 | 558 | private static function get_dashboard_options( $option_name = null ) { |
559 | 559 | $options = get_option( self::OPTION_META_NAME, array() ); |
560 | - if ( null !== $option_name && ! isset( $options[ $option_name ] ) ) { |
|
560 | + if ( null !== $option_name && ! isset( $options[$option_name] ) ) { |
|
561 | 561 | return array(); |
562 | 562 | } |
563 | 563 | if ( null !== $option_name ) { |
564 | - return $options[ $option_name ]; |
|
564 | + return $options[$option_name]; |
|
565 | 565 | } |
566 | 566 | return $options; |
567 | 567 | } |
@@ -576,7 +576,7 @@ discard block |
||
576 | 576 | */ |
577 | 577 | private static function update_dashboard_options( $data, $option_name ) { |
578 | 578 | $options = self::get_dashboard_options(); |
579 | - $options[ $option_name ] = $data; |
|
579 | + $options[$option_name] = $data; |
|
580 | 580 | update_option( self::OPTION_META_NAME, $options, 'no' ); |
581 | 581 | } |
582 | 582 |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | return; |
106 | 106 | } |
107 | 107 | |
108 | - if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) { |
|
108 | + if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) { |
|
109 | 109 | // Don't replace messages unless required. |
110 | 110 | return; |
111 | 111 | } |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | return; |
115 | 115 | } |
116 | 116 | |
117 | - if ( isset( self::$messages[ $message['key'] ] ) ) { |
|
117 | + if ( isset( self::$messages[$message['key']] ) ) { |
|
118 | 118 | // Move up and mark as new. |
119 | - unset( self::$messages[ $message['key'] ] ); |
|
119 | + unset( self::$messages[$message['key']] ); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | $this->fill_message( $message ); |
123 | - self::$messages[ $message['key'] ] = $message; |
|
123 | + self::$messages[$message['key']] = $message; |
|
124 | 124 | |
125 | 125 | $this->update_list(); |
126 | 126 | |
@@ -157,11 +157,11 @@ discard block |
||
157 | 157 | private function clean_messages() { |
158 | 158 | $removed = false; |
159 | 159 | foreach ( self::$messages as $t => $message ) { |
160 | - $read = ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' ); |
|
161 | - $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); |
|
160 | + $read = ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' ); |
|
161 | + $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' ); |
|
162 | 162 | $expired = $this->is_expired( $message ); |
163 | 163 | if ( $read || $expired || $dismissed ) { |
164 | - unset( self::$messages[ $t ] ); |
|
164 | + unset( self::$messages[$t] ); |
|
165 | 165 | $removed = true; |
166 | 166 | } |
167 | 167 | } |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | public function filter_messages( &$messages, $type = 'unread' ) { |
180 | 180 | $user_id = get_current_user_id(); |
181 | 181 | foreach ( $messages as $k => $message ) { |
182 | - $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] ); |
|
182 | + $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] ); |
|
183 | 183 | if ( empty( $k ) || $this->is_expired( $message ) || ( $type === 'dismissed' ) !== $dismissed ) { |
184 | - unset( $messages[ $k ] ); |
|
184 | + unset( $messages[$k] ); |
|
185 | 185 | } elseif ( ! $this->is_for_user( $message ) ) { |
186 | - unset( $messages[ $k ] ); |
|
186 | + unset( $messages[$k] ); |
|
187 | 187 | } |
188 | 188 | } |
189 | 189 | $messages = apply_filters( 'frm_filter_inbox', $messages ); |
@@ -241,14 +241,14 @@ discard block |
||
241 | 241 | * @return void |
242 | 242 | */ |
243 | 243 | public function mark_read( $key ) { |
244 | - if ( ! $key || ! isset( self::$messages[ $key ] ) ) { |
|
244 | + if ( ! $key || ! isset( self::$messages[$key] ) ) { |
|
245 | 245 | return; |
246 | 246 | } |
247 | 247 | |
248 | - if ( ! isset( self::$messages[ $key ]['read'] ) ) { |
|
249 | - self::$messages[ $key ]['read'] = array(); |
|
248 | + if ( ! isset( self::$messages[$key]['read'] ) ) { |
|
249 | + self::$messages[$key]['read'] = array(); |
|
250 | 250 | } |
251 | - self::$messages[ $key ]['read'][ get_current_user_id() ] = time(); |
|
251 | + self::$messages[$key]['read'][get_current_user_id()] = time(); |
|
252 | 252 | |
253 | 253 | $this->update_list(); |
254 | 254 | } |
@@ -260,9 +260,9 @@ discard block |
||
260 | 260 | * @return void |
261 | 261 | */ |
262 | 262 | public function mark_unread( $key ) { |
263 | - $is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
263 | + $is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
264 | 264 | if ( $is_read ) { |
265 | - unset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
265 | + unset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
266 | 266 | $this->update_list(); |
267 | 267 | } |
268 | 268 | } |
@@ -278,14 +278,14 @@ discard block |
||
278 | 278 | return; |
279 | 279 | } |
280 | 280 | |
281 | - if ( ! isset( self::$messages[ $key ] ) ) { |
|
281 | + if ( ! isset( self::$messages[$key] ) ) { |
|
282 | 282 | return; |
283 | 283 | } |
284 | 284 | |
285 | - if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) { |
|
286 | - self::$messages[ $key ]['dismissed'] = array(); |
|
285 | + if ( ! isset( self::$messages[$key]['dismissed'] ) ) { |
|
286 | + self::$messages[$key]['dismissed'] = array(); |
|
287 | 287 | } |
288 | - self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time(); |
|
288 | + self::$messages[$key]['dismissed'][get_current_user_id()] = time(); |
|
289 | 289 | |
290 | 290 | $this->update_list(); |
291 | 291 | } |
@@ -299,11 +299,11 @@ discard block |
||
299 | 299 | $user_id = get_current_user_id(); |
300 | 300 | foreach ( self::$messages as $key => $message ) { |
301 | 301 | if ( ! isset( $message['dismissed'] ) ) { |
302 | - self::$messages[ $key ]['dismissed'] = array(); |
|
302 | + self::$messages[$key]['dismissed'] = array(); |
|
303 | 303 | } |
304 | 304 | |
305 | - if ( ! isset( $message['dismissed'][ $user_id ] ) ) { |
|
306 | - self::$messages[ $key ]['dismissed'][ $user_id ] = time(); |
|
305 | + if ( ! isset( $message['dismissed'][$user_id] ) ) { |
|
306 | + self::$messages[$key]['dismissed'][$user_id] = time(); |
|
307 | 307 | } |
308 | 308 | } |
309 | 309 | $this->update_list(); |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | $messages = $this->get_messages( 'filter' ); |
314 | 314 | $user_id = get_current_user_id(); |
315 | 315 | foreach ( $messages as $t => $message ) { |
316 | - if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) { |
|
317 | - unset( $messages[ $t ] ); |
|
316 | + if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) { |
|
317 | + unset( $messages[$t] ); |
|
318 | 318 | } |
319 | 319 | } |
320 | 320 | return $messages; |
@@ -341,8 +341,8 @@ discard block |
||
341 | 341 | * @return void |
342 | 342 | */ |
343 | 343 | public function remove( $key ) { |
344 | - if ( isset( self::$messages[ $key ] ) ) { |
|
345 | - unset( self::$messages[ $key ] ); |
|
344 | + if ( isset( self::$messages[$key] ) ) { |
|
345 | + unset( self::$messages[$key] ); |
|
346 | 346 | $this->update_list(); |
347 | 347 | } |
348 | 348 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | * @param array $matches The regex results for a single match. |
389 | 389 | * @return string |
390 | 390 | */ |
391 | - function ( $matches ) { |
|
391 | + function( $matches ) { |
|
392 | 392 | $url = $matches[2]; |
393 | 393 | $parts = parse_url( $url ); |
394 | 394 | |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | return array_filter( |
453 | 453 | $inbox->get_messages( 'filter' ), |
454 | 454 | function( $message ) use ( $key ) { |
455 | - return ! empty( $message[ $key ] ); |
|
455 | + return ! empty( $message[$key] ); |
|
456 | 456 | } |
457 | 457 | ); |
458 | 458 | } |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | return array_reduce( |
500 | 500 | $keys_to_return, |
501 | 501 | function( $total, $key ) use ( $message ) { |
502 | - $total[ $key ] = $message[ $key ]; |
|
502 | + $total[$key] = $message[$key]; |
|
503 | 503 | return $total; |
504 | 504 | }, |
505 | 505 | array() |