@@ -36,7 +36,7 @@ |
||
| 36 | 36 | $event_labels = FrmFormAction::trigger_labels(); |
| 37 | 37 | foreach ( $action_control->action_options['event'] as $event ) { |
| 38 | 38 | ?> |
| 39 | - <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[ $event ] ) ? $event_labels[ $event ] : $event ); ?></option> |
|
| 39 | + <option value="<?php echo esc_attr( $event ); ?>" <?php echo in_array( $event, (array) $form_action->post_content['event'] ) ? ' selected="selected"' : ''; ?> ><?php echo esc_html( isset( $event_labels[$event] ) ? $event_labels[$event] : $event ); ?></option> |
|
| 40 | 40 | <?php } ?> |
| 41 | 41 | </select> |
| 42 | 42 | </p> |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | public static function get_banner_tip() { |
| 299 | - $tips = array( |
|
| 299 | + $tips = array( |
|
| 300 | 300 | array( |
| 301 | 301 | 'link' => array( |
| 302 | 302 | 'medium' => 'banner', |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | ), |
| 324 | 324 | ); |
| 325 | 325 | $random = rand( 0, count( $tips ) - 1 ); |
| 326 | - $tip = $tips[ $random ]; |
|
| 326 | + $tip = $tips[$random]; |
|
| 327 | 327 | $tip['num'] = $random; |
| 328 | 328 | |
| 329 | 329 | return $tip; |
@@ -332,6 +332,6 @@ discard block |
||
| 332 | 332 | public static function get_random_tip( $tips ) { |
| 333 | 333 | $random = rand( 0, count( $tips ) - 1 ); |
| 334 | 334 | |
| 335 | - return $tips[ $random ]; |
|
| 335 | + return $tips[$random]; |
|
| 336 | 336 | } |
| 337 | 337 | } |
@@ -61,8 +61,8 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $with_tags = $args['conditional_check'] ? 3 : 2; |
| 64 | - if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) { |
|
| 65 | - $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] ); |
|
| 64 | + if ( ! empty( $shortcodes[$with_tags][$short_key] ) ) { |
|
| 65 | + $tag = str_replace( '[' . $prefix, '', $shortcodes[0][$short_key] ); |
|
| 66 | 66 | $tag = str_replace( ']', '', $tag ); |
| 67 | 67 | $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag ); |
| 68 | 68 | $tags = preg_split( '/\s+/', $tag, 2 ); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $tag = $tags[0]; |
| 71 | 71 | } |
| 72 | 72 | } else { |
| 73 | - $tag = $shortcodes[ $with_tags - 1 ][ $short_key ]; |
|
| 73 | + $tag = $shortcodes[$with_tags - 1][$short_key]; |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $tag; |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $section['function'] = $original; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | - $sections[ $key ] = $section; |
|
| 118 | + $sections[$key] = $section; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $sections; |
@@ -127,11 +127,11 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $section = FrmAppHelper::get_post_param( 'tab', '', 'sanitize_text_field' ); |
| 129 | 129 | $sections = self::get_settings_tabs(); |
| 130 | - if ( ! isset( $sections[ $section ] ) ) { |
|
| 130 | + if ( ! isset( $sections[$section] ) ) { |
|
| 131 | 131 | wp_die(); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - $section = $sections[ $section ]; |
|
| 134 | + $section = $sections[$section]; |
|
| 135 | 135 | |
| 136 | 136 | if ( isset( $section['class'] ) ) { |
| 137 | 137 | call_user_func( array( $section['class'], $section['function'] ) ); |
@@ -98,19 +98,19 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | foreach ( $action_controls as $action ) { |
| 101 | - if ( isset( $groups[ $action->id_base ] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 101 | + if ( isset( $groups[$action->id_base] ) || in_array( $action->id_base, $grouped ) ) { |
|
| 102 | 102 | continue; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | $this_group = $action->action_options['group']; |
| 106 | - if ( ! isset( $groups[ $this_group ] ) ) { |
|
| 106 | + if ( ! isset( $groups[$this_group] ) ) { |
|
| 107 | 107 | $this_group = 'misc'; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - if ( ! isset( $groups[ $this_group ]['actions'] ) ) { |
|
| 111 | - $groups[ $this_group ]['actions'] = array(); |
|
| 110 | + if ( ! isset( $groups[$this_group]['actions'] ) ) { |
|
| 111 | + $groups[$this_group]['actions'] = array(); |
|
| 112 | 112 | } |
| 113 | - $groups[ $this_group ]['actions'][] = $action->id_base; |
|
| 113 | + $groups[$this_group]['actions'][] = $action->id_base; |
|
| 114 | 114 | |
| 115 | 115 | unset( $action ); |
| 116 | 116 | } |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | return $a; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $actions[ $a->id_base ] = $a; |
|
| 244 | + $actions[$a->id_base] = $a; |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | return $actions; |
@@ -272,16 +272,16 @@ discard block |
||
| 272 | 272 | $action_map = array(); |
| 273 | 273 | |
| 274 | 274 | foreach ( $action_controls as $key => $control ) { |
| 275 | - $action_map[ $control->id_base ] = $key; |
|
| 275 | + $action_map[$control->id_base] = $key; |
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | foreach ( $form_actions as $action ) { |
| 279 | - if ( ! isset( $action_map[ $action->post_excerpt ] ) ) { |
|
| 279 | + if ( ! isset( $action_map[$action->post_excerpt] ) ) { |
|
| 280 | 280 | // don't try and show settings if action no longer exists |
| 281 | 281 | continue; |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | - self::action_control( $action, $form, $action->ID, $action_controls[ $action_map[ $action->post_excerpt ] ], $values ); |
|
| 284 | + self::action_control( $action, $form, $action->ID, $action_controls[$action_map[$action->post_excerpt]], $values ); |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
@@ -489,8 +489,8 @@ discard block |
||
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | // Store actions so they can be triggered with the correct priority. |
| 492 | - $stored_actions[ $action->ID ] = $action; |
|
| 493 | - $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority']; |
|
| 492 | + $stored_actions[$action->ID] = $action; |
|
| 493 | + $action_priority[$action->ID] = $link_settings[$action->post_excerpt]->action_options['priority']; |
|
| 494 | 494 | |
| 495 | 495 | unset( $action ); |
| 496 | 496 | } |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | new FrmNotification(); |
| 503 | 503 | |
| 504 | 504 | foreach ( $action_priority as $action_id => $priority ) { |
| 505 | - $action = $stored_actions[ $action_id ]; |
|
| 505 | + $action = $stored_actions[$action_id]; |
|
| 506 | 506 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 507 | 507 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 508 | 508 | |
@@ -549,12 +549,12 @@ discard block |
||
| 549 | 549 | } |
| 550 | 550 | |
| 551 | 551 | public function register( $action_class ) { |
| 552 | - $this->actions[ $action_class ] = new $action_class(); |
|
| 552 | + $this->actions[$action_class] = new $action_class(); |
|
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | public function unregister( $action_class ) { |
| 556 | - if ( isset( $this->actions[ $action_class ] ) ) { |
|
| 557 | - unset( $this->actions[ $action_class ] ); |
|
| 556 | + if ( isset( $this->actions[$action_class] ) ) { |
|
| 557 | + unset( $this->actions[$action_class] ); |
|
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 | |
@@ -563,8 +563,8 @@ discard block |
||
| 563 | 563 | |
| 564 | 564 | foreach ( $keys as $key ) { |
| 565 | 565 | // don't register new action if old action with the same id is already registered |
| 566 | - if ( ! isset( $this->actions[ $key ] ) ) { |
|
| 567 | - $this->actions[ $key ]->_register(); |
|
| 566 | + if ( ! isset( $this->actions[$key] ) ) { |
|
| 567 | + $this->actions[$key]->_register(); |
|
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | foreach ( $pass_settings as $setting ) { |
| 141 | 141 | if ( isset( $settings_list->$setting ) ) { |
| 142 | - $settings[ $setting ] = $this->maybe_json( $settings_list->$setting ); |
|
| 142 | + $settings[$setting] = $this->maybe_json( $settings_list->$setting ); |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | |
| 172 | 172 | $message_settings = array(); |
| 173 | 173 | foreach ( $messages as $message ) { |
| 174 | - $message_settings[ $message ] = $settings_list->$message; |
|
| 174 | + $message_settings[$message] = $settings_list->$message; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | return $message_settings; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | foreach ( $frm_roles as $frm_role => $frm_role_description ) { |
| 191 | 191 | if ( isset( $settings_list->$frm_role ) ) { |
| 192 | - $permissions[ $frm_role ] = $settings_list->$frm_role; |
|
| 192 | + $permissions[$frm_role] = $settings_list->$frm_role; |
|
| 193 | 193 | } |
| 194 | 194 | } |
| 195 | 195 | |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | ); |
| 257 | 257 | |
| 258 | 258 | foreach ( $settings as $setting ) { |
| 259 | - if ( isset( $form->options[ $setting ] ) ) { |
|
| 260 | - $new_form[ $setting ] = $this->maybe_json( $form->options[ $setting ] ); |
|
| 259 | + if ( isset( $form->options[$setting] ) ) { |
|
| 260 | + $new_form[$setting] = $this->maybe_json( $form->options[$setting] ); |
|
| 261 | 261 | } |
| 262 | 262 | } |
| 263 | 263 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | * @return array |
| 309 | 309 | */ |
| 310 | 310 | private function fields() { |
| 311 | - $args = array( |
|
| 311 | + $args = array( |
|
| 312 | 312 | 'limit' => 50, |
| 313 | 313 | 'order_by' => 'id DESC', |
| 314 | 314 | ); |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $fields = FrmDb::get_results( 'frm_fields', array(), 'form_id, name, type, field_options', $args ); |
| 317 | 317 | foreach ( $fields as $k => $field ) { |
| 318 | 318 | FrmAppHelper::unserialize_or_decode( $field->field_options ); |
| 319 | - $fields[ $k ]->field_options = json_encode( $field->field_options ); |
|
| 319 | + $fields[$k]->field_options = json_encode( $field->field_options ); |
|
| 320 | 320 | } |
| 321 | 321 | return $fields; |
| 322 | 322 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | foreach ( (array) $fields as $f ) { |
| 331 | 331 | FrmAppHelper::unserialize_or_decode( $f->field_options ); |
| 332 | - $size = $f->field_options['size']; |
|
| 332 | + $size = $f->field_options['size']; |
|
| 333 | 333 | $this->maybe_convert_migrated_size( $size ); |
| 334 | 334 | |
| 335 | 335 | if ( $size === $f->field_options['size'] ) { |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | continue; |
| 393 | 393 | } |
| 394 | 394 | |
| 395 | - $this->maybe_convert_migrated_size( $widgets[ $k ]['size'] ); |
|
| 395 | + $this->maybe_convert_migrated_size( $widgets[$k]['size'] ); |
|
| 396 | 396 | } |
| 397 | 397 | update_option( 'widget_frm_show_form', $widgets ); |
| 398 | 398 | } |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | if ( ! is_array( $widget ) || ! isset( $widget['size'] ) ) { |
| 492 | 492 | continue; |
| 493 | 493 | } |
| 494 | - $this->convert_character_to_px( $widgets[ $k ]['size'] ); |
|
| 494 | + $this->convert_character_to_px( $widgets[$k]['size'] ); |
|
| 495 | 495 | } |
| 496 | 496 | update_option( 'widget_frm_show_form', $widgets ); |
| 497 | 497 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | global $wpdb; |
| 56 | 56 | |
| 57 | - $values = array( |
|
| 57 | + $values = array( |
|
| 58 | 58 | 'item_id' => $entry_id, |
| 59 | 59 | 'field_id' => $field_id, |
| 60 | 60 | ); |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | if ( ( is_array( $meta_value ) && empty( $meta_value ) ) || ( ! is_array( $meta_value ) && trim( $meta_value ) == '' ) ) { |
| 130 | 130 | // remove blank fields |
| 131 | - unset( $values[ $field_id ] ); |
|
| 131 | + unset( $values[$field_id] ); |
|
| 132 | 132 | } else { |
| 133 | 133 | // if value exists, then update it |
| 134 | 134 | self::update_entry_meta( $entry_id, $field_id, '', $meta_value ); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | */ |
| 194 | 194 | public static function get_meta_value( $entry, $field_id ) { |
| 195 | 195 | if ( isset( $entry->metas ) ) { |
| 196 | - return isset( $entry->metas[ $field_id ] ) ? $entry->metas[ $field_id ] : false; |
|
| 196 | + return isset( $entry->metas[$field_id] ) ? $entry->metas[$field_id] : false; |
|
| 197 | 197 | } else { |
| 198 | 198 | return self::get_entry_meta_by_field( $entry->id, $field_id ); |
| 199 | 199 | } |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | $cached = FrmDb::check_cache( $entry_id, 'frm_entry' ); |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | - if ( $cached && isset( $cached->metas ) && isset( $cached->metas[ $field_id ] ) ) { |
|
| 215 | - $result = $cached->metas[ $field_id ]; |
|
| 214 | + if ( $cached && isset( $cached->metas ) && isset( $cached->metas[$field_id] ) ) { |
|
| 215 | + $result = $cached->metas[$field_id]; |
|
| 216 | 216 | |
| 217 | 217 | return wp_unslash( $result ); |
| 218 | 218 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | if ( is_numeric( $field_id ) ) { |
| 223 | 223 | $query['field_id'] = $field_id; |
| 224 | 224 | } else { |
| 225 | - $get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id'; |
|
| 225 | + $get_table .= ' it LEFT OUTER JOIN ' . $wpdb->prefix . 'frm_fields fi ON it.field_id=fi.id'; |
|
| 226 | 226 | $query['fi.field_key'] = $field_id; |
| 227 | 227 | } |
| 228 | 228 | |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | 'stripslashes' => true, |
| 241 | 241 | 'is_draft' => false, |
| 242 | 242 | ); |
| 243 | - $args = wp_parse_args( $args, $defaults ); |
|
| 243 | + $args = wp_parse_args( $args, $defaults ); |
|
| 244 | 244 | |
| 245 | 245 | $query = array(); |
| 246 | 246 | self::meta_field_query( $field_id, $order, $limit, $args, $query ); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | |
| 256 | 256 | foreach ( $values as $k => $v ) { |
| 257 | 257 | FrmAppHelper::unserialize_or_decode( $v ); |
| 258 | - $values[ $k ] = $v; |
|
| 258 | + $values[$k] = $v; |
|
| 259 | 259 | unset( $k, $v ); |
| 260 | 260 | } |
| 261 | 261 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | foreach ( $results as $k => $result ) { |
| 314 | 314 | FrmAppHelper::unserialize_or_decode( $result->meta_value ); |
| 315 | - $results[ $k ]->meta_value = wp_unslash( $result->meta_value ); |
|
| 315 | + $results[$k]->meta_value = wp_unslash( $result->meta_value ); |
|
| 316 | 316 | unset( $k, $result ); |
| 317 | 317 | } |
| 318 | 318 | |
@@ -325,7 +325,7 @@ discard block |
||
| 325 | 325 | 'user_id' => '', |
| 326 | 326 | 'group_by' => '', |
| 327 | 327 | ); |
| 328 | - $args = wp_parse_args( $args, $defaults ); |
|
| 328 | + $args = wp_parse_args( $args, $defaults ); |
|
| 329 | 329 | |
| 330 | 330 | $query = array(); |
| 331 | 331 | self::get_ids_query( $where, $order_by, $limit, $unique, $args, $query ); |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $to = $this->prepare_email_setting( $this->settings['email_to'], $user_id_args ); |
| 86 | 86 | $to = $this->explode_emails( $to ); |
| 87 | 87 | |
| 88 | - $where = array( |
|
| 88 | + $where = array( |
|
| 89 | 89 | 'it.field_id !' => 0, |
| 90 | 90 | 'it.item_id' => $this->entry->id, |
| 91 | 91 | ); |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | 'entry' => $this->entry, |
| 96 | 96 | 'form' => $this->form, |
| 97 | 97 | ); |
| 98 | - $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 98 | + $to = apply_filters( 'frm_to_email', $to, $values, $this->form->id, $args ); |
|
| 99 | 99 | |
| 100 | 100 | $this->to = array_unique( (array) $to ); |
| 101 | 101 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | // Add the user info if it isn't already included |
| 300 | 300 | if ( $this->include_user_info && $prev_mail_body === $mail_body ) { |
| 301 | - $data = $this->entry->description; |
|
| 301 | + $data = $this->entry->description; |
|
| 302 | 302 | $mail_body .= "\r\n\r\n" . __( 'User Information', 'formidable' ) . "\r\n"; |
| 303 | 303 | $this->maybe_add_ip( $mail_body ); |
| 304 | 304 | $mail_body .= __( 'User-Agent (Browser/OS)', 'formidable' ) . ': ' . FrmEntriesHelper::get_browser( $data['browser'] ) . "\r\n"; |
@@ -563,12 +563,12 @@ discard block |
||
| 563 | 563 | $name = trim( str_replace( $email, '', $val ) ); |
| 564 | 564 | } else { |
| 565 | 565 | // If user enters a name without an email |
| 566 | - unset( $recipients[ $key ] ); |
|
| 566 | + unset( $recipients[$key] ); |
|
| 567 | 567 | continue; |
| 568 | 568 | } |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | - $recipients[ $key ] = $this->format_from_email( $name, $email ); |
|
| 571 | + $recipients[$key] = $this->format_from_email( $name, $email ); |
|
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | return $recipients; |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | ); |
| 710 | 710 | |
| 711 | 711 | // Remove phone number from to addresses |
| 712 | - unset( $this->to[ $key ] ); |
|
| 712 | + unset( $this->to[$key] ); |
|
| 713 | 713 | } |
| 714 | 714 | } |
| 715 | 715 | } |