@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | return false !== strpos( |
43 | 43 | $args->get_current()->get_the_value() |
44 | - , $settings['value'] |
|
44 | + , $settings[ 'value' ] |
|
45 | 45 | ); |
46 | 46 | } |
47 | 47 | } |
@@ -119,8 +119,8 @@ |
||
119 | 119 | } |
120 | 120 | |
121 | 121 | foreach ( self::$paths as $path ) { |
122 | - if ( 0 === strpos( $file, $path['module_realpath'] ) ) { |
|
123 | - $file = $path['module_path'] . substr( $file, $path['realpath_length'] ); |
|
122 | + if ( 0 === strpos( $file, $path[ 'module_realpath' ] ) ) { |
|
123 | + $file = $path[ 'module_path' ] . substr( $file, $path[ 'realpath_length' ] ); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $message = $message->get_error_message(); |
63 | 63 | } |
64 | 64 | |
65 | - echo $args['before_widget']; // XSS OK here, WPCS. |
|
65 | + echo $args[ 'before_widget' ]; // XSS OK here, WPCS. |
|
66 | 66 | |
67 | 67 | ?> |
68 | 68 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | <?php |
88 | 88 | |
89 | - echo $args['after_widget']; // XSs OK here too, WPCS. |
|
89 | + echo $args[ 'after_widget' ]; // XSs OK here too, WPCS. |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | */ |
107 | 107 | protected function verify_settings( $instance ) { |
108 | 108 | |
109 | - if ( ! isset( $instance['title'] ) ) { |
|
110 | - $instance['title'] = ''; |
|
109 | + if ( ! isset( $instance[ 'title' ] ) ) { |
|
110 | + $instance[ 'title' ] = ''; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | return $instance; |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return; |
131 | 131 | } |
132 | 132 | |
133 | - echo $args['before_widget']; // XSS OK here, WPCS. |
|
133 | + echo $args[ 'before_widget' ]; // XSS OK here, WPCS. |
|
134 | 134 | |
135 | 135 | /** |
136 | 136 | * The widget's title. |
@@ -139,14 +139,14 @@ discard block |
||
139 | 139 | * |
140 | 140 | * @param string $title The widget title. |
141 | 141 | */ |
142 | - $title = apply_filters( 'widget_title', $instance['title'] ); |
|
142 | + $title = apply_filters( 'widget_title', $instance[ 'title' ] ); |
|
143 | 143 | |
144 | 144 | if ( ! empty( $title ) ) { |
145 | 145 | |
146 | - echo $args['before_title'] . $title . $args['after_title']; // XSS OK, WPCS. |
|
146 | + echo $args[ 'before_title' ] . $title . $args[ 'after_title' ]; // XSS OK, WPCS. |
|
147 | 147 | } |
148 | 148 | |
149 | - $widget_slug = $this->widget_options['wordpoints_hook_slug']; |
|
149 | + $widget_slug = $this->widget_options[ 'wordpoints_hook_slug' ]; |
|
150 | 150 | |
151 | 151 | /** |
152 | 152 | * Before a WordPoints widget. |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | do_action( "wordpoints_{$widget_slug}_widget_after", $instance ); |
170 | 170 | |
171 | - echo $args['after_widget']; // XSS OK here too, WPCS. |
|
171 | + echo $args[ 'after_widget' ]; // XSS OK here too, WPCS. |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | * @since 2.0.0 |
207 | 207 | */ |
208 | 208 | public function update_title() { |
209 | - $this->instance['title'] = strip_tags( $this->instance['title'] ); |
|
209 | + $this->instance[ 'title' ] = strip_tags( $this->instance[ 'title' ] ); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | <p> |
234 | 234 | <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php echo esc_html_x( 'Title', 'form label', 'wordpoints' ); ?></label> |
235 | - <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $this->instance['title'] ); ?>" /> |
|
235 | + <input type="text" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $this->instance[ 'title' ] ); ?>" /> |
|
236 | 236 | </p> |
237 | 237 | |
238 | 238 | <?php |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function backup() { |
40 | 40 | |
41 | - $this->backup['original_blog_id'] = get_current_blog_id(); |
|
41 | + $this->backup[ 'original_blog_id' ] = get_current_blog_id(); |
|
42 | 42 | |
43 | - if ( isset( $GLOBALS['_wp_switched_stack'] ) ) { |
|
44 | - $this->backup['switched_stack'] = $GLOBALS['_wp_switched_stack']; |
|
43 | + if ( isset( $GLOBALS[ '_wp_switched_stack' ] ) ) { |
|
44 | + $this->backup[ 'switched_stack' ] = $GLOBALS[ '_wp_switched_stack' ]; |
|
45 | 45 | } |
46 | 46 | |
47 | - if ( isset( $GLOBALS['switched'] ) ) { |
|
48 | - $this->backup['switched'] = $GLOBALS['switched']; |
|
47 | + if ( isset( $GLOBALS[ 'switched' ] ) ) { |
|
48 | + $this->backup[ 'switched' ] = $GLOBALS[ 'switched' ]; |
|
49 | 49 | } |
50 | 50 | |
51 | - return $this->backup['original_blog_id']; |
|
51 | + return $this->backup[ 'original_blog_id' ]; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -62,21 +62,21 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function restore() { |
64 | 64 | |
65 | - switch_to_blog( $this->backup['original_blog_id'] ); |
|
65 | + switch_to_blog( $this->backup[ 'original_blog_id' ] ); |
|
66 | 66 | |
67 | - if ( isset( $this->backup['switched_stack'] ) ) { |
|
68 | - $GLOBALS['_wp_switched_stack'] = $this->backup['switched_stack']; |
|
67 | + if ( isset( $this->backup[ 'switched_stack' ] ) ) { |
|
68 | + $GLOBALS[ '_wp_switched_stack' ] = $this->backup[ 'switched_stack' ]; |
|
69 | 69 | } else { |
70 | - unset( $GLOBALS['_wp_switched_stack'] ); |
|
70 | + unset( $GLOBALS[ '_wp_switched_stack' ] ); |
|
71 | 71 | } |
72 | 72 | |
73 | - if ( isset( $this->backup['switched'] ) ) { |
|
74 | - $GLOBALS['switched'] = $this->backup['switched']; |
|
73 | + if ( isset( $this->backup[ 'switched' ] ) ) { |
|
74 | + $GLOBALS[ 'switched' ] = $this->backup[ 'switched' ]; |
|
75 | 75 | } else { |
76 | - unset( $GLOBALS['switched'] ); |
|
76 | + unset( $GLOBALS[ 'switched' ] ); |
|
77 | 77 | } |
78 | 78 | |
79 | - return $this->backup['original_blog_id']; |
|
79 | + return $this->backup[ 'original_blog_id' ]; |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $points_heading = _x( 'Points', 'column name', 'wordpoints' ); |
49 | 49 | |
50 | 50 | $points_type_name = wordpoints_get_points_type_setting( |
51 | - $this->atts['points_type'] |
|
51 | + $this->atts[ 'points_type' ] |
|
52 | 52 | , 'name' |
53 | 53 | ); |
54 | 54 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | } |
96 | 96 | |
97 | 97 | $hooks = WordPoints_Points_Hooks::get_points_type_hooks( |
98 | - $this->atts['points_type'] |
|
98 | + $this->atts[ 'points_type' ] |
|
99 | 99 | ); |
100 | 100 | |
101 | 101 | $html = ''; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | |
117 | 117 | $points = wordpoints_format_points( |
118 | 118 | $points |
119 | - , $this->atts['points_type'] |
|
119 | + , $this->atts[ 'points_type' ] |
|
120 | 120 | , 'how-to-get-points-shortcode' |
121 | 121 | ); |
122 | 122 | |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | |
151 | 151 | foreach ( $store->get_reactions() as $reaction ) { |
152 | 152 | |
153 | - if ( $reaction->get_meta( 'points_type' ) !== $this->atts['points_type'] ) { |
|
153 | + if ( $reaction->get_meta( 'points_type' ) !== $this->atts[ 'points_type' ] ) { |
|
154 | 154 | continue; |
155 | 155 | } |
156 | 156 | |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | if ( $points ) { |
187 | 187 | $points = wordpoints_format_points( |
188 | 188 | $points |
189 | - , $this->atts['points_type'] |
|
189 | + , $this->atts[ 'points_type' ] |
|
190 | 190 | , 'how-to-get-points-shortcode' |
191 | 191 | ); |
192 | 192 | } |
@@ -21,21 +21,21 @@ discard block |
||
21 | 21 | */ |
22 | 22 | protected function verify_settings( $instance ) { |
23 | 23 | |
24 | - if ( isset( $this->defaults['points_type'] ) ) { |
|
24 | + if ( isset( $this->defaults[ 'points_type' ] ) ) { |
|
25 | 25 | |
26 | 26 | // This happens when the widget is first created in the Customizer; the |
27 | 27 | // settings are completely empty. |
28 | - if ( empty( $instance['points_type'] ) ) { |
|
29 | - $default = $this->defaults['points_type']; |
|
28 | + if ( empty( $instance[ 'points_type' ] ) ) { |
|
29 | + $default = $this->defaults[ 'points_type' ]; |
|
30 | 30 | |
31 | 31 | if ( ! $default ) { |
32 | 32 | $this->make_a_points_type( $default ); |
33 | 33 | } |
34 | 34 | |
35 | - $instance['points_type'] = $default; |
|
35 | + $instance[ 'points_type' ] = $default; |
|
36 | 36 | } |
37 | 37 | |
38 | - if ( ! wordpoints_is_points_type( $instance['points_type'] ) ) { |
|
38 | + if ( ! wordpoints_is_points_type( $instance[ 'points_type' ] ) ) { |
|
39 | 39 | return new WP_Error( |
40 | 40 | 'wordpoints_widget_invalid_points_type' |
41 | 41 | , esc_html__( 'Please select a valid points type.', 'wordpoints' ) |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | parent::update( $new_instance, $old_instance ); |
81 | 81 | |
82 | - $this->make_a_points_type( $this->instance['points_type'] ); |
|
82 | + $this->make_a_points_type( $this->instance[ 'points_type' ] ); |
|
83 | 83 | |
84 | 84 | return $this->instance; |
85 | 85 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | public function form_points_type_field() { |
105 | 105 | |
106 | 106 | $dropdown_args = array( |
107 | - 'selected' => $this->instance['points_type'], |
|
107 | + 'selected' => $this->instance[ 'points_type' ], |
|
108 | 108 | 'id' => $this->get_field_id( 'points_type' ), |
109 | 109 | 'name' => $this->get_field_name( 'points_type' ), |
110 | 110 | 'class' => 'widefat', |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ?> |
114 | 114 | |
115 | 115 | <p> |
116 | - <label for="<?php echo esc_attr( $dropdown_args['id'] ); ?>"><?php echo esc_html_x( 'Points type', 'form label', 'wordpoints' ); ?></label> |
|
116 | + <label for="<?php echo esc_attr( $dropdown_args[ 'id' ] ); ?>"><?php echo esc_html_x( 'Points type', 'form label', 'wordpoints' ); ?></label> |
|
117 | 117 | <?php wordpoints_points_types_dropdown( $dropdown_args ); ?> |
118 | 118 | </p> |
119 | 119 |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | */ |
79 | 79 | protected function verify_settings( $instance ) { |
80 | 80 | |
81 | - if ( ! wordpoints_posint( $instance['number_logs'] ) ) { |
|
82 | - $instance['number_logs'] = $this->defaults['number_logs']; |
|
81 | + if ( ! wordpoints_posint( $instance[ 'number_logs' ] ) ) { |
|
82 | + $instance[ 'number_logs' ] = $this->defaults[ 'number_logs' ]; |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | return parent::verify_settings( $instance ); |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | protected function widget_body( $instance ) { |
93 | 93 | |
94 | 94 | $query_args = wordpoints_get_points_logs_query_args( |
95 | - $instance['points_type'] |
|
95 | + $instance[ 'points_type' ] |
|
96 | 96 | , $this->query_slug |
97 | 97 | ); |
98 | 98 | |
99 | - $query_args['limit'] = $instance['number_logs']; |
|
99 | + $query_args[ 'limit' ] = $instance[ 'number_logs' ]; |
|
100 | 100 | |
101 | 101 | $logs_query = new WordPoints_Points_Logs_Query( $query_args ); |
102 | 102 | $logs_query->prime_cache( $this->cache_key ); |
@@ -127,20 +127,20 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function add_points_logs_table_extra_classes( $classes ) { |
129 | 129 | |
130 | - if ( $this->instance && isset( $this->instance['columns'] ) ) { |
|
131 | - foreach ( $this->defaults['columns'] as $column => $unused ) { |
|
132 | - if ( empty( $this->instance['columns'][ $column ] ) ) { |
|
133 | - $classes[] = "wordpoints-hide-{$column}-column"; |
|
130 | + if ( $this->instance && isset( $this->instance[ 'columns' ] ) ) { |
|
131 | + foreach ( $this->defaults[ 'columns' ] as $column => $unused ) { |
|
132 | + if ( empty( $this->instance[ 'columns' ][ $column ] ) ) { |
|
133 | + $classes[ ] = "wordpoints-hide-{$column}-column"; |
|
134 | 134 | } |
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - if ( ! empty( $this->instance['hide_user_names'] ) ) { |
|
139 | - $classes[] = 'wordpoints-hide-user-names'; |
|
138 | + if ( ! empty( $this->instance[ 'hide_user_names' ] ) ) { |
|
139 | + $classes[ ] = 'wordpoints-hide-user-names'; |
|
140 | 140 | } |
141 | 141 | |
142 | - if ( ! empty( $this->instance['horizontal_scrolling'] ) ) { |
|
143 | - $classes[] = 'wordpoints-force-horizontal-scrolling'; |
|
142 | + if ( ! empty( $this->instance[ 'horizontal_scrolling' ] ) ) { |
|
143 | + $classes[ ] = 'wordpoints-force-horizontal-scrolling'; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | return $classes; |
@@ -161,29 +161,29 @@ discard block |
||
161 | 161 | |
162 | 162 | parent::update( $new_instance, $old_instance ); |
163 | 163 | |
164 | - if ( ! wordpoints_posint( $this->instance['number_logs'] ) ) { |
|
165 | - $this->instance['number_logs'] = $this->defaults['number_logs']; |
|
164 | + if ( ! wordpoints_posint( $this->instance[ 'number_logs' ] ) ) { |
|
165 | + $this->instance[ 'number_logs' ] = $this->defaults[ 'number_logs' ]; |
|
166 | 166 | } |
167 | 167 | |
168 | - foreach ( $this->instance['columns'] as $column => $value ) { |
|
168 | + foreach ( $this->instance[ 'columns' ] as $column => $value ) { |
|
169 | 169 | |
170 | - if ( ! isset( $this->defaults['columns'][ $column ] ) ) { |
|
171 | - unset( $this->instance['columns'][ $column ] ); |
|
170 | + if ( ! isset( $this->defaults[ 'columns' ][ $column ] ) ) { |
|
171 | + unset( $this->instance[ 'columns' ][ $column ] ); |
|
172 | 172 | } elseif ( $value ) { |
173 | - $this->instance['columns'][ $column ] = '1'; |
|
173 | + $this->instance[ 'columns' ][ $column ] = '1'; |
|
174 | 174 | } |
175 | 175 | } |
176 | 176 | |
177 | - if ( ! isset( $new_instance['hide_user_names'] ) ) { |
|
178 | - unset( $this->instance['hide_user_names'] ); |
|
179 | - } elseif ( ! empty( $this->instance['hide_user_names'] ) ) { |
|
180 | - $this->instance['hide_user_names'] = '1'; |
|
177 | + if ( ! isset( $new_instance[ 'hide_user_names' ] ) ) { |
|
178 | + unset( $this->instance[ 'hide_user_names' ] ); |
|
179 | + } elseif ( ! empty( $this->instance[ 'hide_user_names' ] ) ) { |
|
180 | + $this->instance[ 'hide_user_names' ] = '1'; |
|
181 | 181 | } |
182 | 182 | |
183 | - if ( ! isset( $new_instance['horizontal_scrolling'] ) ) { |
|
184 | - unset( $this->instance['horizontal_scrolling'] ); |
|
185 | - } elseif ( ! empty( $this->instance['horizontal_scrolling'] ) ) { |
|
186 | - $this->instance['horizontal_scrolling'] = '1'; |
|
183 | + if ( ! isset( $new_instance[ 'horizontal_scrolling' ] ) ) { |
|
184 | + unset( $this->instance[ 'horizontal_scrolling' ] ); |
|
185 | + } elseif ( ! empty( $this->instance[ 'horizontal_scrolling' ] ) ) { |
|
186 | + $this->instance[ 'horizontal_scrolling' ] = '1'; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | return $this->instance; |
@@ -197,15 +197,15 @@ discard block |
||
197 | 197 | |
198 | 198 | parent::form( $instance ); |
199 | 199 | |
200 | - if ( ! wordpoints_posint( $this->instance['number_logs'] ) ) { |
|
201 | - $this->instance['number_logs'] = $this->defaults['number_logs']; |
|
200 | + if ( ! wordpoints_posint( $this->instance[ 'number_logs' ] ) ) { |
|
201 | + $this->instance[ 'number_logs' ] = $this->defaults[ 'number_logs' ]; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | ?> |
205 | 205 | |
206 | 206 | <p> |
207 | 207 | <label for="<?php echo esc_attr( $this->get_field_id( 'number_logs' ) ); ?>"><?php esc_html_e( 'Number of log entries to display', 'wordpoints' ); ?></label> |
208 | - <input type="number" min="1" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'number_logs' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number_logs' ) ); ?>" value="<?php echo absint( $this->instance['number_logs'] ); ?>" /> |
|
208 | + <input type="number" min="1" class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'number_logs' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'number_logs' ) ); ?>" value="<?php echo absint( $this->instance[ 'number_logs' ] ); ?>" /> |
|
209 | 209 | </p> |
210 | 210 | |
211 | 211 | <?php |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | id="<?php echo esc_attr( $this->get_field_id( 'columns[user]' ) ); ?>" |
239 | 239 | name="<?php echo esc_attr( $this->get_field_name( 'columns[user]' ) ); ?>" |
240 | 240 | value="1" |
241 | - <?php checked( ! empty( $this->instance['columns']['user'] ) ); ?> |
|
241 | + <?php checked( ! empty( $this->instance[ 'columns' ][ 'user' ] ) ); ?> |
|
242 | 242 | /> |
243 | 243 | <?php esc_html_e( 'User', 'wordpoints' ); ?> |
244 | 244 | </label> |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | id="<?php echo esc_attr( $this->get_field_id( 'columns[points]' ) ); ?>" |
251 | 251 | name="<?php echo esc_attr( $this->get_field_name( 'columns[points]' ) ); ?>" |
252 | 252 | value="1" |
253 | - <?php checked( ! empty( $this->instance['columns']['points'] ) ); ?> |
|
253 | + <?php checked( ! empty( $this->instance[ 'columns' ][ 'points' ] ) ); ?> |
|
254 | 254 | /> |
255 | 255 | <?php esc_html_e( 'Points', 'wordpoints' ); ?> |
256 | 256 | </label> |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | id="<?php echo esc_attr( $this->get_field_id( 'columns[description]' ) ); ?>" |
263 | 263 | name="<?php echo esc_attr( $this->get_field_name( 'columns[description]' ) ); ?>" |
264 | 264 | value="1" |
265 | - <?php checked( ! empty( $this->instance['columns']['description'] ) ); ?> |
|
265 | + <?php checked( ! empty( $this->instance[ 'columns' ][ 'description' ] ) ); ?> |
|
266 | 266 | /> |
267 | 267 | <?php esc_html_e( 'Description', 'wordpoints' ); ?> |
268 | 268 | </label> |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | id="<?php echo esc_attr( $this->get_field_id( 'columns[time]' ) ); ?>" |
275 | 275 | name="<?php echo esc_attr( $this->get_field_name( 'columns[time]' ) ); ?>" |
276 | 276 | value="1" |
277 | - <?php checked( ! empty( $this->instance['columns']['time'] ) ); ?> |
|
277 | + <?php checked( ! empty( $this->instance[ 'columns' ][ 'time' ] ) ); ?> |
|
278 | 278 | /> |
279 | 279 | <?php esc_html_e( 'Time', 'wordpoints' ); ?> |
280 | 280 | </label> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | id="<?php echo esc_attr( $this->get_field_id( 'hide_user_names' ) ); ?>" |
302 | 302 | name="<?php echo esc_attr( $this->get_field_name( 'hide_user_names' ) ); ?>" |
303 | 303 | value="1" |
304 | - <?php checked( ! empty( $this->instance['hide_user_names'] ) ); ?> |
|
304 | + <?php checked( ! empty( $this->instance[ 'hide_user_names' ] ) ); ?> |
|
305 | 305 | /> |
306 | 306 | <?php esc_html_e( 'Hide user names (but not avatars)', 'wordpoints' ); ?> |
307 | 307 | </label> |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | id="<?php echo esc_attr( $this->get_field_id( 'horizontal_scrolling' ) ); ?>" |
328 | 328 | name="<?php echo esc_attr( $this->get_field_name( 'horizontal_scrolling' ) ); ?>" |
329 | 329 | value="1" |
330 | - <?php checked( ! empty( $this->instance['horizontal_scrolling'] ) ); ?> |
|
330 | + <?php checked( ! empty( $this->instance[ 'horizontal_scrolling' ] ) ); ?> |
|
331 | 331 | /> |
332 | 332 | <?php esc_html_e( 'Enable horizontal scrolling', 'wordpoints' ); ?> |
333 | 333 | </label> |
@@ -69,9 +69,9 @@ discard block |
||
69 | 69 | |
70 | 70 | $parts = explode( '\\', $slug, 2 ); |
71 | 71 | |
72 | - if ( isset( $parts[1] ) ) { |
|
73 | - $parsed['dynamic'] = $parts[1]; |
|
74 | - $parsed['generic'] = $parts[0]; |
|
72 | + if ( isset( $parts[ 1 ] ) ) { |
|
73 | + $parsed[ 'dynamic' ] = $parts[ 1 ]; |
|
74 | + $parsed[ 'generic' ] = $parts[ 0 ]; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | return $parsed; |
@@ -347,19 +347,19 @@ discard block |
||
347 | 347 | |
348 | 348 | $supports = get_all_post_type_supports( $slug ); |
349 | 349 | |
350 | - if ( isset( $supports['title'] ) ) { |
|
350 | + if ( isset( $supports[ 'title' ] ) ) { |
|
351 | 351 | $children->register( "post\\{$slug}", 'title', 'WordPoints_Entity_Post_Title' ); |
352 | 352 | } |
353 | 353 | |
354 | - if ( isset( $supports['editor'] ) ) { |
|
354 | + if ( isset( $supports[ 'editor' ] ) ) { |
|
355 | 355 | $children->register( "post\\{$slug}", 'content', 'WordPoints_Entity_Post_Content' ); |
356 | 356 | } |
357 | 357 | |
358 | - if ( isset( $supports['excerpt'] ) ) { |
|
358 | + if ( isset( $supports[ 'excerpt' ] ) ) { |
|
359 | 359 | $children->register( "post\\{$slug}", 'excerpt', 'WordPoints_Entity_Post_Excerpt' ); |
360 | 360 | } |
361 | 361 | |
362 | - if ( isset( $supports['comments'] ) ) { |
|
362 | + if ( isset( $supports[ 'comments' ] ) ) { |
|
363 | 363 | |
364 | 364 | $children->register( "post\\{$slug}", 'comment_count', 'WordPoints_Entity_Post_Comment_Count' ); |
365 | 365 | |
@@ -486,10 +486,10 @@ discard block |
||
486 | 486 | if ( |
487 | 487 | defined( 'DOING_AJAX' ) |
488 | 488 | && DOING_AJAX |
489 | - && isset( $_SERVER['HTTP_REFERER'] ) |
|
489 | + && isset( $_SERVER[ 'HTTP_REFERER' ] ) |
|
490 | 490 | && preg_match( |
491 | 491 | '#^' . preg_quote( network_admin_url(), '#' ) . '#i' |
492 | - , esc_url_raw( wp_unslash( $_SERVER['HTTP_REFERER'] ) ) |
|
492 | + , esc_url_raw( wp_unslash( $_SERVER[ 'HTTP_REFERER' ] ) ) |
|
493 | 493 | ) |
494 | 494 | ) { |
495 | 495 | return true; |
@@ -39,8 +39,8 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function __construct( $slug, array $action_args, array $args = array() ) { |
41 | 41 | |
42 | - if ( isset( $args['comment_type'] ) ) { |
|
43 | - $this->comment_type = $args['comment_type']; |
|
42 | + if ( isset( $args[ 'comment_type' ] ) ) { |
|
43 | + $this->comment_type = $args[ 'comment_type' ]; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | parent::__construct( $slug, $action_args, $args ); |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | |
56 | 56 | $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
57 | 57 | |
58 | - if ( ! $parts['dynamic'] ) { |
|
58 | + if ( ! $parts[ 'dynamic' ] ) { |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | |
62 | 62 | $arg_slug = str_replace( |
63 | 63 | '\\post' |
64 | - , '\\' . $parts['dynamic'] |
|
64 | + , '\\' . $parts[ 'dynamic' ] |
|
65 | 65 | , 'comment\\post' |
66 | 66 | ); |
67 | 67 |