@@ -349,12 +349,12 @@ |
||
349 | 349 | array_walk( |
350 | 350 | $styles, |
351 | 351 | /** |
352 | - * Echo a style card for a single style in the $styles array. |
|
353 | - * |
|
354 | - * @param WP_Post $style |
|
355 | - * @param int $count Used for pagination. |
|
356 | - * @return void |
|
357 | - */ |
|
352 | + * Echo a style card for a single style in the $styles array. |
|
353 | + * |
|
354 | + * @param WP_Post $style |
|
355 | + * @param int $count Used for pagination. |
|
356 | + * @return void |
|
357 | + */ |
|
358 | 358 | function( $style ) use ( &$count ) { |
359 | 359 | $hidden = $count > ( self::PAGE_SIZE - 1 ); |
360 | 360 | $this->echo_style_card( $style, $hidden ); |
@@ -130,11 +130,11 @@ discard block |
||
130 | 130 | private static function has_dark_background( $style ) { |
131 | 131 | $key = 'fieldset_bg_color'; |
132 | 132 | |
133 | - if ( empty( $style->post_content[ $key ] ) ) { |
|
133 | + if ( empty( $style->post_content[$key] ) ) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | 136 | |
137 | - $color = $style->post_content[ $key ]; |
|
137 | + $color = $style->post_content[$key]; |
|
138 | 138 | |
139 | 139 | if ( 0 === strpos( $color, 'rgba' ) ) { |
140 | 140 | preg_match_all( '/([\\d.]+)/', $color, $matches ); |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | ), |
205 | 205 | '/style-templates/' . $style['slug'] |
206 | 206 | ); |
207 | - $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
207 | + $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
208 | 208 | return $params; |
209 | 209 | }; |
210 | 210 | } else { |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | continue; |
266 | 266 | } |
267 | 267 | |
268 | - $value = $style->post_content[ $key ]; |
|
268 | + $value = $style->post_content[$key]; |
|
269 | 269 | |
270 | 270 | $is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent'; |
271 | 271 | if ( $is_hex ) { |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | function( $style ) use ( &$count ) { |
414 | 414 | $hidden = $count > ( self::PAGE_SIZE - 1 ); |
415 | 415 | $this->echo_style_card( $style, $hidden ); |
416 | - ++$count; |
|
416 | + ++ $count; |
|
417 | 417 | } |
418 | 418 | ); |
419 | 419 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | // Remove 'Styling Template' from titles. |
51 | 51 | foreach ( $api_info as $id => $template ) { |
52 | 52 | if ( isset( $template['name'] ) ) { |
53 | - $api_info[ $id ]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
53 | + $api_info[$id]['name'] = preg_replace( '/(\sStyle|Styling)?(\sTemplate)?$/', '', $template['name'] ); |
|
54 | 54 | } |
55 | 55 | } |
56 | 56 |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | 'text-color' => $style->post_content['text_color'], |
41 | 41 | 'submit-bg-color' => $style->post_content['submit_bg_color'], |
42 | 42 | ); |
43 | - $index = 0; |
|
43 | + $index = 0; |
|
44 | 44 | foreach ( $colors as $css_var_name => $color ) { |
45 | 45 | if ( 0 !== strpos( $color, 'rgb' ) ) { |
46 | 46 | $color = '#' . $color; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | 'style' => 'background-color: var(--' . $css_var_name . ')', |
52 | 52 | ); |
53 | 53 | |
54 | - ++$index; |
|
54 | + ++ $index; |
|
55 | 55 | ?> |
56 | 56 | <div <?php FrmAppHelper::array_to_html_params( $circle_params, true ); ?>></div> |
57 | 57 | <?php |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | if ( isset( $addon['categories'] ) ) { |
106 | 106 | $cats = array_intersect( $this->skip_categories(), $addon['categories'] ); |
107 | 107 | if ( ! empty( $cats ) ) { |
108 | - unset( $addons[ $k ] ); |
|
108 | + unset( $addons[$k] ); |
|
109 | 109 | continue; |
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | 113 | if ( ! array_key_exists( 'is_new', $addon ) && array_key_exists( 'released', $addon ) ) { |
114 | - $addons[ $k ]['is_new'] = $this->is_new( $addon ); |
|
114 | + $addons[$k]['is_new'] = $this->is_new( $addon ); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | return $addon; |
154 | 154 | } |
155 | 155 | } |
156 | - } elseif ( isset( $addons[ $download_id ] ) ) { |
|
157 | - $plugin = $addons[ $download_id ]; |
|
156 | + } elseif ( isset( $addons[$download_id] ) ) { |
|
157 | + $plugin = $addons[$download_id]; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | return $plugin; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $page = $this->get_pagenum(); |
21 | 21 | $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' ); |
22 | 22 | |
23 | - $mode = self::get_param( |
|
23 | + $mode = self::get_param( |
|
24 | 24 | array( |
25 | 25 | 'param' => 'mode', |
26 | 26 | 'default' => 'list', |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | 'default' => 'name', |
33 | 33 | ) |
34 | 34 | ); |
35 | - $order = self::get_param( |
|
35 | + $order = self::get_param( |
|
36 | 36 | array( |
37 | 37 | 'param' => 'order', |
38 | 38 | 'default' => 'ASC', |
39 | 39 | ) |
40 | 40 | ); |
41 | - $start = self::get_param( |
|
41 | + $start = self::get_param( |
|
42 | 42 | array( |
43 | 43 | 'param' => 'start', |
44 | 44 | 'default' => ( $page - 1 ) * $per_page, |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | $counts = FrmForm::get_count(); |
163 | 163 | $form_type = FrmAppHelper::simple_get( 'form_type', 'sanitize_title', 'published' ); |
164 | 164 | |
165 | - if ( isset( $statuses[ $form_type ] ) ) { |
|
165 | + if ( isset( $statuses[$form_type] ) ) { |
|
166 | 166 | $counts->$form_type = $this->total_items; |
167 | 167 | } |
168 | 168 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | |
184 | 184 | if ( $counts->{$status} || 'draft' !== $status ) { |
185 | 185 | /* translators: %1$s: Status, %2$s: Number of items */ |
186 | - $links[ $status ] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
186 | + $links[$status] = '<a href="' . esc_url( '?page=formidable&form_type=' . $status ) . '" ' . $class . '>' . sprintf( __( '%1$s <span class="count">(%2$s)</span>', 'formidable' ), $name, number_format_i18n( $counts->{$status} ) ) . '</a>'; |
|
187 | 187 | } |
188 | 188 | |
189 | 189 | unset( $status, $name ); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | private function get_actions( &$actions, $item, $edit_link ) { |
349 | 349 | $new_actions = FrmFormsHelper::get_action_links( $item->id, $item ); |
350 | 350 | foreach ( $new_actions as $link => $action ) { |
351 | - $new_actions[ $link ] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
351 | + $new_actions[$link] = FrmFormsHelper::format_link_html( $action, 'short' ); |
|
352 | 352 | } |
353 | 353 | |
354 | 354 | if ( 'trash' == $this->status ) { |
@@ -181,12 +181,12 @@ discard block |
||
181 | 181 | * @return array |
182 | 182 | */ |
183 | 183 | private function prepare_array_property( $index, $atts ) { |
184 | - if ( isset( $atts[ $index ] ) && ! empty( $atts[ $index ] ) ) { |
|
184 | + if ( isset( $atts[$index] ) && ! empty( $atts[$index] ) ) { |
|
185 | 185 | |
186 | - if ( is_array( $atts[ $index ] ) ) { |
|
187 | - $property = $atts[ $index ]; |
|
186 | + if ( is_array( $atts[$index] ) ) { |
|
187 | + $property = $atts[$index]; |
|
188 | 188 | } else { |
189 | - $property = explode( ',', $atts[ $index ] ); |
|
189 | + $property = explode( ',', $atts[$index] ); |
|
190 | 190 | } |
191 | 191 | } else { |
192 | 192 | $property = array(); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | ); |
267 | 267 | } |
268 | 268 | |
269 | - $ip = array( |
|
269 | + $ip = array( |
|
270 | 270 | 'label' => __( 'IP Address', 'formidable' ), |
271 | 271 | 'value' => $this->entry->ip, |
272 | 272 | ); |
@@ -356,6 +356,6 @@ discard block |
||
356 | 356 | * @return void |
357 | 357 | */ |
358 | 358 | protected function add_field_values( $field ) { |
359 | - $this->field_values[ $field->id ] = new FrmFieldValue( $field, $this->entry ); |
|
359 | + $this->field_values[$field->id] = new FrmFieldValue( $field, $this->entry ); |
|
360 | 360 | } |
361 | 361 | } |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | $show_intervals = array( 50, 200, 500 ); |
81 | 81 | $asked = $this->review_status['asked']; |
82 | 82 | |
83 | - if ( ! isset( $show_intervals[ $asked ] ) ) { |
|
83 | + if ( ! isset( $show_intervals[$asked] ) ) { |
|
84 | 84 | return; |
85 | 85 | } |
86 | 86 | |
87 | 87 | $entries = FrmEntry::getRecordCount(); |
88 | - $count = $show_intervals[ $asked ]; |
|
88 | + $count = $show_intervals[$asked]; |
|
89 | 89 | $user = wp_get_current_user(); |
90 | 90 | |
91 | 91 | // Only show review request if the site has collected enough entries |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | $requests = $message->get_messages(); |
135 | 135 | $key = $this->inbox_key . ( $asked ? $asked : '' ); |
136 | 136 | |
137 | - if ( isset( $requests[ $key ] ) ) { |
|
137 | + if ( isset( $requests[$key] ) ) { |
|
138 | 138 | return; |
139 | 139 | } |
140 | 140 | |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @return bool |
174 | 174 | */ |
175 | 175 | private function has_later_request( $requests, $asked ) { |
176 | - return isset( $requests[ $this->inbox_key . ( $asked + 1 ) ] ) || isset( $requests[ $this->inbox_key . ( $asked + 2 ) ] ); |
|
176 | + return isset( $requests[$this->inbox_key . ( $asked + 1 )] ) || isset( $requests[$this->inbox_key . ( $asked + 2 )] ); |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @return void |
87 | 87 | */ |
88 | 88 | private function init_style_settings( $atts ) { |
89 | - $style_settings = array( |
|
89 | + $style_settings = array( |
|
90 | 90 | 'border_color' => 'dddddd', |
91 | 91 | 'bg_color' => 'f7f7f7', |
92 | 92 | 'text_color' => '444444', |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | $this->style_settings = apply_filters( 'frm_show_entry_styles', $style_settings ); |
98 | 98 | |
99 | 99 | foreach ( $this->style_settings as $key => $setting ) { |
100 | - if ( isset( $atts[ $key ] ) && $atts[ $key ] !== '' ) { |
|
101 | - $this->style_settings[ $key ] = $atts[ $key ]; |
|
100 | + if ( isset( $atts[$key] ) && $atts[$key] !== '' ) { |
|
101 | + $this->style_settings[$key] = $atts[$key]; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | if ( $this->is_color_setting( $key ) ) { |
105 | - $this->style_settings[ $key ] = $this->get_color_markup( $this->style_settings[ $key ] ); |
|
105 | + $this->style_settings[$key] = $this->get_color_markup( $this->style_settings[$key] ); |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | * @return void |
60 | 60 | */ |
61 | 61 | public function set( $key, $value ) { |
62 | - $this->state[ $key ] = $value; |
|
62 | + $this->state[$key] = $value; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -75,8 +75,8 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | public function get( $key, $default ) { |
78 | - if ( isset( $this->state[ $key ] ) ) { |
|
79 | - return $this->state[ $key ]; |
|
78 | + if ( isset( $this->state[$key] ) ) { |
|
79 | + return $this->state[$key]; |
|
80 | 80 | } |
81 | 81 | return $default; |
82 | 82 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | private function compressed_state() { |
172 | 172 | $compressed = array(); |
173 | 173 | foreach ( $this->state as $key => $value ) { |
174 | - $compressed[ self::compressed_key( $key ) ] = $value; |
|
174 | + $compressed[self::compressed_key( $key )] = $value; |
|
175 | 175 | } |
176 | 176 | return $compressed; |
177 | 177 | } |