@@ -109,7 +109,7 @@ |
||
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | |
112 | - $descriptions[] = sprintf( $string, $entity->get_title() ); |
|
112 | + $descriptions[ ] = sprintf( $string, $entity->get_title() ); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | return $descriptions; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | ); |
62 | 62 | |
63 | 63 | if ( ! empty( $points_type_name ) ) { |
64 | - $this->column_headings['points'] = $points_type_name; |
|
64 | + $this->column_headings[ 'points' ] = $points_type_name; |
|
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | |
70 | 70 | foreach ( array( 'searchable', 'paginate' ) as $arg ) { |
71 | 71 | if ( $this->args[ $arg ] ) { |
72 | - $extra_classes[] = $arg; |
|
72 | + $extra_classes[ ] = $arg; |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | |
@@ -92,19 +92,19 @@ discard block |
||
92 | 92 | ?> |
93 | 93 | |
94 | 94 | <div class="wordpoints-points-logs-wrapper"> |
95 | - <?php if ( $this->args['searchable'] ) : ?> |
|
95 | + <?php if ( $this->args[ 'searchable' ] ) : ?> |
|
96 | 96 | <?php $this->search_box(); ?> |
97 | 97 | <?php endif; ?> |
98 | 98 | |
99 | 99 | <table class="wordpoints-points-logs widefat <?php echo esc_attr( implode( ' ', $extra_classes ) ); ?>"> |
100 | 100 | <thead> |
101 | 101 | <tr> |
102 | - <?php if ( $this->args['show_users'] ) : ?> |
|
103 | - <th scope="col"><?php echo esc_html( $this->column_headings['user'] ); ?></th> |
|
102 | + <?php if ( $this->args[ 'show_users' ] ) : ?> |
|
103 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'user' ] ); ?></th> |
|
104 | 104 | <?php endif; ?> |
105 | - <th scope="col"><?php echo esc_html( $this->column_headings['points'] ); ?></th> |
|
106 | - <th scope="col"><?php echo esc_html( $this->column_headings['description'] ); ?></th> |
|
107 | - <th scope="col"><?php echo esc_html( $this->column_headings['time'] ); ?></th> |
|
105 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'points' ] ); ?></th> |
|
106 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'description' ] ); ?></th> |
|
107 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'time' ] ); ?></th> |
|
108 | 108 | </tr> |
109 | 109 | </thead> |
110 | 110 | <tbody> |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | |
119 | 119 | ?> |
120 | 120 | <tr> |
121 | - <td colspan="<?php echo ( $this->args['show_users'] ) ? 4 : 3; ?>"> |
|
121 | + <td colspan="<?php echo ( $this->args[ 'show_users' ] ) ? 4 : 3; ?>"> |
|
122 | 122 | <?php esc_html_e( 'No matching logs found.', 'wordpoints' ); ?> |
123 | 123 | </td> |
124 | 124 | </tr> |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ?> |
136 | 136 | |
137 | 137 | <tr class="wordpoints-log-id-<?php echo (int) $log->id; ?> <?php echo ( $this->i % 2 ) ? 'odd' : 'even'; ?>"> |
138 | - <?php if ( $this->args['show_users'] ) : ?> |
|
138 | + <?php if ( $this->args[ 'show_users' ] ) : ?> |
|
139 | 139 | <td> |
140 | 140 | <?php echo get_avatar( $user->ID, 32 ); ?> |
141 | 141 | <?php |
@@ -197,17 +197,17 @@ discard block |
||
197 | 197 | </tbody> |
198 | 198 | <tfoot> |
199 | 199 | <tr> |
200 | - <?php if ( $this->args['show_users'] ) : ?> |
|
201 | - <th scope="col"><?php echo esc_html( $this->column_headings['user'] ); ?></th> |
|
200 | + <?php if ( $this->args[ 'show_users' ] ) : ?> |
|
201 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'user' ] ); ?></th> |
|
202 | 202 | <?php endif; ?> |
203 | - <th scope="col"><?php echo esc_html( $this->column_headings['points'] ); ?></th> |
|
204 | - <th scope="col"><?php echo esc_html( $this->column_headings['description'] ); ?></th> |
|
205 | - <th scope="col"><?php echo esc_html( $this->column_headings['time'] ); ?></th> |
|
203 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'points' ] ); ?></th> |
|
204 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'description' ] ); ?></th> |
|
205 | + <th scope="col"><?php echo esc_html( $this->column_headings[ 'time' ] ); ?></th> |
|
206 | 206 | </tr> |
207 | 207 | </tfoot> |
208 | 208 | </table> |
209 | 209 | |
210 | - <?php if ( $this->args['paginate'] ) : ?> |
|
210 | + <?php if ( $this->args[ 'paginate' ] ) : ?> |
|
211 | 211 | <?php $this->pagination(); ?> |
212 | 212 | <?php endif; ?> |
213 | 213 | </div> |
@@ -222,10 +222,10 @@ discard block |
||
222 | 222 | |
223 | 223 | $search_term = ''; |
224 | 224 | |
225 | - if ( isset( $_POST['wordpoints_points_logs_search'] ) ) { // WPCS: CSRF OK |
|
225 | + if ( isset( $_POST[ 'wordpoints_points_logs_search' ] ) ) { // WPCS: CSRF OK |
|
226 | 226 | $search_term = trim( |
227 | 227 | sanitize_text_field( |
228 | - wp_unslash( $_POST['wordpoints_points_logs_search'] ) // WPCS: CSRF OK |
|
228 | + wp_unslash( $_POST[ 'wordpoints_points_logs_search' ] ) // WPCS: CSRF OK |
|
229 | 229 | ) |
230 | 230 | ); |
231 | 231 | |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | $page = 1; |
244 | 244 | |
245 | 245 | if ( |
246 | - isset( $_GET['wordpoints_points_logs_page'] ) // WPCS: CSRF OK. |
|
247 | - && wordpoints_posint( $_GET['wordpoints_points_logs_page'] ) // WPCS: CSRF OK. |
|
246 | + isset( $_GET[ 'wordpoints_points_logs_page' ] ) // WPCS: CSRF OK. |
|
247 | + && wordpoints_posint( $_GET[ 'wordpoints_points_logs_page' ] ) // WPCS: CSRF OK. |
|
248 | 248 | ) { |
249 | - $page = (int) $_GET['wordpoints_points_logs_page']; |
|
249 | + $page = (int) $_GET[ 'wordpoints_points_logs_page' ]; |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | return $page; |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | $per_page = 25; |
261 | 261 | |
262 | 262 | if ( |
263 | - isset( $_GET['wordpoints_points_logs_per_page'] ) // WPCS: CSRF OK. |
|
264 | - && wordpoints_posint( $_GET['wordpoints_points_logs_per_page'] ) // WPCS: CSRF OK. |
|
263 | + isset( $_GET[ 'wordpoints_points_logs_per_page' ] ) // WPCS: CSRF OK. |
|
264 | + && wordpoints_posint( $_GET[ 'wordpoints_points_logs_per_page' ] ) // WPCS: CSRF OK. |
|
265 | 265 | ) { |
266 | - $per_page = (int) $_GET['wordpoints_points_logs_per_page']; |
|
266 | + $per_page = (int) $_GET[ 'wordpoints_points_logs_per_page' ]; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | return $per_page; |
@@ -222,7 +222,8 @@ |
||
222 | 222 | |
223 | 223 | $search_term = ''; |
224 | 224 | |
225 | - if ( isset( $_POST['wordpoints_points_logs_search'] ) ) { // WPCS: CSRF OK |
|
225 | + if ( isset( $_POST['wordpoints_points_logs_search'] ) ) { |
|
226 | +// WPCS: CSRF OK |
|
226 | 227 | $search_term = trim( |
227 | 228 | sanitize_text_field( |
228 | 229 | wp_unslash( $_POST['wordpoints_points_logs_search'] ) // WPCS: CSRF OK |
@@ -102,7 +102,7 @@ |
||
102 | 102 | ); |
103 | 103 | |
104 | 104 | self::$queries[ $slug ] = array_merge( $defaults, $data ); |
105 | - self::$queries[ $slug ]['args'] = $args; |
|
105 | + self::$queries[ $slug ][ 'args' ] = $args; |
|
106 | 106 | |
107 | 107 | return true; |
108 | 108 | } |
@@ -27,17 +27,17 @@ discard block |
||
27 | 27 | array $settings |
28 | 28 | ) { |
29 | 29 | |
30 | - if ( isset( $settings['legacy_log_type'] ) ) { |
|
30 | + if ( isset( $settings[ 'legacy_log_type' ] ) ) { |
|
31 | 31 | $reaction->update_meta( |
32 | 32 | 'legacy_log_type', |
33 | - $settings['legacy_log_type'] |
|
33 | + $settings[ 'legacy_log_type' ] |
|
34 | 34 | ); |
35 | 35 | } |
36 | 36 | |
37 | - if ( isset( $settings['legacy_meta_key'] ) ) { |
|
37 | + if ( isset( $settings[ 'legacy_meta_key' ] ) ) { |
|
38 | 38 | $reaction->update_meta( |
39 | 39 | 'legacy_meta_key', |
40 | - $settings['legacy_meta_key'] |
|
40 | + $settings[ 'legacy_meta_key' ] |
|
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | $data = parent::get_ui_script_data(); |
53 | 53 | |
54 | - $data['reversals_extension_slug'] = 'points_legacy_reversals'; |
|
54 | + $data[ 'reversals_extension_slug' ] = 'points_legacy_reversals'; |
|
55 | 55 | |
56 | 56 | return $data; |
57 | 57 | } |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function reverse_hit( WordPoints_Hook_Fire $fire ) { |
63 | 63 | |
64 | - if ( isset( $fire->data['points_legacy_reversals']['points_logs'] ) ) { |
|
64 | + if ( isset( $fire->data[ 'points_legacy_reversals' ][ 'points_logs' ] ) ) { |
|
65 | 65 | |
66 | 66 | $this->reverse_logs( |
67 | - $fire->data['points_legacy_reversals']['points_logs'] |
|
67 | + $fire->data[ 'points_legacy_reversals' ][ 'points_logs' ] |
|
68 | 68 | , $fire |
69 | 69 | ); |
70 | 70 | |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | protected function get_hit_ids_to_be_reversed( WordPoints_Hook_Fire $fire ) { |
80 | 80 | |
81 | 81 | // We closely integrate with the legacy reversals extension to get the IDs. |
82 | - if ( ! isset( $fire->data['points_legacy_reversals']['hit_ids'] ) ) { |
|
82 | + if ( ! isset( $fire->data[ 'points_legacy_reversals' ][ 'hit_ids' ] ) ) { |
|
83 | 83 | return array(); |
84 | 84 | } |
85 | 85 | |
86 | - return $fire->data['points_legacy_reversals']['hit_ids']; |
|
86 | + return $fire->data[ 'points_legacy_reversals' ][ 'hit_ids' ]; |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | $expected_settings = array( array( 'current:user' ) ); |
41 | 41 | |
42 | - if ( ! isset( $settings['args'] ) || $settings['args'] !== $expected_settings ) { |
|
42 | + if ( ! isset( $settings[ 'args' ] ) || $settings[ 'args' ] !== $expected_settings ) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | */ |
66 | 66 | protected function get_points_logs_to_be_reversed( WordPoints_Hook_Fire $fire ) { |
67 | 67 | |
68 | - if ( isset( $fire->data[ $this->slug ]['points_logs'] ) ) { |
|
69 | - return $fire->data[ $this->slug ]['points_logs']; |
|
68 | + if ( isset( $fire->data[ $this->slug ][ 'points_logs' ] ) ) { |
|
69 | + return $fire->data[ $this->slug ][ 'points_logs' ]; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | $meta_queries = array( |
@@ -85,14 +85,14 @@ discard block |
||
85 | 85 | $entities = $fire->event_args->get_signature_args(); |
86 | 86 | |
87 | 87 | if ( ! $entities ) { |
88 | - $fire->data[ $this->slug ]['points_logs'] = array(); |
|
88 | + $fire->data[ $this->slug ][ 'points_logs' ] = array(); |
|
89 | 89 | return array(); |
90 | 90 | } |
91 | 91 | |
92 | 92 | // Legacy hooks only ever related to a single entity. |
93 | 93 | $entity = reset( $entities ); |
94 | 94 | |
95 | - $meta_queries[] = array( |
|
95 | + $meta_queries[ ] = array( |
|
96 | 96 | 'key' => $meta_key, |
97 | 97 | 'value' => $entity->get_the_id(), |
98 | 98 | ); |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $logs = array(); |
118 | 118 | } |
119 | 119 | |
120 | - $fire->data[ $this->slug ]['points_logs'] = $logs; |
|
120 | + $fire->data[ $this->slug ][ 'points_logs' ] = $logs; |
|
121 | 121 | |
122 | 122 | return $logs; |
123 | 123 | } |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function get_settings_fields() { |
60 | 60 | |
61 | - $this->settings_fields['points']['label'] = _x( 'Points', 'form label', 'wordpoints' ); |
|
62 | - $this->settings_fields['log_text']['label'] = _x( 'Log Text', 'form label', 'wordpoints' ); |
|
63 | - $this->settings_fields['description']['label'] = _x( 'Description', 'form label', 'wordpoints' ); |
|
61 | + $this->settings_fields[ 'points' ][ 'label' ] = _x( 'Points', 'form label', 'wordpoints' ); |
|
62 | + $this->settings_fields[ 'log_text' ][ 'label' ] = _x( 'Log Text', 'form label', 'wordpoints' ); |
|
63 | + $this->settings_fields[ 'description' ][ 'label' ] = _x( 'Description', 'form label', 'wordpoints' ); |
|
64 | 64 | |
65 | 65 | return parent::get_settings_fields(); |
66 | 66 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | $data = parent::get_ui_script_data(); |
74 | 74 | |
75 | - $data['target_label'] = __( 'Award To', 'wordpoints' ); |
|
76 | - $data['periods_label'] = __( 'Award each user no more than once in:', 'wordpoints' ); |
|
75 | + $data[ 'target_label' ] = __( 'Award To', 'wordpoints' ); |
|
76 | + $data[ 'periods_label' ] = __( 'Award each user no more than once in:', 'wordpoints' ); |
|
77 | 77 | |
78 | 78 | return $data; |
79 | 79 | } |
@@ -87,19 +87,19 @@ discard block |
||
87 | 87 | WordPoints_Hook_Event_Args $event_args |
88 | 88 | ) { |
89 | 89 | |
90 | - if ( ! isset( $settings['points'] ) || false === wordpoints_int( $settings['points'] ) ) { |
|
90 | + if ( ! isset( $settings[ 'points' ] ) || false === wordpoints_int( $settings[ 'points' ] ) ) { |
|
91 | 91 | $validator->add_error( __( 'Points must be an integer.', 'wordpoints' ), 'points' ); |
92 | 92 | } |
93 | 93 | |
94 | - if ( ! isset( $settings['points_type'] ) || ! wordpoints_is_points_type( $settings['points_type'] ) ) { |
|
94 | + if ( ! isset( $settings[ 'points_type' ] ) || ! wordpoints_is_points_type( $settings[ 'points_type' ] ) ) { |
|
95 | 95 | $validator->add_error( __( 'Invalid points type.', 'wordpoints' ), 'points_type' ); |
96 | 96 | } |
97 | 97 | |
98 | - if ( ! isset( $settings['description'] ) ) { |
|
98 | + if ( ! isset( $settings[ 'description' ] ) ) { |
|
99 | 99 | $validator->add_error( __( 'Description is required.', 'wordpoints' ), 'description' ); |
100 | 100 | } |
101 | 101 | |
102 | - if ( ! isset( $settings['log_text'] ) ) { |
|
102 | + if ( ! isset( $settings[ 'log_text' ] ) ) { |
|
103 | 103 | $validator->add_error( __( 'Log Text is required.', 'wordpoints' ), 'log_text' ); |
104 | 104 | } |
105 | 105 | |
@@ -116,10 +116,10 @@ discard block |
||
116 | 116 | |
117 | 117 | parent::update_settings( $reaction, $settings ); |
118 | 118 | |
119 | - $reaction->update_meta( 'points', $settings['points'] ); |
|
120 | - $reaction->update_meta( 'points_type', $settings['points_type'] ); |
|
121 | - $reaction->update_meta( 'description', $settings['description'] ); |
|
122 | - $reaction->update_meta( 'log_text', $settings['log_text'] ); |
|
119 | + $reaction->update_meta( 'points', $settings[ 'points' ] ); |
|
120 | + $reaction->update_meta( 'points_type', $settings[ 'points_type' ] ); |
|
121 | + $reaction->update_meta( 'description', $settings[ 'description' ] ); |
|
122 | + $reaction->update_meta( 'log_text', $settings[ 'log_text' ] ); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -203,11 +203,11 @@ discard block |
||
203 | 203 | protected function get_hit_ids_to_be_reversed( WordPoints_Hook_Fire $fire ) { |
204 | 204 | |
205 | 205 | // We closely integrate with the reversals extension to get the hit IDs. |
206 | - if ( ! isset( $fire->data['reversals']['hit_ids'] ) ) { |
|
206 | + if ( ! isset( $fire->data[ 'reversals' ][ 'hit_ids' ] ) ) { |
|
207 | 207 | return array(); |
208 | 208 | } |
209 | 209 | |
210 | - return $fire->data['reversals']['hit_ids']; |
|
210 | + return $fire->data[ 'reversals' ][ 'hit_ids' ]; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
49 | 49 | |
50 | - switch ( $parsed['dynamic'] ) { |
|
50 | + switch ( $parsed[ 'dynamic' ] ) { |
|
51 | 51 | |
52 | 52 | case 'post': |
53 | 53 | return __( 'Post deleted.', 'wordpoints' ); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | ); |
274 | 274 | |
275 | 275 | $reaction_settings = array( |
276 | - 'points' => $legacy_instance['points'], |
|
276 | + 'points' => $legacy_instance[ 'points' ], |
|
277 | 277 | 'target' => $this->target, |
278 | 278 | 'reactor' => 'points_legacy', |
279 | 279 | 'event' => $this->event_slug, |
@@ -294,8 +294,8 @@ discard block |
||
294 | 294 | $order |
295 | 295 | ); |
296 | 296 | |
297 | - if ( ! isset( $reaction_settings['log_text'] ) ) { |
|
298 | - $reaction_settings['log_text'] = $this->get_log_text_for_instance( |
|
297 | + if ( ! isset( $reaction_settings[ 'log_text' ] ) ) { |
|
298 | + $reaction_settings[ 'log_text' ] = $this->get_log_text_for_instance( |
|
299 | 299 | $points_type |
300 | 300 | ); |
301 | 301 | } |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | |
334 | 334 | if ( |
335 | 335 | $this->skip_non_reversing_hooks |
336 | - && isset( $this->legacy_instance['auto_reverse'] ) |
|
337 | - && ! $this->legacy_instance['auto_reverse'] |
|
336 | + && isset( $this->legacy_instance[ 'auto_reverse' ] ) |
|
337 | + && ! $this->legacy_instance[ 'auto_reverse' ] |
|
338 | 338 | ) { |
339 | 339 | return false; |
340 | 340 | } |
@@ -359,17 +359,17 @@ discard block |
||
359 | 359 | } |
360 | 360 | |
361 | 361 | if ( |
362 | - ! isset( $meta['post_type'] ) |
|
363 | - && isset( $this->legacy_instance['post_type'] ) |
|
362 | + ! isset( $meta[ 'post_type' ] ) |
|
363 | + && isset( $this->legacy_instance[ 'post_type' ] ) |
|
364 | 364 | ) { |
365 | - $meta['post_type'] = $this->legacy_instance['post_type']; |
|
365 | + $meta[ 'post_type' ] = $this->legacy_instance[ 'post_type' ]; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | if ( |
369 | - ! isset( $meta['period'] ) |
|
370 | - && isset( $this->legacy_instance['period'] ) |
|
369 | + ! isset( $meta[ 'period' ] ) |
|
370 | + && isset( $this->legacy_instance[ 'period' ] ) |
|
371 | 371 | ) { |
372 | - $meta['period'] = $this->legacy_instance['period']; |
|
372 | + $meta[ 'period' ] = $this->legacy_instance[ 'period' ]; |
|
373 | 373 | } |
374 | 374 | |
375 | 375 | return $this->legacy_handler->logs( |
@@ -398,10 +398,10 @@ discard block |
||
398 | 398 | |
399 | 399 | if ( 'wordpoints_periodic_points_hook' === $this->legacy_id_base ) { |
400 | 400 | |
401 | - $settings['points_legacy_periods'] = array( |
|
401 | + $settings[ 'points_legacy_periods' ] = array( |
|
402 | 402 | 'fire' => array( |
403 | 403 | array( |
404 | - 'length' => $this->legacy_instance['period'], |
|
404 | + 'length' => $this->legacy_instance[ 'period' ], |
|
405 | 405 | 'args' => array( array( 'current:user' ) ), |
406 | 406 | ), |
407 | 407 | ), |
@@ -411,21 +411,21 @@ discard block |
||
411 | 411 | |
412 | 412 | // We do this even if reversals will be blocked, in case the blocking |
413 | 413 | // is ever removed for this reaction. |
414 | - $settings['points_legacy_reversals'] = array( |
|
414 | + $settings[ 'points_legacy_reversals' ] = array( |
|
415 | 415 | 'toggle_off' => 'toggle_on', |
416 | 416 | ); |
417 | 417 | } |
418 | 418 | |
419 | 419 | if ( |
420 | - isset( $this->legacy_instance['auto_reverse'] ) |
|
421 | - && ! $this->legacy_instance['auto_reverse'] |
|
420 | + isset( $this->legacy_instance[ 'auto_reverse' ] ) |
|
421 | + && ! $this->legacy_instance[ 'auto_reverse' ] |
|
422 | 422 | ) { |
423 | - $settings['blocker']['toggle_off'] = true; |
|
423 | + $settings[ 'blocker' ][ 'toggle_off' ] = true; |
|
424 | 424 | } |
425 | 425 | |
426 | - if ( isset( $this->legacy_instance['post_type'] ) ) { |
|
426 | + if ( isset( $this->legacy_instance[ 'post_type' ] ) ) { |
|
427 | 427 | |
428 | - $post_type = $this->legacy_instance['post_type']; |
|
428 | + $post_type = $this->legacy_instance[ 'post_type' ]; |
|
429 | 429 | |
430 | 430 | if ( 'ALL' === $post_type ) { |
431 | 431 | |
@@ -467,36 +467,36 @@ discard block |
||
467 | 467 | protected function format_settings_for_post_type( $post_type, $settings ) { |
468 | 468 | |
469 | 469 | if ( |
470 | - 'post_publish\post' === $settings['event'] |
|
471 | - || 'points_legacy_post_publish\post' === $settings['event'] |
|
470 | + 'post_publish\post' === $settings[ 'event' ] |
|
471 | + || 'points_legacy_post_publish\post' === $settings[ 'event' ] |
|
472 | 472 | ) { |
473 | 473 | |
474 | 474 | if ( 'attachment' === $post_type ) { |
475 | 475 | |
476 | - $settings['event'] = 'media_upload'; |
|
476 | + $settings[ 'event' ] = 'media_upload'; |
|
477 | 477 | |
478 | 478 | } else { |
479 | 479 | |
480 | - $settings['points_legacy_repeat_blocker'] = array( |
|
480 | + $settings[ 'points_legacy_repeat_blocker' ] = array( |
|
481 | 481 | 'toggle_on' => true, |
482 | 482 | ); |
483 | 483 | } |
484 | 484 | } |
485 | 485 | |
486 | - $settings['event'] = str_replace( |
|
486 | + $settings[ 'event' ] = str_replace( |
|
487 | 487 | '\post' |
488 | 488 | , '\\' . $post_type |
489 | - , $settings['event'] |
|
489 | + , $settings[ 'event' ] |
|
490 | 490 | ); |
491 | 491 | |
492 | - $settings['target'] = str_replace( |
|
492 | + $settings[ 'target' ] = str_replace( |
|
493 | 493 | '\post' |
494 | 494 | , '\\' . $post_type |
495 | - , $settings['target'] |
|
495 | + , $settings[ 'target' ] |
|
496 | 496 | ); |
497 | 497 | |
498 | - $settings['log_text'] = $this->get_log_text_for_instance( |
|
499 | - $settings['points_type'] |
|
498 | + $settings[ 'log_text' ] = $this->get_log_text_for_instance( |
|
499 | + $settings[ 'points_type' ] |
|
500 | 500 | , array( 'post_type' => $post_type ) |
501 | 501 | ); |
502 | 502 | |
@@ -521,11 +521,11 @@ discard block |
||
521 | 521 | return false; |
522 | 522 | } |
523 | 523 | |
524 | - $this->imported_hooks[] = array( |
|
524 | + $this->imported_hooks[ ] = array( |
|
525 | 525 | 'order' => $order, |
526 | 526 | 'id_base' => $this->legacy_id_base, |
527 | 527 | 'instance' => $this->legacy_instance, |
528 | - 'points_type' => $settings['points_type'], |
|
528 | + 'points_type' => $settings[ 'points_type' ], |
|
529 | 529 | 'reaction_id' => $reaction->get_id(), |
530 | 530 | ); |
531 | 531 |