Formidable Forms – Form Builder for WordPress - Version 3.03.02

Version Description

  • Fix: When syntax highlighting was turned off in the user profile, the custom CSS box didn't appear.
  • Fix: Allow 'aside' tags in the form widget. Don't remove it when sanitizing.
  • Fix: When a form includes a reCaptcha, the loading indicator on the submit button wasn't triggered on submit.
  • Fix: The reCaptcha label was orphaned and didn't pass WCAG compliance. This fix applies to new reCaptcha fields. For existing fields, delete it and add it again.
  • Fix: Automatically scroll the form builder window when a field is dragged and dropped in the form.
  • Fix: Use a percentage for left labels instead of a fixed with to ensure the margin isn't too big for small spaces.
Download this release

Release Info

Developer sswells
Plugin Icon 128x128 Formidable Forms – Form Builder for WordPress
Version 3.03.02
Comparing to
See all releases

Code changes from version 3.03.01 to 3.03.02

Files changed (70) hide show
  1. classes/controllers/FrmAddonsController.php +14 -8
  2. classes/controllers/FrmAppController.php +24 -16
  3. classes/controllers/FrmEntriesController.php +22 -12
  4. classes/controllers/FrmFieldsController.php +7 -4
  5. classes/controllers/FrmFormActionsController.php +26 -18
  6. classes/controllers/FrmFormsController.php +109 -77
  7. classes/controllers/FrmStylesController.php +39 -34
  8. classes/controllers/FrmXMLController.php +9 -6
  9. classes/helpers/FrmAppHelper.php +72 -45
  10. classes/helpers/FrmCSVExportHelper.php +52 -28
  11. classes/helpers/FrmEntriesListHelper.php +36 -24
  12. classes/helpers/FrmFieldsHelper.php +17 -12
  13. classes/helpers/FrmFormsHelper.php +7 -5
  14. classes/helpers/FrmFormsListHelper.php +42 -28
  15. classes/helpers/FrmListHelper.php +70 -48
  16. classes/helpers/FrmShortcodeHelper.php +8 -5
  17. classes/helpers/FrmXMLHelper.php +25 -17
  18. classes/models/FrmAddon.php +8 -4
  19. classes/models/FrmCreateFile.php +7 -4
  20. classes/models/FrmEDD_SL_Plugin_Updater.php +23 -14
  21. classes/models/FrmEmail.php +39 -27
  22. classes/models/FrmEntry.php +14 -8
  23. classes/models/FrmEntryFormat.php +8 -4
  24. classes/models/FrmEntryMeta.php +15 -8
  25. classes/models/FrmField.php +23 -21
  26. classes/models/FrmFieldFormHtml.php +14 -8
  27. classes/models/FrmFieldValue.php +17 -7
  28. classes/models/FrmForm.php +10 -9
  29. classes/models/FrmFormAction.php +19 -12
  30. classes/models/FrmMigrate.php +7 -5
  31. classes/models/FrmPersonalData.php +6 -4
  32. classes/models/FrmStyle.php +9 -6
  33. classes/models/FrmTableHTMLGenerator.php +3 -2
  34. classes/models/fields/FrmFieldCaptcha.php +1 -1
  35. classes/models/fields/FrmFieldCheckbox.php +6 -4
  36. classes/models/fields/FrmFieldRadio.php +6 -4
  37. classes/models/fields/FrmFieldSelect.php +6 -4
  38. classes/models/fields/FrmFieldType.php +3 -2
  39. classes/views/frm-entries/list.php +10 -9
  40. classes/views/frm-entries/show.php +10 -8
  41. classes/views/frm-fields/back-end/dropdown-field.php +8 -5
  42. classes/views/frm-fields/back-end/field-multiple.php +4 -6
  43. classes/views/frm-fields/front-end/checkbox-field.php +15 -16
  44. classes/views/frm-fields/front-end/dropdown-field.php +20 -15
  45. classes/views/frm-fields/front-end/radio-field.php +15 -16
  46. classes/views/frm-forms/edit.php +9 -7
  47. classes/views/frm-forms/list.php +6 -5
  48. classes/views/frm-forms/new.php +9 -7
  49. classes/views/frm-forms/settings.php +6 -4
  50. classes/views/shared/mb_adv_info.php +22 -16
  51. classes/views/styles/custom_css.php +2 -2
  52. classes/widgets/FrmShowForm.php +12 -8
  53. css/custom_theme.css.php +1 -1
  54. css/frm_old_grids.css +1 -1
  55. formidable.php +1 -1
  56. js/formidable.js +2 -1
  57. js/formidable.min.js +12 -12
  58. js/formidable_admin.js +20 -0
  59. languages/formidable-az_AZ.mo +0 -0
  60. languages/formidable-az_AZ.po +2890 -2996
  61. languages/formidable-es_ES.mo +0 -0
  62. languages/formidable-es_ES.po +1693 -1803
  63. languages/formidable-it_IT.mo +0 -0
  64. languages/formidable-it_IT.po +1134 -1247
  65. languages/formidable-ja.mo +0 -0
  66. languages/formidable-ja.po +3044 -3150
  67. languages/formidable-nb_NO.mo +0 -0
  68. languages/formidable-nb_NO.po +2670 -2793
  69. languages/formidable-nl_NL.mo +0 -0
  70. languages/formidable-nl_NL.po +268 -203
classes/controllers/FrmAddonsController.php CHANGED
@@ -173,10 +173,13 @@ class FrmAddonsController {
173
  if ( file_exists( $file . '/' . $base_file . '.php' ) ) {
174
  $file_name = $base_file . '/' . $base_file . '.php';
175
  if ( ! is_plugin_active( $file_name ) ) {
176
- $addon['activate_url'] = add_query_arg( array(
177
- '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $file_name ),
178
- 'plugin' => $file_name,
179
- ), $activate_url );
 
 
 
180
  }
181
  }
182
  }
@@ -208,10 +211,13 @@ class FrmAddonsController {
208
 
209
  if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
210
  $url = 'https://formidableforms.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
211
- $licenses = self::send_api_request( $url, array(
212
- 'name' => 'frm_api_licence',
213
- 'expires' => 60 * 60 * 5,
214
- ) );
 
 
 
215
  echo json_encode( $licenses );
216
  }
217
 
173
  if ( file_exists( $file . '/' . $base_file . '.php' ) ) {
174
  $file_name = $base_file . '/' . $base_file . '.php';
175
  if ( ! is_plugin_active( $file_name ) ) {
176
+ $addon['activate_url'] = add_query_arg(
177
+ array(
178
+ '_wpnonce' => wp_create_nonce( 'activate-plugin_' . $file_name ),
179
+ 'plugin' => $file_name,
180
+ ),
181
+ $activate_url
182
+ );
183
  }
184
  }
185
  }
211
 
212
  if ( $license && is_array( $license ) && isset( $license['license'] ) ) {
213
  $url = 'https://formidableforms.com/frm-edd-api/licenses?l=' . urlencode( base64_encode( $license['license'] ) );
214
+ $licenses = self::send_api_request(
215
+ $url,
216
+ array(
217
+ 'name' => 'frm_api_licence',
218
+ 'expires' => 60 * 60 * 5,
219
+ )
220
+ );
221
  echo json_encode( $licenses );
222
  }
223
 
classes/controllers/FrmAppController.php CHANGED
@@ -13,11 +13,12 @@ class FrmAppController {
13
  }
14
 
15
  private static function get_menu_position() {
16
- $count = count( get_post_types( array(
17
  'show_ui' => true,
18
  '_builtin' => false,
19
  'show_in_menu' => true,
20
- ) ) );
 
21
  $pos = $count ? '22.7' : '29.3';
22
  $pos = apply_filters( 'frm_menu_position', $pos );
23
  return $pos;
@@ -108,11 +109,11 @@ class FrmAppController {
108
  ),
109
  );
110
 
111
- $nav_items = apply_filters( 'frm_form_nav_list', $nav_items, array(
112
  'form_id' => $id,
113
  'form' => $form,
114
- ) );
115
- return $nav_items;
116
  }
117
 
118
  // Adds a settings link to the plugins page
@@ -147,12 +148,16 @@ class FrmAppController {
147
  ?>
148
  <div class="error" class="frm_previous_install">
149
  <?php
150
- echo apply_filters( 'frm_pro_update_msg', // WPCS: XSS ok.
 
151
  sprintf(
152
  esc_html__( 'This site has been previously authorized to run Formidable Forms. %1$sInstall Formidable Pro%2$s or %3$sdeauthorize%4$s this site to continue running the free version and remove this message.', 'formidable' ),
153
- '<br/><a href="' . esc_url( $inst_install_url ) . '" target="_blank">', '</a>',
154
- '<a href="#" class="frm_deauthorize_link">', '</a>'
155
- ), esc_url( $inst_install_url )
 
 
 
156
  );
157
  ?>
158
  </div>
@@ -201,11 +206,13 @@ class FrmAppController {
201
  * @return boolean
202
  */
203
  public static function needs_update() {
204
- $needs_upgrade = self::compare_for_update( array(
205
- 'option' => 'frm_db_version',
206
- 'new_db_version' => FrmAppHelper::$db_version,
207
- 'new_plugin_version' => FrmAppHelper::plugin_version(),
208
- ) );
 
 
209
 
210
  if ( ! $needs_upgrade ) {
211
  $needs_upgrade = apply_filters( 'frm_db_needs_upgrade', $needs_upgrade );
@@ -374,10 +381,11 @@ class FrmAppController {
374
  * @since 3.0
375
  */
376
  public static function create_rest_routes() {
377
- register_rest_route( 'frm-admin/v1', '/install', array(
378
  'methods' => 'GET',
379
  'callback' => 'FrmAppController::api_install',
380
- ) );
 
381
  }
382
 
383
  /**
13
  }
14
 
15
  private static function get_menu_position() {
16
+ $query = array(
17
  'show_ui' => true,
18
  '_builtin' => false,
19
  'show_in_menu' => true,
20
+ );
21
+ $count = count( get_post_types( $query ) );
22
  $pos = $count ? '22.7' : '29.3';
23
  $pos = apply_filters( 'frm_menu_position', $pos );
24
  return $pos;
109
  ),
110
  );
111
 
112
+ $nav_args = array(
113
  'form_id' => $id,
114
  'form' => $form,
115
+ );
116
+ return apply_filters( 'frm_form_nav_list', $nav_items, $nav_args );
117
  }
118
 
119
  // Adds a settings link to the plugins page
148
  ?>
149
  <div class="error" class="frm_previous_install">
150
  <?php
151
+ echo apply_filters( // WPCS: XSS ok.
152
+ 'frm_pro_update_msg',
153
  sprintf(
154
  esc_html__( 'This site has been previously authorized to run Formidable Forms. %1$sInstall Formidable Pro%2$s or %3$sdeauthorize%4$s this site to continue running the free version and remove this message.', 'formidable' ),
155
+ '<br/><a href="' . esc_url( $inst_install_url ) . '" target="_blank">',
156
+ '</a>',
157
+ '<a href="#" class="frm_deauthorize_link">',
158
+ '</a>'
159
+ ),
160
+ esc_url( $inst_install_url )
161
  );
162
  ?>
163
  </div>
206
  * @return boolean
207
  */
208
  public static function needs_update() {
209
+ $needs_upgrade = self::compare_for_update(
210
+ array(
211
+ 'option' => 'frm_db_version',
212
+ 'new_db_version' => FrmAppHelper::$db_version,
213
+ 'new_plugin_version' => FrmAppHelper::plugin_version(),
214
+ )
215
+ );
216
 
217
  if ( ! $needs_upgrade ) {
218
  $needs_upgrade = apply_filters( 'frm_db_needs_upgrade', $needs_upgrade );
381
  * @since 3.0
382
  */
383
  public static function create_rest_routes() {
384
+ $args = array(
385
  'methods' => 'GET',
386
  'callback' => 'FrmAppController::api_install',
387
+ );
388
+ register_rest_route( 'frm-admin/v1', '/install', $args );
389
  }
390
 
391
  /**
classes/controllers/FrmEntriesController.php CHANGED
@@ -61,11 +61,17 @@ class FrmEntriesController {
61
 
62
  unset( $action, $page );
63
 
64
- $screen->add_help_tab( array(
65
- 'id' => 'formidable-entries-tab',
66
- 'title' => __( 'Overview', 'formidable' ),
67
- 'content' => '<p>' . esc_html__( 'This screen provides access to all of your entries. You can customize the display of this screen to suit your workflow.', 'formidable' ) . '</p> <p>' . esc_html__( 'Hovering over a row in the entries list will display action links that allow you to manage your entry.', 'formidable' ) . '</p>',
68
- ));
 
 
 
 
 
 
69
 
70
  $screen->set_help_sidebar(
71
  '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
@@ -114,11 +120,14 @@ class FrmEntriesController {
114
 
115
  $action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
116
  if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $action, array( '', 'list', 'destroy' ) ) ) {
117
- add_screen_option( 'per_page', array(
118
- 'label' => __( 'Entries', 'formidable' ),
119
- 'default' => 20,
120
- 'option' => 'formidable_page_formidable_entries_per_page',
121
- ) );
 
 
 
122
  }
123
 
124
  return $columns;
@@ -665,7 +674,7 @@ class FrmEntriesController {
665
  * @return array|string
666
  */
667
  public static function show_entry_shortcode( $atts ) {
668
- $defaults = apply_filters( 'frm_show_entry_defaults', array(
669
  'id' => false,
670
  'entry' => false,
671
  'fields' => false,
@@ -689,7 +698,8 @@ class FrmEntriesController {
689
  'include_extras' => '',
690
  'inline_style' => 1,
691
  'child_array' => false, // return embedded fields as nested array
692
- ) );
 
693
 
694
  $atts = shortcode_atts( $defaults, $atts );
695
 
61
 
62
  unset( $action, $page );
63
 
64
+ $screen->add_help_tab(
65
+ array(
66
+ 'id' => 'formidable-entries-tab',
67
+ 'title' => __( 'Overview', 'formidable' ),
68
+ 'content' => '<p>' .
69
+ esc_html__( 'This screen provides access to all of your entries. You can customize the display of this screen to suit your workflow.', 'formidable' ) .
70
+ '</p> <p>' .
71
+ esc_html__( 'Hovering over a row in the entries list will display action links that allow you to manage your entry.', 'formidable' ) .
72
+ '</p>',
73
+ )
74
+ );
75
 
76
  $screen->set_help_sidebar(
77
  '<p><strong>' . esc_html__( 'For more information:', 'formidable' ) . '</strong></p>' .
120
 
121
  $action = FrmAppHelper::simple_get( 'frm_action', 'sanitize_title' );
122
  if ( FrmAppHelper::is_admin_page( 'formidable-entries' ) && in_array( $action, array( '', 'list', 'destroy' ) ) ) {
123
+ add_screen_option(
124
+ 'per_page',
125
+ array(
126
+ 'label' => __( 'Entries', 'formidable' ),
127
+ 'default' => 20,
128
+ 'option' => 'formidable_page_formidable_entries_per_page',
129
+ )
130
+ );
131
  }
132
 
133
  return $columns;
674
  * @return array|string
675
  */
676
  public static function show_entry_shortcode( $atts ) {
677
+ $defaults = array(
678
  'id' => false,
679
  'entry' => false,
680
  'fields' => false,
698
  'include_extras' => '',
699
  'inline_style' => 1,
700
  'child_array' => false, // return embedded fields as nested array
701
+ );
702
+ $defaults = apply_filters( 'frm_show_entry_defaults', $defaults );
703
 
704
  $atts = shortcode_atts( $defaults, $atts );
705
 
classes/controllers/FrmFieldsController.php CHANGED
@@ -149,10 +149,13 @@ class FrmFieldsController {
149
  unset( $new_val );
150
  }
151
 
152
- FrmField::update( $field_id, array(
153
- 'field_options' => $field->field_options,
154
- 'form_id' => $field->form_id,
155
- ) );
 
 
 
156
  wp_die();
157
  }
158
 
149
  unset( $new_val );
150
  }
151
 
152
+ FrmField::update(
153
+ $field_id,
154
+ array(
155
+ 'field_options' => $field->field_options,
156
+ 'form_id' => $field->form_id,
157
+ )
158
+ );
159
  wp_die();
160
  }
161
 
classes/controllers/FrmFormActionsController.php CHANGED
@@ -5,18 +5,21 @@ class FrmFormActionsController {
5
  public static $registered_actions;
6
 
7
  public static function register_post_types() {
8
- register_post_type( self::$action_post_type, array(
9
- 'label' => __( 'Form Actions', 'formidable' ),
10
- 'description' => '',
11
- 'public' => false,
12
- 'show_ui' => false,
13
- 'exclude_from_search' => true,
14
- 'show_in_nav_menus' => false,
15
- 'show_in_menu' => true,
16
- 'capability_type' => 'page',
17
- 'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'page-attributes' ),
18
- 'has_archive' => false,
19
- ) );
 
 
 
20
 
21
  /**
22
  * post_content: json settings
@@ -34,7 +37,7 @@ class FrmFormActionsController {
34
  }
35
 
36
  public static function register_actions() {
37
- $action_classes = apply_filters( 'frm_registered_form_actions', array(
38
  'email' => 'FrmEmailAction',
39
  'wppost' => 'FrmDefPostAction',
40
  'register' => 'FrmDefRegAction',
@@ -43,7 +46,8 @@ class FrmFormActionsController {
43
  'mailchimp' => 'FrmDefMlcmpAction',
44
  'twilio' => 'FrmDefTwilioAction',
45
  'highrise' => 'FrmDefHrsAction',
46
- ) );
 
47
 
48
  include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php' );
49
  include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php' );
@@ -210,10 +214,14 @@ class FrmFormActionsController {
210
 
211
  $registered_actions = self::$registered_actions->actions;
212
 
213
- $old_actions = FrmDb::get_col( $wpdb->posts, array(
214
- 'post_type' => self::$action_post_type,
215
- 'menu_order' => $form_id,
216
- ), 'ID' );
 
 
 
 
217
  $new_actions = array();
218
 
219
  foreach ( $registered_actions as $registered_action ) {
5
  public static $registered_actions;
6
 
7
  public static function register_post_types() {
8
+ register_post_type(
9
+ self::$action_post_type,
10
+ array(
11
+ 'label' => __( 'Form Actions', 'formidable' ),
12
+ 'description' => '',
13
+ 'public' => false,
14
+ 'show_ui' => false,
15
+ 'exclude_from_search' => true,
16
+ 'show_in_nav_menus' => false,
17
+ 'show_in_menu' => true,
18
+ 'capability_type' => 'page',
19
+ 'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'page-attributes' ),
20
+ 'has_archive' => false,
21
+ )
22
+ );
23
 
24
  /**
25
  * post_content: json settings
37
  }
38
 
39
  public static function register_actions() {
40
+ $action_classes = array(
41
  'email' => 'FrmEmailAction',
42
  'wppost' => 'FrmDefPostAction',
43
  'register' => 'FrmDefRegAction',
46
  'mailchimp' => 'FrmDefMlcmpAction',
47
  'twilio' => 'FrmDefTwilioAction',
48
  'highrise' => 'FrmDefHrsAction',
49
+ );
50
+ $action_classes = apply_filters( 'frm_registered_form_actions', $action_classes );
51
 
52
  include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/email_action.php' );
53
  include_once( FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/default_actions.php' );
214
 
215
  $registered_actions = self::$registered_actions->actions;
216
 
217
+ $old_actions = FrmDb::get_col(
218
+ $wpdb->posts,
219
+ array(
220
+ 'post_type' => self::$action_post_type,
221
+ 'menu_order' => $form_id,
222
+ ),
223
+ 'ID'
224
+ );
225
  $new_actions = array();
226
 
227
  foreach ( $registered_actions as $registered_action ) {
classes/controllers/FrmFormsController.php CHANGED
@@ -289,19 +289,23 @@ class FrmFormsController {
289
  }
290
 
291
  private static function set_preview_query() {
292
- $random_page = get_posts( array(
293
- 'numberposts' => 1,
294
- 'orderby' => 'date',
295
- 'order' => 'ASC',
296
- 'post_type' => 'page',
297
- ) );
 
 
298
 
299
  if ( ! empty( $random_page ) ) {
300
  $random_page = reset( $random_page );
301
- query_posts( array(
302
- 'post_type' => 'page',
303
- 'page_id' => $random_page->ID,
304
- ) );
 
 
305
  }
306
  }
307
 
@@ -420,10 +424,12 @@ class FrmFormsController {
420
  $count++;
421
  }
422
 
423
- $form_type = FrmAppHelper::get_simple_request( array(
424
- 'param' => 'form_type',
425
- 'type' => 'request',
426
- ) );
 
 
427
 
428
  $available_status['untrash']['message'] = sprintf( _n( '%1$s form restored from the Trash.', '%1$s forms restored from the Trash.', $count, 'formidable' ), $count );
429
  $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' );
@@ -443,11 +449,18 @@ class FrmFormsController {
443
  }
444
  }
445
 
446
- $current_page = FrmAppHelper::get_simple_request( array(
447
- 'param' => 'form_type',
448
- 'type' => 'request',
449
- ) );
450
- $message = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=list&action=bulk_untrash&form_type=' . $current_page . '&item-action=' . implode( ',', $ids ), 'bulk-toplevel_page_formidable' ) ) . '">', '</a>' );
 
 
 
 
 
 
 
451
 
452
  return $message;
453
  }
@@ -612,11 +625,13 @@ class FrmFormsController {
612
  $columns['cb'] = '<input type="checkbox" />';
613
  $columns['id'] = 'ID';
614
 
615
- $type = FrmAppHelper::get_simple_request( array(
616
- 'param' => 'form_type',
617
- 'type' => 'request',
618
- 'default' => 'published',
619
- ) );
 
 
620
 
621
  if ( 'template' == $type ) {
622
  $columns['name'] = __( 'Template Name', 'formidable' );
@@ -631,11 +646,14 @@ class FrmFormsController {
631
 
632
  $columns['created_at'] = __( 'Date', 'formidable' );
633
 
634
- add_screen_option( 'per_page', array(
635
- 'label' => __( 'Forms', 'formidable' ),
636
- 'default' => 20,
637
- 'option' => 'formidable_page_formidable_per_page',
638
- ) );
 
 
 
639
 
640
  return $columns;
641
  }
@@ -651,10 +669,12 @@ class FrmFormsController {
651
  }
652
 
653
  public static function hidden_columns( $hidden_columns ) {
654
- $type = FrmAppHelper::get_simple_request( array(
655
- 'param' => 'form_type',
656
- 'type' => 'request',
657
- ) );
 
 
658
 
659
  if ( $type === 'template' ) {
660
  $hidden_columns[] = 'id';
@@ -851,11 +871,13 @@ class FrmFormsController {
851
  FrmAppHelper::permission_check( 'frm_view_forms' );
852
  check_ajax_referer( 'frm_ajax', 'nonce' );
853
 
854
- echo FrmEntriesController::show_entry_shortcode( array( // WPCS: XSS ok.
855
- 'form_id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
856
- 'default_email' => true,
857
- 'plain_text' => FrmAppHelper::get_post_param( 'plain_text', '', 'absint' ),
858
- ) );
 
 
859
  wp_die();
860
  }
861
 
@@ -1097,14 +1119,16 @@ class FrmFormsController {
1097
  public static function add_menu_to_admin_bar() {
1098
  global $wp_admin_bar;
1099
 
1100
- $wp_admin_bar->add_node( array(
1101
- 'id' => 'frm-forms',
1102
- 'title' => '<span class="ab-icon"></span><span class="ab-label">' . FrmAppHelper::get_menu_name() . '</span>',
1103
- 'href' => admin_url( 'admin.php?page=formidable' ),
1104
- 'meta' => array(
1105
- 'title' => FrmAppHelper::get_menu_name(),
1106
- ),
1107
- ) );
 
 
1108
  }
1109
 
1110
  /**
@@ -1117,12 +1141,14 @@ class FrmFormsController {
1117
 
1118
  foreach ( $actions as $form_id => $name ) {
1119
 
1120
- $wp_admin_bar->add_node( array(
1121
- 'parent' => 'frm-forms',
1122
- 'id' => 'edit_form_' . $form_id,
1123
- 'title' => empty( $name ) ? __( '(no title)' ) : $name,
1124
- 'href' => admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . $form_id ),
1125
- ) );
 
 
1126
  }
1127
  }
1128
 
@@ -1139,23 +1165,23 @@ class FrmFormsController {
1139
  return $sc . ']';
1140
  }
1141
 
1142
- $shortcode_atts = shortcode_atts( array(
1143
- 'id' => '',
1144
- 'key' => '',
1145
- 'title' => false,
1146
- 'description' => false,
1147
- 'readonly' => false,
1148
- 'entry_id' => false,
1149
- 'fields' => array(),
1150
- 'exclude_fields' => array(),
1151
- 'minimize' => false,
1152
- ), $atts );
 
 
 
1153
  do_action( 'formidable_shortcode_atts', $shortcode_atts, $atts );
1154
 
1155
- return self::show_form(
1156
- $shortcode_atts['id'], $shortcode_atts['key'], $shortcode_atts['title'],
1157
- $shortcode_atts['description'], $atts
1158
- );
1159
  }
1160
 
1161
  public static function show_form( $id = '', $key = '', $title = false, $description = false, $atts = array() ) {
@@ -1275,10 +1301,13 @@ class FrmFormsController {
1275
 
1276
  self::run_success_action( $pass_args );
1277
 
1278
- do_action( 'frm_after_entry_processed', array(
1279
- 'entry_id' => $entry_id,
1280
- 'form' => $form,
1281
- ) );
 
 
 
1282
  }
1283
  }
1284
  }
@@ -1327,10 +1356,12 @@ class FrmFormsController {
1327
  $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id'];
1328
  }
1329
 
1330
- $conf_method = self::get_confirmation_method( array(
1331
- 'form' => $form,
1332
- 'entry_id' => $params['id'],
1333
- ) );
 
 
1334
 
1335
  if ( 'redirect' === $conf_method ) {
1336
  self::trigger_redirect( $form, $params, $args );
@@ -1439,11 +1470,12 @@ class FrmFormsController {
1439
  sprintf( __( '%1$sClick here%2$s if you are not automatically redirected.', 'formidable' ), '<a href="' . esc_url( $success_url ) . '">', '</a>' ) .
1440
  '</div></div>';
1441
 
1442
- return apply_filters( 'frm_redirect_msg', $redirect_msg, array(
1443
  'entry_id' => $args['entry_id'],
1444
  'form_id' => $args['form']->id,
1445
  'form' => $args['form'],
1446
- ) );
 
1447
  }
1448
 
1449
  /**
289
  }
290
 
291
  private static function set_preview_query() {
292
+ $random_page = get_posts(
293
+ array(
294
+ 'numberposts' => 1,
295
+ 'orderby' => 'date',
296
+ 'order' => 'ASC',
297
+ 'post_type' => 'page',
298
+ )
299
+ );
300
 
301
  if ( ! empty( $random_page ) ) {
302
  $random_page = reset( $random_page );
303
+ query_posts(
304
+ array(
305
+ 'post_type' => 'page',
306
+ 'page_id' => $random_page->ID,
307
+ )
308
+ );
309
  }
310
  }
311
 
424
  $count++;
425
  }
426
 
427
+ $form_type = FrmAppHelper::get_simple_request(
428
+ array(
429
+ 'param' => 'form_type',
430
+ 'type' => 'request',
431
+ )
432
+ );
433
 
434
  $available_status['untrash']['message'] = sprintf( _n( '%1$s form restored from the Trash.', '%1$s forms restored from the Trash.', $count, 'formidable' ), $count );
435
  $available_status['trash']['message'] = sprintf( _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ), $count, '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' );
449
  }
450
  }
451
 
452
+ $current_page = FrmAppHelper::get_simple_request(
453
+ array(
454
+ 'param' => 'form_type',
455
+ 'type' => 'request',
456
+ )
457
+ );
458
+ $message = sprintf(
459
+ _n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ),
460
+ $count,
461
+ '<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=list&action=bulk_untrash&form_type=' . $current_page . '&item-action=' . implode( ',', $ids ), 'bulk-toplevel_page_formidable' ) ) . '">',
462
+ '</a>'
463
+ );
464
 
465
  return $message;
466
  }
625
  $columns['cb'] = '<input type="checkbox" />';
626
  $columns['id'] = 'ID';
627
 
628
+ $type = FrmAppHelper::get_simple_request(
629
+ array(
630
+ 'param' => 'form_type',
631
+ 'type' => 'request',
632
+ 'default' => 'published',
633
+ )
634
+ );
635
 
636
  if ( 'template' == $type ) {
637
  $columns['name'] = __( 'Template Name', 'formidable' );
646
 
647
  $columns['created_at'] = __( 'Date', 'formidable' );
648
 
649
+ add_screen_option(
650
+ 'per_page',
651
+ array(
652
+ 'label' => __( 'Forms', 'formidable' ),
653
+ 'default' => 20,
654
+ 'option' => 'formidable_page_formidable_per_page',
655
+ )
656
+ );
657
 
658
  return $columns;
659
  }
669
  }
670
 
671
  public static function hidden_columns( $hidden_columns ) {
672
+ $type = FrmAppHelper::get_simple_request(
673
+ array(
674
+ 'param' => 'form_type',
675
+ 'type' => 'request',
676
+ )
677
+ );
678
 
679
  if ( $type === 'template' ) {
680
  $hidden_columns[] = 'id';
871
  FrmAppHelper::permission_check( 'frm_view_forms' );
872
  check_ajax_referer( 'frm_ajax', 'nonce' );
873
 
874
+ echo FrmEntriesController::show_entry_shortcode( // WPCS: XSS ok.
875
+ array(
876
+ 'form_id' => FrmAppHelper::get_post_param( 'form_id', '', 'absint' ),
877
+ 'default_email' => true,
878
+ 'plain_text' => FrmAppHelper::get_post_param( 'plain_text', '', 'absint' ),
879
+ )
880
+ );
881
  wp_die();
882
  }
883
 
1119
  public static function add_menu_to_admin_bar() {
1120
  global $wp_admin_bar;
1121
 
1122
+ $wp_admin_bar->add_node(
1123
+ array(
1124
+ 'id' => 'frm-forms',
1125
+ 'title' => '<span class="ab-icon"></span><span class="ab-label">' . FrmAppHelper::get_menu_name() . '</span>',
1126
+ 'href' => admin_url( 'admin.php?page=formidable' ),
1127
+ 'meta' => array(
1128
+ 'title' => FrmAppHelper::get_menu_name(),
1129
+ ),
1130
+ )
1131
+ );
1132
  }
1133
 
1134
  /**
1141
 
1142
  foreach ( $actions as $form_id => $name ) {
1143
 
1144
+ $wp_admin_bar->add_node(
1145
+ array(
1146
+ 'parent' => 'frm-forms',
1147
+ 'id' => 'edit_form_' . $form_id,
1148
+ 'title' => empty( $name ) ? __( '(no title)' ) : $name,
1149
+ 'href' => admin_url( 'admin.php?page=formidable&frm_action=edit&id=' . $form_id ),
1150
+ )
1151
+ );
1152
  }
1153
  }
1154
 
1165
  return $sc . ']';
1166
  }
1167
 
1168
+ $shortcode_atts = shortcode_atts(
1169
+ array(
1170
+ 'id' => '',
1171
+ 'key' => '',
1172
+ 'title' => false,
1173
+ 'description' => false,
1174
+ 'readonly' => false,
1175
+ 'entry_id' => false,
1176
+ 'fields' => array(),
1177
+ 'exclude_fields' => array(),
1178
+ 'minimize' => false,
1179
+ ),
1180
+ $atts
1181
+ );
1182
  do_action( 'formidable_shortcode_atts', $shortcode_atts, $atts );
1183
 
1184
+ return self::show_form( $shortcode_atts['id'], $shortcode_atts['key'], $shortcode_atts['title'], $shortcode_atts['description'], $atts );
 
 
 
1185
  }
1186
 
1187
  public static function show_form( $id = '', $key = '', $title = false, $description = false, $atts = array() ) {
1301
 
1302
  self::run_success_action( $pass_args );
1303
 
1304
+ do_action(
1305
+ 'frm_after_entry_processed',
1306
+ array(
1307
+ 'entry_id' => $entry_id,
1308
+ 'form' => $form,
1309
+ )
1310
+ );
1311
  }
1312
  }
1313
  }
1356
  $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id'];
1357
  }
1358
 
1359
+ $conf_method = self::get_confirmation_method(
1360
+ array(
1361
+ 'form' => $form,
1362
+ 'entry_id' => $params['id'],
1363
+ )
1364
+ );
1365
 
1366
  if ( 'redirect' === $conf_method ) {
1367
  self::trigger_redirect( $form, $params, $args );
1470
  sprintf( __( '%1$sClick here%2$s if you are not automatically redirected.', 'formidable' ), '<a href="' . esc_url( $success_url ) . '">', '</a>' ) .
1471
  '</div></div>';
1472
 
1473
+ $redirect_args = array(
1474
  'entry_id' => $args['entry_id'],
1475
  'form_id' => $args['form']->id,
1476
  'form' => $args['form'],
1477
+ );
1478
+ return apply_filters( 'frm_redirect_msg', $redirect_msg, $redirect_args );
1479
  }
1480
 
1481
  /**
classes/controllers/FrmStylesController.php CHANGED
@@ -11,33 +11,36 @@ class FrmStylesController {
11
  }
12
 
13
  public static function register_post_types() {
14
- register_post_type( self::$post_type, array(
15
- 'label' => __( 'Styles', 'formidable' ),
16
- 'public' => false,
17
- 'show_ui' => false,
18
- 'capability_type' => 'page',
19
- 'capabilities' => array(
20
- 'edit_post' => 'frm_change_settings',
21
- 'edit_posts' => 'frm_change_settings',
22
- 'edit_others_posts' => 'frm_change_settings',
23
- 'publish_posts' => 'frm_change_settings',
24
- 'delete_post' => 'frm_change_settings',
25
- 'delete_posts' => 'frm_change_settings',
26
- 'read_private_posts' => 'read_private_posts',
27
- ),
28
- 'supports' => array(
29
- 'title',
30
- ),
31
- 'has_archive' => false,
32
- 'labels' => array(
33
- 'name' => __( 'Styles', 'formidable' ),
34
- 'singular_name' => __( 'Style', 'formidable' ),
35
- 'menu_name' => __( 'Style', 'formidable' ),
36
- 'edit' => __( 'Edit' ),
37
- 'add_new_item' => __( 'Create a New Style', 'formidable' ),
38
- 'edit_item' => __( 'Edit Style', 'formidable' ),
39
- ),
40
- ) );
 
 
 
41
  }
42
 
43
  public static function menu() {
@@ -273,13 +276,15 @@ class FrmStylesController {
273
  public static function custom_css( $message = '', $style = null ) {
274
  if ( function_exists( 'wp_enqueue_code_editor' ) ) {
275
  $id = 'frm_codemirror_box';
276
- $settings = wp_enqueue_code_editor( array(
277
- 'type' => 'text/css',
278
- 'codemirror' => array(
279
- 'indentUnit' => 2,
280
- 'tabSize' => 2,
281
- ),
282
- ) );
 
 
283
  } else {
284
  $id = 'frm_custom_css_box';
285
  $settings = array();
11
  }
12
 
13
  public static function register_post_types() {
14
+ register_post_type(
15
+ self::$post_type,
16
+ array(
17
+ 'label' => __( 'Styles', 'formidable' ),
18
+ 'public' => false,
19
+ 'show_ui' => false,
20
+ 'capability_type' => 'page',
21
+ 'capabilities' => array(
22
+ 'edit_post' => 'frm_change_settings',
23
+ 'edit_posts' => 'frm_change_settings',
24
+ 'edit_others_posts' => 'frm_change_settings',
25
+ 'publish_posts' => 'frm_change_settings',
26
+ 'delete_post' => 'frm_change_settings',
27
+ 'delete_posts' => 'frm_change_settings',
28
+ 'read_private_posts' => 'read_private_posts',
29
+ ),
30
+ 'supports' => array(
31
+ 'title',
32
+ ),
33
+ 'has_archive' => false,
34
+ 'labels' => array(
35
+ 'name' => __( 'Styles', 'formidable' ),
36
+ 'singular_name' => __( 'Style', 'formidable' ),
37
+ 'menu_name' => __( 'Style', 'formidable' ),
38
+ 'edit' => __( 'Edit' ),
39
+ 'add_new_item' => __( 'Create a New Style', 'formidable' ),
40
+ 'edit_item' => __( 'Edit Style', 'formidable' ),
41
+ ),
42
+ )
43
+ );
44
  }
45
 
46
  public static function menu() {
276
  public static function custom_css( $message = '', $style = null ) {
277
  if ( function_exists( 'wp_enqueue_code_editor' ) ) {
278
  $id = 'frm_codemirror_box';
279
+ $settings = wp_enqueue_code_editor(
280
+ array(
281
+ 'type' => 'text/css',
282
+ 'codemirror' => array(
283
+ 'indentUnit' => 2,
284
+ 'tabSize' => 2,
285
+ ),
286
+ )
287
+ );
288
  } else {
289
  $id = 'frm_custom_css_box';
290
  $settings = array();
classes/controllers/FrmXMLController.php CHANGED
@@ -52,12 +52,13 @@ class FrmXMLController {
52
  );
53
  $forms = FrmForm::getAll( $where, 'name' );
54
 
55
- $export_types = apply_filters( 'frm_xml_export_types', array(
56
  'forms' => __( 'Forms', 'formidable' ),
57
  'items' => __( 'Entries', 'formidable' ),
58
- ) );
 
59
 
60
- $export_format = apply_filters( 'frm_export_formats', array(
61
  'xml' => array(
62
  'name' => 'XML',
63
  'support' => 'forms',
@@ -68,7 +69,8 @@ class FrmXMLController {
68
  'support' => 'items',
69
  'count' => 'single',
70
  ),
71
- ) );
 
72
 
73
  include( FrmAppHelper::plugin_path() . '/classes/views/xml/import_form.php' );
74
  }
@@ -101,13 +103,14 @@ class FrmXMLController {
101
 
102
  //add_filter('upload_mimes', 'FrmXMLController::allow_mime');
103
 
104
- $export_format = apply_filters( 'frm_export_formats', array(
105
  'xml' => array(
106
  'name' => 'XML',
107
  'support' => 'forms',
108
  'count' => 'multiple',
109
  ),
110
- ) );
 
111
 
112
  $file_type = strtolower( pathinfo( $_FILES['frm_import_file']['name'], PATHINFO_EXTENSION ) );
113
  if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
52
  );
53
  $forms = FrmForm::getAll( $where, 'name' );
54
 
55
+ $export_types = array(
56
  'forms' => __( 'Forms', 'formidable' ),
57
  'items' => __( 'Entries', 'formidable' ),
58
+ );
59
+ $export_types = apply_filters( 'frm_xml_export_types', $export_types );
60
 
61
+ $export_format = array(
62
  'xml' => array(
63
  'name' => 'XML',
64
  'support' => 'forms',
69
  'support' => 'items',
70
  'count' => 'single',
71
  ),
72
+ );
73
+ $export_format = apply_filters( 'frm_export_formats', $export_format );
74
 
75
  include( FrmAppHelper::plugin_path() . '/classes/views/xml/import_form.php' );
76
  }
103
 
104
  //add_filter('upload_mimes', 'FrmXMLController::allow_mime');
105
 
106
+ $export_format = array(
107
  'xml' => array(
108
  'name' => 'XML',
109
  'support' => 'forms',
110
  'count' => 'multiple',
111
  ),
112
+ );
113
+ $export_format = apply_filters( 'frm_export_formats', $export_format );
114
 
115
  $file_type = strtolower( pathinfo( $_FILES['frm_import_file']['name'], PATHINFO_EXTENSION ) );
116
  if ( 'xml' !== $file_type && isset( $export_format[ $file_type ] ) ) {
classes/helpers/FrmAppHelper.php CHANGED
@@ -11,7 +11,7 @@ class FrmAppHelper {
11
  /**
12
  * @since 2.0
13
  */
14
- public static $plug_version = '3.03.01';
15
 
16
  /**
17
  * @since 1.07.02
@@ -266,12 +266,14 @@ class FrmAppHelper {
266
  }
267
  self::sanitize_value( $sanitize, $value );
268
  } else {
269
- $value = self::get_simple_request( array(
270
- 'type' => $src,
271
- 'param' => $param,
272
- 'default' => $default,
273
- 'sanitize' => $sanitize,
274
- ) );
 
 
275
  }
276
 
277
  if ( isset( $params ) && is_array( $value ) && ! empty( $value ) ) {
@@ -289,12 +291,14 @@ class FrmAppHelper {
289
  }
290
 
291
  public static function get_post_param( $param, $default = '', $sanitize = '' ) {
292
- return self::get_simple_request( array(
293
- 'type' => 'post',
294
- 'param' => $param,
295
- 'default' => $default,
296
- 'sanitize' => $sanitize,
297
- ) );
 
 
298
  }
299
 
300
  /**
@@ -306,12 +310,14 @@ class FrmAppHelper {
306
  * @return string|array
307
  */
308
  public static function simple_get( $param, $sanitize = 'sanitize_text_field', $default = '' ) {
309
- return self::get_simple_request( array(
310
- 'type' => 'get',
311
- 'param' => $param,
312
- 'default' => $default,
313
- 'sanitize' => $sanitize,
314
- ) );
 
 
315
  }
316
 
317
  /**
@@ -446,6 +452,7 @@ class FrmAppHelper {
446
  'abbr' => array(
447
  'title' => array(),
448
  ),
 
449
  'b' => array(),
450
  'blockquote' => array(
451
  'cite' => array(),
@@ -580,10 +587,13 @@ class FrmAppHelper {
580
  * @since 3.0
581
  */
582
  public static function save_combined_js() {
583
- $file_atts = apply_filters( 'frm_js_location', array(
584
- 'file_name' => 'frm.min.js',
585
- 'new_file_path' => FrmAppHelper::plugin_path() . '/js',
586
- ) );
 
 
 
587
  $new_file = new FrmCreateFile( $file_atts );
588
 
589
  $files = array(
@@ -619,13 +629,14 @@ class FrmAppHelper {
619
  }
620
 
621
  public static function get_pages() {
622
- return get_posts( array(
623
  'post_type' => 'page',
624
  'post_status' => array( 'publish', 'private' ),
625
  'numberposts' => -1,
626
  'orderby' => 'title',
627
  'order' => 'ASC',
628
- ) );
 
629
  }
630
 
631
  public static function wp_pages_dropdown( $field_name, $page_id, $truncate = false ) {
@@ -983,19 +994,27 @@ class FrmAppHelper {
983
  $key = $key . 'a';
984
  }
985
 
986
- $key_check = FrmDb::get_var( $table_name, array(
987
- $column => $key,
988
- 'ID !' => $id,
989
- ), $column );
 
 
 
 
990
 
991
  if ( $key_check || is_numeric( $key_check ) ) {
992
  $suffix = 2;
993
  do {
994
  $alt_post_name = substr( $key, 0, 200 - ( strlen( $suffix ) + 1 ) ) . $suffix;
995
- $key_check = FrmDb::get_var( $table_name, array(
996
- $column => $alt_post_name,
997
- 'ID !' => $id,
998
- ), $column );
 
 
 
 
999
  $suffix++;
1000
  } while ( $key_check || is_numeric( $key_check ) );
1001
  $key = $alt_post_name;
@@ -1063,12 +1082,17 @@ class FrmAppHelper {
1063
  if ( ! isset( $field->field_options['custom_field'] ) ) {
1064
  $field->field_options['custom_field'] = '';
1065
  }
1066
- $meta_value = FrmProEntryMetaHelper::get_post_value( $record->post_id, $field->field_options['post_field'], $field->field_options['custom_field'], array(
1067
- 'truncate' => false,
1068
- 'type' => $field->type,
1069
- 'form_id' => $field->form_id,
1070
- 'field' => $field,
1071
- ) );
 
 
 
 
 
1072
  } else {
1073
  $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
1074
  }
@@ -1577,13 +1601,14 @@ class FrmAppHelper {
1577
  $version = FrmAppHelper::plugin_version();
1578
  wp_register_script( 'formidable_admin_global', FrmAppHelper::plugin_url() . '/js/formidable_admin_global.js', array( 'jquery' ), $version );
1579
 
1580
- wp_localize_script( 'formidable_admin_global', 'frmGlobal', array(
1581
  'updating_msg' => __( 'Please wait while your site updates.', 'formidable' ),
1582
  'deauthorize' => __( 'Are you sure you want to deauthorize Formidable Forms on this site?', 'formidable' ),
1583
  'url' => FrmAppHelper::plugin_url(),
1584
  'loading' => __( 'Loading&hellip;' ),
1585
  'nonce' => wp_create_nonce( 'frm_ajax' ),
1586
- ) );
 
1587
 
1588
  if ( $load ) {
1589
  wp_enqueue_script( 'formidable_admin_global' );
@@ -1604,7 +1629,7 @@ class FrmAppHelper {
1604
  $ajax_url = admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
1605
  $ajax_url = apply_filters( 'frm_ajax_url', $ajax_url );
1606
 
1607
- wp_localize_script( 'formidable', 'frm_js', array(
1608
  'ajax_url' => $ajax_url,
1609
  'images_url' => self::plugin_url() . '/images',
1610
  'loading' => __( 'Loading&hellip;' ),
@@ -1616,11 +1641,12 @@ class FrmAppHelper {
1616
  'file_spam' => __( 'That file looks like Spam.', 'formidable' ),
1617
  'calc_error' => __( 'There is an error in the calculation in the field with key', 'formidable' ),
1618
  'empty_fields' => __( 'Please complete the preceding required fields before uploading a file.', 'formidable' ),
1619
- ) );
 
1620
 
1621
  if ( $location == 'admin' ) {
1622
  $frm_settings = self::get_settings();
1623
- wp_localize_script( 'formidable_admin', 'frm_admin_js', array(
1624
  'confirm_uninstall' => __( 'Are you sure you want to do this? Clicking OK will delete all forms, form data, and all other Formidable data. There is no Undo.', 'formidable' ),
1625
  'desc' => __( '(Click to add description)', 'formidable' ),
1626
  'blank' => __( '(Blank)', 'formidable' ),
@@ -1656,7 +1682,8 @@ class FrmAppHelper {
1656
  'view_shortcodes' => __( 'This calculation may have shortcodes that work in Views but not forms.', 'formidable' ),
1657
  'text_shortcodes' => __( 'This calculation may have shortcodes that work in text calculations but not numeric calculations.', 'formidable' ),
1658
  'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ),
1659
- ) );
 
1660
  }
1661
  }
1662
 
11
  /**
12
  * @since 2.0
13
  */
14
+ public static $plug_version = '3.03.02';
15
 
16
  /**
17
  * @since 1.07.02
266
  }
267
  self::sanitize_value( $sanitize, $value );
268
  } else {
269
+ $value = self::get_simple_request(
270
+ array(
271
+ 'type' => $src,
272
+ 'param' => $param,
273
+ 'default' => $default,
274
+ 'sanitize' => $sanitize,
275
+ )
276
+ );
277
  }
278
 
279
  if ( isset( $params ) && is_array( $value ) && ! empty( $value ) ) {
291
  }
292
 
293
  public static function get_post_param( $param, $default = '', $sanitize = '' ) {
294
+ return self::get_simple_request(
295
+ array(
296
+ 'type' => 'post',
297
+ 'param' => $param,
298
+ 'default' => $default,
299
+ 'sanitize' => $sanitize,
300
+ )
301
+ );
302
  }
303
 
304
  /**
310
  * @return string|array
311
  */
312
  public static function simple_get( $param, $sanitize = 'sanitize_text_field', $default = '' ) {
313
+ return self::get_simple_request(
314
+ array(
315
+ 'type' => 'get',
316
+ 'param' => $param,
317
+ 'default' => $default,
318
+ 'sanitize' => $sanitize,
319
+ )
320
+ );
321
  }
322
 
323
  /**
452
  'abbr' => array(
453
  'title' => array(),
454
  ),
455
+ 'aside' => $allow_class,
456
  'b' => array(),
457
  'blockquote' => array(
458
  'cite' => array(),
587
  * @since 3.0
588
  */
589
  public static function save_combined_js() {
590
+ $file_atts = apply_filters(
591
+ 'frm_js_location',
592
+ array(
593
+ 'file_name' => 'frm.min.js',
594
+ 'new_file_path' => FrmAppHelper::plugin_path() . '/js',
595
+ )
596
+ );
597
  $new_file = new FrmCreateFile( $file_atts );
598
 
599
  $files = array(
629
  }
630
 
631
  public static function get_pages() {
632
+ $query = array(
633
  'post_type' => 'page',
634
  'post_status' => array( 'publish', 'private' ),
635
  'numberposts' => -1,
636
  'orderby' => 'title',
637
  'order' => 'ASC',
638
+ );
639
+ return get_posts( $query );
640
  }
641
 
642
  public static function wp_pages_dropdown( $field_name, $page_id, $truncate = false ) {
994
  $key = $key . 'a';
995
  }
996
 
997
+ $key_check = FrmDb::get_var(
998
+ $table_name,
999
+ array(
1000
+ $column => $key,
1001
+ 'ID !' => $id,
1002
+ ),
1003
+ $column
1004
+ );
1005
 
1006
  if ( $key_check || is_numeric( $key_check ) ) {
1007
  $suffix = 2;
1008
  do {
1009
  $alt_post_name = substr( $key, 0, 200 - ( strlen( $suffix ) + 1 ) ) . $suffix;
1010
+ $key_check = FrmDb::get_var(
1011
+ $table_name,
1012
+ array(
1013
+ $column => $alt_post_name,
1014
+ 'ID !' => $id,
1015
+ ),
1016
+ $column
1017
+ );
1018
  $suffix++;
1019
  } while ( $key_check || is_numeric( $key_check ) );
1020
  $key = $alt_post_name;
1082
  if ( ! isset( $field->field_options['custom_field'] ) ) {
1083
  $field->field_options['custom_field'] = '';
1084
  }
1085
+ $meta_value = FrmProEntryMetaHelper::get_post_value(
1086
+ $record->post_id,
1087
+ $field->field_options['post_field'],
1088
+ $field->field_options['custom_field'],
1089
+ array(
1090
+ 'truncate' => false,
1091
+ 'type' => $field->type,
1092
+ 'form_id' => $field->form_id,
1093
+ 'field' => $field,
1094
+ )
1095
+ );
1096
  } else {
1097
  $meta_value = FrmEntryMeta::get_meta_value( $record, $field->id );
1098
  }
1601
  $version = FrmAppHelper::plugin_version();
1602
  wp_register_script( 'formidable_admin_global', FrmAppHelper::plugin_url() . '/js/formidable_admin_global.js', array( 'jquery' ), $version );
1603
 
1604
+ $global_strings = array(
1605
  'updating_msg' => __( 'Please wait while your site updates.', 'formidable' ),
1606
  'deauthorize' => __( 'Are you sure you want to deauthorize Formidable Forms on this site?', 'formidable' ),
1607
  'url' => FrmAppHelper::plugin_url(),
1608
  'loading' => __( 'Loading&hellip;' ),
1609
  'nonce' => wp_create_nonce( 'frm_ajax' ),
1610
+ );
1611
+ wp_localize_script( 'formidable_admin_global', 'frmGlobal', $global_strings );
1612
 
1613
  if ( $load ) {
1614
  wp_enqueue_script( 'formidable_admin_global' );
1629
  $ajax_url = admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' );
1630
  $ajax_url = apply_filters( 'frm_ajax_url', $ajax_url );
1631
 
1632
+ $script_strings = array(
1633
  'ajax_url' => $ajax_url,
1634
  'images_url' => self::plugin_url() . '/images',
1635
  'loading' => __( 'Loading&hellip;' ),
1641
  'file_spam' => __( 'That file looks like Spam.', 'formidable' ),
1642
  'calc_error' => __( 'There is an error in the calculation in the field with key', 'formidable' ),
1643
  'empty_fields' => __( 'Please complete the preceding required fields before uploading a file.', 'formidable' ),
1644
+ );
1645
+ wp_localize_script( 'formidable', 'frm_js', $script_strings );
1646
 
1647
  if ( $location == 'admin' ) {
1648
  $frm_settings = self::get_settings();
1649
+ $admin_script_strings = array(
1650
  'confirm_uninstall' => __( 'Are you sure you want to do this? Clicking OK will delete all forms, form data, and all other Formidable data. There is no Undo.', 'formidable' ),
1651
  'desc' => __( '(Click to add description)', 'formidable' ),
1652
  'blank' => __( '(Blank)', 'formidable' ),
1682
  'view_shortcodes' => __( 'This calculation may have shortcodes that work in Views but not forms.', 'formidable' ),
1683
  'text_shortcodes' => __( 'This calculation may have shortcodes that work in text calculations but not numeric calculations.', 'formidable' ),
1684
  'repeat_limit_min' => __( 'Please enter a Repeat Limit that is greater than 1.', 'formidable' ),
1685
+ );
1686
+ wp_localize_script( 'formidable_admin', 'frm_admin_js', $admin_script_strings );
1687
  }
1688
  }
1689
 
classes/helpers/FrmCSVExportHelper.php CHANGED
@@ -83,10 +83,13 @@ class FrmCSVExportHelper {
83
  header( 'Cache-Control: no-cache, must-revalidate' );
84
  header( 'Pragma: no-cache' );
85
 
86
- do_action( 'frm_csv_headers', array(
87
- 'form_id' => self::$form_id,
88
- 'fields' => self::$fields,
89
- ) );
 
 
 
90
  }
91
 
92
  public static function get_csv_format() {
@@ -98,9 +101,14 @@ class FrmCSVExportHelper {
98
  private static function prepare_csv_headings() {
99
  $headings = array();
100
  self::csv_headings( $headings );
101
- $headings = apply_filters( 'frm_csv_columns', $headings, self::$form_id, array(
102
- 'fields' => self::$fields,
103
- ) );
 
 
 
 
 
104
  self::$headings = $headings;
105
 
106
  self::print_csv_row( $headings );
@@ -114,9 +122,13 @@ class FrmCSVExportHelper {
114
  }
115
 
116
  $field_headings[ $col->id ] = strip_tags( $col->name );
117
- $field_headings = apply_filters( 'frm_csv_field_columns', $field_headings, array(
118
- 'field' => $col,
119
- ) );
 
 
 
 
120
  $headings += $field_headings;
121
  }
122
 
@@ -171,11 +183,15 @@ class FrmCSVExportHelper {
171
  $row = array();
172
  self::add_field_values_to_csv( $row );
173
  self::add_entry_data_to_csv( $row );
174
- $row = apply_filters( 'frm_csv_row', $row, array(
175
- 'entry' => self::$entry,
176
- 'date_format' => self::$wp_date_format,
177
- 'comment_count' => self::$comment_count,
178
- ) );
 
 
 
 
179
  self::print_csv_row( $row );
180
  }
181
 
@@ -217,21 +233,29 @@ class FrmCSVExportHelper {
217
  $field_value = maybe_unserialize( $field_value );
218
  self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
219
 
220
- $field_value = apply_filters( 'frm_csv_value', $field_value, array(
221
- 'field' => $col,
222
- 'entry' => self::$entry,
223
- 'separator' => self::$separator,
224
- ) );
 
 
 
 
225
 
226
  if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] ) {
227
- $sep_value = FrmEntriesHelper::display_value( $field_value, $col, array(
228
- 'type' => $col->type,
229
- 'post_id' => self::$entry->post_id,
230
- 'show_icon' => false,
231
- 'entry_id' => self::$entry->id,
232
- 'sep' => self::$separator,
233
- 'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
234
- ) );
 
 
 
 
235
  $row[ $col->id . '_label' ] = $sep_value;
236
  unset( $sep_value );
237
  }
83
  header( 'Cache-Control: no-cache, must-revalidate' );
84
  header( 'Pragma: no-cache' );
85
 
86
+ do_action(
87
+ 'frm_csv_headers',
88
+ array(
89
+ 'form_id' => self::$form_id,
90
+ 'fields' => self::$fields,
91
+ )
92
+ );
93
  }
94
 
95
  public static function get_csv_format() {
101
  private static function prepare_csv_headings() {
102
  $headings = array();
103
  self::csv_headings( $headings );
104
+ $headings = apply_filters(
105
+ 'frm_csv_columns',
106
+ $headings,
107
+ self::$form_id,
108
+ array(
109
+ 'fields' => self::$fields,
110
+ )
111
+ );
112
  self::$headings = $headings;
113
 
114
  self::print_csv_row( $headings );
122
  }
123
 
124
  $field_headings[ $col->id ] = strip_tags( $col->name );
125
+ $field_headings = apply_filters(
126
+ 'frm_csv_field_columns',
127
+ $field_headings,
128
+ array(
129
+ 'field' => $col,
130
+ )
131
+ );
132
  $headings += $field_headings;
133
  }
134
 
183
  $row = array();
184
  self::add_field_values_to_csv( $row );
185
  self::add_entry_data_to_csv( $row );
186
+ $row = apply_filters(
187
+ 'frm_csv_row',
188
+ $row,
189
+ array(
190
+ 'entry' => self::$entry,
191
+ 'date_format' => self::$wp_date_format,
192
+ 'comment_count' => self::$comment_count,
193
+ )
194
+ );
195
  self::print_csv_row( $row );
196
  }
197
 
233
  $field_value = maybe_unserialize( $field_value );
234
  self::add_array_values_to_columns( $row, compact( 'col', 'field_value' ) );
235
 
236
+ $field_value = apply_filters(
237
+ 'frm_csv_value',
238
+ $field_value,
239
+ array(
240
+ 'field' => $col,
241
+ 'entry' => self::$entry,
242
+ 'separator' => self::$separator,
243
+ )
244
+ );
245
 
246
  if ( isset( $col->field_options['separate_value'] ) && $col->field_options['separate_value'] ) {
247
+ $sep_value = FrmEntriesHelper::display_value(
248
+ $field_value,
249
+ $col,
250
+ array(
251
+ 'type' => $col->type,
252
+ 'post_id' => self::$entry->post_id,
253
+ 'show_icon' => false,
254
+ 'entry_id' => self::$entry->id,
255
+ 'sep' => self::$separator,
256
+ 'embedded_field_id' => ( isset( self::$entry->embedded_fields ) && isset( self::$entry->embedded_fields[ self::$entry->id ] ) ) ? 'form' . self::$entry->embedded_fields[ self::$entry->id ] : 0,
257
+ )
258
+ );
259
  $row[ $col->id . '_label' ] = $sep_value;
260
  unset( $sep_value );
261
  }
classes/helpers/FrmEntriesListHelper.php CHANGED
@@ -25,10 +25,12 @@ class FrmEntriesListHelper extends FrmListHelper {
25
  $join_form_in_query = true;
26
  }
27
 
28
- $s = self::get_param( array(
29
- 'param' => 's',
30
- 'sanitize' => 'sanitize_text_field',
31
- ) );
 
 
32
 
33
  if ( $s != '' && FrmAppHelper::pro_is_installed() ) {
34
  $fid = self::get_param( array( 'param' => 'fid' ) );
@@ -37,43 +39,53 @@ class FrmEntriesListHelper extends FrmListHelper {
37
 
38
  $s_query = apply_filters( 'frm_entries_list_query', $s_query, compact( 'form_id' ) );
39
 
40
- $orderby = self::get_param( array(
41
- 'param' => 'orderby',
42
- 'default' => 'id',
43
- ) );
 
 
44
 
45
  if ( strpos( $orderby, 'meta' ) !== false ) {
46
  $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
47
  $orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
48
  }
49
 
50
- $order = self::get_param( array(
51
- 'param' => 'order',
52
- 'default' => 'DESC',
53
- ) );
 
 
54
  $order = FrmDb::esc_order( $orderby . ' ' . $order );
55
 
56
  $page = $this->get_pagenum();
57
- $start = (int) self::get_param( array(
58
- 'param' => 'start',
59
- 'default' => ( $page - 1 ) * $per_page,
60
- ) );
 
 
61
 
62
  $limit = FrmDb::esc_limit( $start . ',' . $per_page );
63
  $this->items = FrmEntry::getAll( $s_query, $order, $limit, true, $join_form_in_query );
64
  $total_items = FrmEntry::getRecordCount( $s_query );
65
 
66
- $this->set_pagination_args( array(
67
- 'total_items' => $total_items,
68
- 'per_page' => $per_page,
69
- ) );
 
 
70
  }
71
 
72
  public function no_items() {
73
- $s = self::get_param( array(
74
- 'param' => 's',
75
- 'sanitize' => 'sanitize_text_field',
76
- ) );
 
 
77
  if ( ! empty( $s ) ) {
78
  esc_html_e( 'No Entries Found', 'formidable' );
79
  return;
25
  $join_form_in_query = true;
26
  }
27
 
28
+ $s = self::get_param(
29
+ array(
30
+ 'param' => 's',
31
+ 'sanitize' => 'sanitize_text_field',
32
+ )
33
+ );
34
 
35
  if ( $s != '' && FrmAppHelper::pro_is_installed() ) {
36
  $fid = self::get_param( array( 'param' => 'fid' ) );
39
 
40
  $s_query = apply_filters( 'frm_entries_list_query', $s_query, compact( 'form_id' ) );
41
 
42
+ $orderby = self::get_param(
43
+ array(
44
+ 'param' => 'orderby',
45
+ 'default' => 'id',
46
+ )
47
+ );
48
 
49
  if ( strpos( $orderby, 'meta' ) !== false ) {
50
  $order_field_type = FrmField::get_type( str_replace( 'meta_', '', $orderby ) );
51
  $orderby .= in_array( $order_field_type, array( 'number', 'scale', 'star' ) ) ? '+0' : '';
52
  }
53
 
54
+ $order = self::get_param(
55
+ array(
56
+ 'param' => 'order',
57
+ 'default' => 'DESC',
58
+ )
59
+ );
60
  $order = FrmDb::esc_order( $orderby . ' ' . $order );
61
 
62
  $page = $this->get_pagenum();
63
+ $start = (int) self::get_param(
64
+ array(
65
+ 'param' => 'start',
66
+ 'default' => ( $page - 1 ) * $per_page,
67
+ )
68
+ );
69
 
70
  $limit = FrmDb::esc_limit( $start . ',' . $per_page );
71
  $this->items = FrmEntry::getAll( $s_query, $order, $limit, true, $join_form_in_query );
72
  $total_items = FrmEntry::getRecordCount( $s_query );
73
 
74
+ $this->set_pagination_args(
75
+ array(
76
+ 'total_items' => $total_items,
77
+ 'per_page' => $per_page,
78
+ )
79
+ );
80
  }
81
 
82
  public function no_items() {
83
+ $s = self::get_param(
84
+ array(
85
+ 'param' => 's',
86
+ 'sanitize' => 'sanitize_text_field',
87
+ )
88
+ );
89
  if ( ! empty( $s ) ) {
90
  esc_html_e( 'No Entries Found', 'formidable' );
91
  return;
classes/helpers/FrmFieldsHelper.php CHANGED
@@ -585,10 +585,12 @@ class FrmFieldsHelper {
585
  return FrmProDisplaysHelper::get_shortcodes( $content, $form_id );
586
  }
587
 
588
- $fields = FrmField::getAll( array(
589
- 'fi.form_id' => (int) $form_id,
590
- 'fi.type not' => FrmField::no_save_fields(),
591
- ) );
 
 
592
 
593
  $tagregexp = self::allowed_shortcodes( $fields );
594
 
@@ -1060,12 +1062,14 @@ class FrmFieldsHelper {
1060
  }
1061
 
1062
  // Get text for "other" text field
1063
- $other_args['value'] = self::get_other_val( array(
1064
- 'opt_key' => $args['opt_key'],
1065
- 'field' => $args['field'],
1066
- 'parent' => $parent,
1067
- 'pointer' => $pointer,
1068
- ) );
 
 
1069
  }
1070
 
1071
  /**
@@ -1205,7 +1209,7 @@ class FrmFieldsHelper {
1205
  }
1206
 
1207
  public static function get_us_states() {
1208
- return apply_filters( 'frm_us_states', array(
1209
  'AL' => 'Alabama',
1210
  'AK' => 'Alaska',
1211
  'AR' => 'Arkansas',
@@ -1257,7 +1261,8 @@ class FrmFieldsHelper {
1257
  'WV' => 'West Virginia',
1258
  'WI' => 'Wisconsin',
1259
  'WY' => 'Wyoming',
1260
- ) );
 
1261
  }
1262
 
1263
  public static function get_countries() {
585
  return FrmProDisplaysHelper::get_shortcodes( $content, $form_id );
586
  }
587
 
588
+ $fields = FrmField::getAll(
589
+ array(
590
+ 'fi.form_id' => (int) $form_id,
591
+ 'fi.type not' => FrmField::no_save_fields(),
592
+ )
593
+ );
594
 
595
  $tagregexp = self::allowed_shortcodes( $fields );
596
 
1062
  }
1063
 
1064
  // Get text for "other" text field
1065
+ $other_args['value'] = self::get_other_val(
1066
+ array(
1067
+ 'opt_key' => $args['opt_key'],
1068
+ 'field' => $args['field'],
1069
+ 'parent' => $parent,
1070
+ 'pointer' => $pointer,
1071
+ )
1072
+ );
1073
  }
1074
 
1075
  /**
1209
  }
1210
 
1211
  public static function get_us_states() {
1212
+ $states = array(
1213
  'AL' => 'Alabama',
1214
  'AK' => 'Alaska',
1215
  'AR' => 'Arkansas',
1261
  'WV' => 'West Virginia',
1262
  'WI' => 'Wisconsin',
1263
  'WY' => 'Wyoming',
1264
+ );
1265
+ return apply_filters( 'frm_us_states', $states );
1266
  }
1267
 
1268
  public static function get_countries() {
classes/helpers/FrmFormsHelper.php CHANGED
@@ -638,11 +638,13 @@ BEFORE_HTML;
638
  $show_img = true;
639
  }
640
 
641
- self::show_error( array(
642
- 'img' => $args['img'],
643
- 'errors' => $args['errors'],
644
- 'show_img' => $show_img,
645
- ) );
 
 
646
  }
647
 
648
  /**
638
  $show_img = true;
639
  }
640
 
641
+ self::show_error(
642
+ array(
643
+ 'img' => $args['img'],
644
+ 'errors' => $args['errors'],
645
+ 'show_img' => $show_img,
646
+ )
647
+ );
648
  }
649
 
650
  /**
classes/helpers/FrmFormsListHelper.php CHANGED
@@ -18,22 +18,30 @@ class FrmFormsListHelper extends FrmListHelper {
18
  $page = $this->get_pagenum();
19
  $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
20
 
21
- $mode = self::get_param( array(
22
- 'param' => 'mode',
23
- 'default' => 'list',
24
- ) );
25
- $orderby = self::get_param( array(
26
- 'param' => 'orderby',
27
- 'default' => 'name',
28
- ) );
29
- $order = self::get_param( array(
30
- 'param' => 'order',
31
- 'default' => 'ASC',
32
- ) );
33
- $start = self::get_param( array(
34
- 'param' => 'start',
35
- 'default' => ( $page - 1 ) * $per_page,
36
- ) );
 
 
 
 
 
 
 
 
37
 
38
  $s_query = array(
39
  array(
@@ -60,10 +68,12 @@ class FrmFormsListHelper extends FrmListHelper {
60
  break;
61
  }
62
 
63
- $s = self::get_param( array(
64
- 'param' => 's',
65
- 'sanitize' => 'sanitize_text_field',
66
- ) );
 
 
67
  if ( $s != '' ) {
68
  preg_match_all( '/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches );
69
  $search_terms = array_map( 'trim', $matches[0] );
@@ -81,10 +91,12 @@ class FrmFormsListHelper extends FrmListHelper {
81
  $this->items = FrmForm::getAll( $s_query, $orderby . ' ' . $order, $start . ',' . $per_page );
82
  $total_items = FrmDb::get_count( 'frm_forms', $s_query );
83
 
84
- $this->set_pagination_args( array(
85
- 'total_items' => $total_items,
86
- 'per_page' => $per_page,
87
- ) );
 
 
88
  }
89
 
90
  public function no_items() {
@@ -182,10 +194,12 @@ class FrmFormsListHelper extends FrmListHelper {
182
 
183
  $links = array();
184
  $counts = FrmForm::get_count();
185
- $form_type = self::get_param( array(
186
- 'param' => 'form_type',
187
- 'default' => 'published',
188
- ) );
 
 
189
 
190
  foreach ( $statuses as $status => $name ) {
191
 
18
  $page = $this->get_pagenum();
19
  $per_page = $this->get_items_per_page( 'formidable_page_formidable_per_page' );
20
 
21
+ $mode = self::get_param(
22
+ array(
23
+ 'param' => 'mode',
24
+ 'default' => 'list',
25
+ )
26
+ );
27
+ $orderby = self::get_param(
28
+ array(
29
+ 'param' => 'orderby',
30
+ 'default' => 'name',
31
+ )
32
+ );
33
+ $order = self::get_param(
34
+ array(
35
+ 'param' => 'order',
36
+ 'default' => 'ASC',
37
+ )
38
+ );
39
+ $start = self::get_param(
40
+ array(
41
+ 'param' => 'start',
42
+ 'default' => ( $page - 1 ) * $per_page,
43
+ )
44
+ );
45
 
46
  $s_query = array(
47
  array(
68
  break;
69
  }
70
 
71
+ $s = self::get_param(
72
+ array(
73
+ 'param' => 's',
74
+ 'sanitize' => 'sanitize_text_field',
75
+ )
76
+ );
77
  if ( $s != '' ) {
78
  preg_match_all( '/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches );
79
  $search_terms = array_map( 'trim', $matches[0] );
91
  $this->items = FrmForm::getAll( $s_query, $orderby . ' ' . $order, $start . ',' . $per_page );
92
  $total_items = FrmDb::get_count( 'frm_forms', $s_query );
93
 
94
+ $this->set_pagination_args(
95
+ array(
96
+ 'total_items' => $total_items,
97
+ 'per_page' => $per_page,
98
+ )
99
+ );
100
  }
101
 
102
  public function no_items() {
194
 
195
  $links = array();
196
  $counts = FrmForm::get_count();
197
+ $form_type = self::get_param(
198
+ array(
199
+ 'param' => 'form_type',
200
+ 'default' => 'published',
201
+ )
202
+ );
203
 
204
  foreach ( $statuses as $status => $name ) {
205
 
classes/helpers/FrmListHelper.php CHANGED
@@ -87,13 +87,16 @@ class FrmListHelper {
87
  * Construct the table object
88
  */
89
  public function __construct( $args ) {
90
- $args = wp_parse_args( $args, array(
91
- 'params' => array(),
92
- 'plural' => '',
93
- 'singular' => '',
94
- 'ajax' => false,
95
- 'screen' => null,
96
- ) );
 
 
 
97
 
98
  $this->params = $args['params'];
99
 
@@ -153,12 +156,14 @@ class FrmListHelper {
153
  * @since 3.0
154
  */
155
  protected function get_param( $args ) {
156
- return FrmAppHelper::get_simple_request( array(
157
- 'param' => $args['param'],
158
- 'default' => isset( $args['default'] ) ? $args['default'] : '',
159
- 'sanitize' => isset( $args['sanitize'] ) ? $args['sanitize'] : 'sanitize_title',
160
- 'type' => 'request',
161
- ) );
 
 
162
  }
163
 
164
  /**
@@ -170,11 +175,14 @@ class FrmListHelper {
170
  * @param array|string $args
171
  */
172
  protected function set_pagination_args( $args ) {
173
- $args = wp_parse_args( $args, array(
174
- 'total_items' => 0,
175
- 'total_pages' => 0,
176
- 'per_page' => 0,
177
- ) );
 
 
 
178
 
179
  if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
180
  $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
@@ -399,10 +407,12 @@ class FrmListHelper {
399
 
400
  private static function get_bulk_action( $action_name ) {
401
  $action = false;
402
- $action_param = self::get_param( array(
403
- 'param' => $action_name,
404
- 'sanitize' => 'sanitize_text_field',
405
- ) );
 
 
406
  if ( $action_param && -1 != $action_param ) {
407
  $action = $action_param;
408
  }
@@ -552,25 +562,30 @@ class FrmListHelper {
552
 
553
  $disable = $this->disabled_pages( $total_pages );
554
 
555
- $page_links[] = $this->add_page_link( array(
556
- 'page' => 'first',
557
- 'arrow' => '&laquo;',
558
- 'number' => '',
559
- 'disabled' => $disable['first'],
560
- ) );
 
 
561
 
562
- $page_links[] = $this->add_page_link( array(
563
- 'page' => 'prev',
564
- 'arrow' => '&lsaquo;',
565
- 'number' => max( 1, $current - 1 ),
566
- 'disabled' => $disable['prev'],
567
- ) );
 
 
568
 
569
  if ( 'bottom' == $which ) {
570
  $html_current_page = $current;
571
  $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
572
  } else {
573
- $html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
 
574
  '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
575
  $current,
576
  strlen( $total_pages )
@@ -579,19 +594,23 @@ class FrmListHelper {
579
  $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
580
  $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
581
 
582
- $page_links[] = $this->add_page_link( array(
583
- 'page' => 'next',
584
- 'arrow' => '&rsaquo;',
585
- 'number' => min( $total_pages, $current + 1 ),
586
- 'disabled' => $disable['next'],
587
- ) );
 
 
588
 
589
- $page_links[] = $this->add_page_link( array(
590
- 'page' => 'last',
591
- 'arrow' => '&raquo;',
592
- 'number' => $total_pages,
593
- 'disabled' => $disable['last'],
594
- ) );
 
 
595
 
596
  $pagination_links_class = 'pagination-links';
597
  if ( ! empty( $infinite_scroll ) ) {
@@ -669,7 +688,10 @@ class FrmListHelper {
669
  $label = $this->link_label( $atts['page'] );
670
  return sprintf(
671
  "<a class='%s-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
672
- $atts['page'], $url, $label, $atts['arrow']
 
 
 
673
  );
674
  }
675
 
87
  * Construct the table object
88
  */
89
  public function __construct( $args ) {
90
+ $args = wp_parse_args(
91
+ $args,
92
+ array(
93
+ 'params' => array(),
94
+ 'plural' => '',
95
+ 'singular' => '',
96
+ 'ajax' => false,
97
+ 'screen' => null,
98
+ )
99
+ );
100
 
101
  $this->params = $args['params'];
102
 
156
  * @since 3.0
157
  */
158
  protected function get_param( $args ) {
159
+ return FrmAppHelper::get_simple_request(
160
+ array(
161
+ 'param' => $args['param'],
162
+ 'default' => isset( $args['default'] ) ? $args['default'] : '',
163
+ 'sanitize' => isset( $args['sanitize'] ) ? $args['sanitize'] : 'sanitize_title',
164
+ 'type' => 'request',
165
+ )
166
+ );
167
  }
168
 
169
  /**
175
  * @param array|string $args
176
  */
177
  protected function set_pagination_args( $args ) {
178
+ $args = wp_parse_args(
179
+ $args,
180
+ array(
181
+ 'total_items' => 0,
182
+ 'total_pages' => 0,
183
+ 'per_page' => 0,
184
+ )
185
+ );
186
 
187
  if ( ! $args['total_pages'] && $args['per_page'] > 0 ) {
188
  $args['total_pages'] = ceil( $args['total_items'] / $args['per_page'] );
407
 
408
  private static function get_bulk_action( $action_name ) {
409
  $action = false;
410
+ $action_param = self::get_param(
411
+ array(
412
+ 'param' => $action_name,
413
+ 'sanitize' => 'sanitize_text_field',
414
+ )
415
+ );
416
  if ( $action_param && -1 != $action_param ) {
417
  $action = $action_param;
418
  }
562
 
563
  $disable = $this->disabled_pages( $total_pages );
564
 
565
+ $page_links[] = $this->add_page_link(
566
+ array(
567
+ 'page' => 'first',
568
+ 'arrow' => '&laquo;',
569
+ 'number' => '',
570
+ 'disabled' => $disable['first'],
571
+ )
572
+ );
573
 
574
+ $page_links[] = $this->add_page_link(
575
+ array(
576
+ 'page' => 'prev',
577
+ 'arrow' => '&lsaquo;',
578
+ 'number' => max( 1, $current - 1 ),
579
+ 'disabled' => $disable['prev'],
580
+ )
581
+ );
582
 
583
  if ( 'bottom' == $which ) {
584
  $html_current_page = $current;
585
  $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
586
  } else {
587
+ $html_current_page = sprintf(
588
+ "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
589
  '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
590
  $current,
591
  strlen( $total_pages )
594
  $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
595
  $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
596
 
597
+ $page_links[] = $this->add_page_link(
598
+ array(
599
+ 'page' => 'next',
600
+ 'arrow' => '&rsaquo;',
601
+ 'number' => min( $total_pages, $current + 1 ),
602
+ 'disabled' => $disable['next'],
603
+ )
604
+ );
605
 
606
+ $page_links[] = $this->add_page_link(
607
+ array(
608
+ 'page' => 'last',
609
+ 'arrow' => '&raquo;',
610
+ 'number' => $total_pages,
611
+ 'disabled' => $disable['last'],
612
+ )
613
+ );
614
 
615
  $pagination_links_class = 'pagination-links';
616
  if ( ! empty( $infinite_scroll ) ) {
688
  $label = $this->link_label( $atts['page'] );
689
  return sprintf(
690
  "<a class='%s-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
691
+ $atts['page'],
692
+ $url,
693
+ $label,
694
+ $atts['arrow']
695
  );
696
  }
697
 
classes/helpers/FrmShortcodeHelper.php CHANGED
@@ -37,11 +37,14 @@ class FrmShortcodeHelper {
37
  * @return string
38
  */
39
  public static function get_shortcode_tag( $shortcodes, $short_key, $args = array() ) {
40
- $args = wp_parse_args( $args, array(
41
- 'conditional' => false,
42
- 'conditional_check' => false,
43
- 'foreach' => false,
44
- ) );
 
 
 
45
  if ( ( $args['conditional'] || $args['foreach'] ) && ! $args['conditional_check'] ) {
46
  $args['conditional_check'] = true;
47
  }
37
  * @return string
38
  */
39
  public static function get_shortcode_tag( $shortcodes, $short_key, $args = array() ) {
40
+ $args = wp_parse_args(
41
+ $args,
42
+ array(
43
+ 'conditional' => false,
44
+ 'conditional_check' => false,
45
+ 'foreach' => false,
46
+ )
47
+ );
48
  if ( ( $args['conditional'] || $args['foreach'] ) && ! $args['conditional_check'] ) {
49
  $args['conditional_check'] = true;
50
  }
classes/helpers/FrmXMLHelper.php CHANGED
@@ -91,11 +91,15 @@ class FrmXMLHelper {
91
 
92
  $parent = self::get_term_parent_id( $t );
93
 
94
- $term = wp_insert_term( (string) $t->term_name, (string) $t->term_taxonomy, array(
95
- 'slug' => (string) $t->term_slug,
96
- 'description' => (string) $t->term_description,
97
- 'parent' => empty( $parent ) ? 0 : $parent,
98
- ));
 
 
 
 
99
 
100
  if ( $term && is_array( $term ) ) {
101
  $imported['imported']['terms']++;
@@ -975,12 +979,14 @@ class FrmXMLHelper {
975
  }
976
  $new_action['post_content'] = json_encode( $new_action['post_content'] );
977
 
978
- $exists = get_posts( array(
979
- 'name' => $new_action['post_name'],
980
- 'post_type' => $new_action['post_type'],
981
- 'post_status' => $new_action['post_status'],
982
- 'numberposts' => 1,
983
- ) );
 
 
984
 
985
  if ( ! $exists ) {
986
  // this isn't an email, but we need to use a class that will always be included
@@ -1066,12 +1072,14 @@ class FrmXMLHelper {
1066
  }
1067
  $new_notification['post_content'] = FrmAppHelper::prepare_and_encode( $new_notification['post_content'] );
1068
 
1069
- $exists = get_posts( array(
1070
- 'name' => $new_notification['post_name'],
1071
- 'post_type' => $new_notification['post_type'],
1072
- 'post_status' => $new_notification['post_status'],
1073
- 'numberposts' => 1,
1074
- ) );
 
 
1075
 
1076
  if ( empty( $exists ) ) {
1077
  FrmDb::save_json_post( $new_notification );
91
 
92
  $parent = self::get_term_parent_id( $t );
93
 
94
+ $term = wp_insert_term(
95
+ (string) $t->term_name,
96
+ (string) $t->term_taxonomy,
97
+ array(
98
+ 'slug' => (string) $t->term_slug,
99
+ 'description' => (string) $t->term_description,
100
+ 'parent' => empty( $parent ) ? 0 : $parent,
101
+ )
102
+ );
103
 
104
  if ( $term && is_array( $term ) ) {
105
  $imported['imported']['terms']++;
979
  }
980
  $new_action['post_content'] = json_encode( $new_action['post_content'] );
981
 
982
+ $exists = get_posts(
983
+ array(
984
+ 'name' => $new_action['post_name'],
985
+ 'post_type' => $new_action['post_type'],
986
+ 'post_status' => $new_action['post_status'],
987
+ 'numberposts' => 1,
988
+ )
989
+ );
990
 
991
  if ( ! $exists ) {
992
  // this isn't an email, but we need to use a class that will always be included
1072
  }
1073
  $new_notification['post_content'] = FrmAppHelper::prepare_and_encode( $new_notification['post_content'] );
1074
 
1075
+ $exists = get_posts(
1076
+ array(
1077
+ 'name' => $new_notification['post_name'],
1078
+ 'post_type' => $new_notification['post_type'],
1079
+ 'post_status' => $new_notification['post_status'],
1080
+ 'numberposts' => 1,
1081
+ )
1082
+ );
1083
 
1084
  if ( empty( $exists ) ) {
1085
  FrmDb::save_json_post( $new_notification );
classes/models/FrmAddon.php CHANGED
@@ -284,10 +284,14 @@ class FrmAddon {
284
  check_ajax_referer( 'frm_ajax', 'nonce' );
285
 
286
  if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) {
287
- wp_die( json_encode( array(
288
- 'message' => __( 'Oops! You forgot to enter your license number.', 'formidable' ),
289
- 'success' => false,
290
- ) ) );
 
 
 
 
291
  }
292
 
293
  $license = stripslashes( sanitize_text_field( $_POST['license'] ) );
284
  check_ajax_referer( 'frm_ajax', 'nonce' );
285
 
286
  if ( ! isset( $_POST['license'] ) || empty( $_POST['license'] ) ) {
287
+ wp_die(
288
+ json_encode(
289
+ array(
290
+ 'message' => __( 'Oops! You forgot to enter your license number.', 'formidable' ),
291
+ 'success' => false,
292
+ )
293
+ )
294
+ );
295
  }
296
 
297
  $license = stripslashes( sanitize_text_field( $_POST['license'] ) );
classes/models/FrmCreateFile.php CHANGED
@@ -167,10 +167,13 @@ class FrmCreateFile {
167
  }
168
 
169
  private function get_ftp_creds( $type ) {
170
- $credentials = get_option( 'ftp_credentials', array(
171
- 'hostname' => '',
172
- 'username' => '',
173
- ) );
 
 
 
174
 
175
  $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : $credentials['hostname'];
176
  $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : $credentials['username'];
167
  }
168
 
169
  private function get_ftp_creds( $type ) {
170
+ $credentials = get_option(
171
+ 'ftp_credentials',
172
+ array(
173
+ 'hostname' => '',
174
+ 'username' => '',
175
+ )
176
+ );
177
 
178
  $credentials['hostname'] = defined( 'FTP_HOST' ) ? FTP_HOST : $credentials['hostname'];
179
  $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : $credentials['username'];
classes/models/FrmEDD_SL_Plugin_Updater.php CHANGED
@@ -100,10 +100,13 @@ class FrmEDD_SL_Plugin_Updater {
100
  $version_info = $this->get_cached_version_info( $this->cache_key );
101
 
102
  if ( false === $version_info ) {
103
- $version_info = $this->api_request( 'plugin_latest_version', array(
104
- 'slug' => $this->slug,
105
- 'beta' => $this->beta,
106
- ) );
 
 
 
107
 
108
  $this->set_version_info_cache( $version_info, $this->cache_key );
109
 
@@ -260,11 +263,14 @@ class FrmEDD_SL_Plugin_Updater {
260
  );
261
 
262
  $verify_ssl = $this->verify_ssl();
263
- $request = wp_remote_post( $this->api_url, array(
264
- 'timeout' => 15,
265
- 'sslverify' => $verify_ssl,
266
- 'body' => $api_params,
267
- ) );
 
 
 
268
 
269
  if ( ! is_wp_error( $request ) ) {
270
  $request = json_decode( wp_remote_retrieve_body( $request ) );
@@ -328,11 +334,14 @@ class FrmEDD_SL_Plugin_Updater {
328
  );
329
 
330
  $verify_ssl = $this->verify_ssl();
331
- $request = wp_remote_post( $this->api_url, array(
332
- 'timeout' => 15,
333
- 'sslverify' => $verify_ssl,
334
- 'body' => $api_params,
335
- ) );
 
 
 
336
 
337
  if ( ! is_wp_error( $request ) ) {
338
  $version_info = json_decode( wp_remote_retrieve_body( $request ) );
100
  $version_info = $this->get_cached_version_info( $this->cache_key );
101
 
102
  if ( false === $version_info ) {
103
+ $version_info = $this->api_request(
104
+ 'plugin_latest_version',
105
+ array(
106
+ 'slug' => $this->slug,
107
+ 'beta' => $this->beta,
108
+ )
109
+ );
110
 
111
  $this->set_version_info_cache( $version_info, $this->cache_key );
112
 
263
  );
264
 
265
  $verify_ssl = $this->verify_ssl();
266
+ $request = wp_remote_post(
267
+ $this->api_url,
268
+ array(
269
+ 'timeout' => 15,
270
+ 'sslverify' => $verify_ssl,
271
+ 'body' => $api_params,
272
+ )
273
+ );
274
 
275
  if ( ! is_wp_error( $request ) ) {
276
  $request = json_decode( wp_remote_retrieve_body( $request ) );
334
  );
335
 
336
  $verify_ssl = $this->verify_ssl();
337
+ $request = wp_remote_post(
338
+ $this->api_url,
339
+ array(
340
+ 'timeout' => 15,
341
+ 'sslverify' => $verify_ssl,
342
+ 'body' => $api_params,
343
+ )
344
+ );
345
 
346
  if ( ! is_wp_error( $request ) ) {
347
  $version_info = json_decode( wp_remote_retrieve_body( $request ) );
classes/models/FrmEmail.php CHANGED
@@ -286,12 +286,15 @@ class FrmEmail {
286
 
287
  $prev_mail_body = $this->message;
288
  $pass_entry = clone $this->entry; // make a copy to prevent changes by reference
289
- $mail_body = FrmEntriesHelper::replace_default_message( $prev_mail_body, array(
290
- 'id' => $this->entry->id,
291
- 'entry' => $pass_entry,
292
- 'plain_text' => $this->is_plain_text,
293
- 'user_info' => $this->include_user_info,
294
- ) );
 
 
 
295
 
296
  // Add the user info if it isn't already included
297
  if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
@@ -345,18 +348,20 @@ class FrmEmail {
345
  $send = false;
346
  } else {
347
 
 
 
 
 
 
 
 
348
  /**
349
  * Stop an email based on the message, subject, recipient,
350
  * or any information included in the email header
351
  *
352
  * @since 2.2.8
353
  */
354
- $send = apply_filters( 'frm_send_email', true, array(
355
- 'message' => $this->message,
356
- 'subject' => $this->subject,
357
- 'recipient' => $this->to,
358
- 'header' => $this->package_header(),
359
- ) );
360
  }
361
 
362
  return $send;
@@ -412,10 +417,14 @@ class FrmEmail {
412
  * @return bool
413
  */
414
  private function send_single( $recipient ) {
415
- $header = apply_filters( 'frm_email_header', $this->package_header(), array(
416
- 'to_email' => $recipient,
417
- 'subject' => $this->subject,
418
- ) );
 
 
 
 
419
 
420
  $subject = $this->encode_subject( $this->subject );
421
 
@@ -681,17 +690,20 @@ class FrmEmail {
681
  continue;
682
  }
683
 
684
- do_action( 'frm_send_to_not_email', array(
685
- 'e' => $recipient,
686
- 'subject' => $this->subject,
687
- 'mail_body' => $this->message,
688
- 'reply_to' => $this->reply_to,
689
- 'from' => $this->from,
690
- 'plain_text' => $this->is_plain_text,
691
- 'attachments' => $this->attachments,
692
- 'form' => $this->form,
693
- 'email_key' => $key,
694
- ) );
 
 
 
695
 
696
  // Remove phone number from to addresses
697
  unset( $this->to[ $key ] );
286
 
287
  $prev_mail_body = $this->message;
288
  $pass_entry = clone $this->entry; // make a copy to prevent changes by reference
289
+ $mail_body = FrmEntriesHelper::replace_default_message(
290
+ $prev_mail_body,
291
+ array(
292
+ 'id' => $this->entry->id,
293
+ 'entry' => $pass_entry,
294
+ 'plain_text' => $this->is_plain_text,
295
+ 'user_info' => $this->include_user_info,
296
+ )
297
+ );
298
 
299
  // Add the user info if it isn't already included
300
  if ( $this->include_user_info && $prev_mail_body === $mail_body ) {
348
  $send = false;
349
  } else {
350
 
351
+ $filter_args = array(
352
+ 'message' => $this->message,
353
+ 'subject' => $this->subject,
354
+ 'recipient' => $this->to,
355
+ 'header' => $this->package_header(),
356
+ );
357
+
358
  /**
359
  * Stop an email based on the message, subject, recipient,
360
  * or any information included in the email header
361
  *
362
  * @since 2.2.8
363
  */
364
+ $send = apply_filters( 'frm_send_email', true, $filter_args );
 
 
 
 
 
365
  }
366
 
367
  return $send;
417
  * @return bool
418
  */
419
  private function send_single( $recipient ) {
420
+ $header = apply_filters(
421
+ 'frm_email_header',
422
+ $this->package_header(),
423
+ array(
424
+ 'to_email' => $recipient,
425
+ 'subject' => $this->subject,
426
+ )
427
+ );
428
 
429
  $subject = $this->encode_subject( $this->subject );
430
 
690
  continue;
691
  }
692
 
693
+ do_action(
694
+ 'frm_send_to_not_email',
695
+ array(
696
+ 'e' => $recipient,
697
+ 'subject' => $this->subject,
698
+ 'mail_body' => $this->message,
699
+ 'reply_to' => $this->reply_to,
700
+ 'from' => $this->from,
701
+ 'plain_text' => $this->is_plain_text,
702
+ 'attachments' => $this->attachments,
703
+ 'form' => $this->form,
704
+ 'email_key' => $key,
705
+ )
706
+ );
707
 
708
  // Remove phone number from to addresses
709
  unset( $this->to[ $key ] );
classes/models/FrmEntry.php CHANGED
@@ -300,10 +300,14 @@ class FrmEntry {
300
  }
301
 
302
  global $wpdb;
303
- $metas = FrmDb::get_results( $wpdb->prefix . 'frm_item_metas m LEFT JOIN ' . $wpdb->prefix . 'frm_fields f ON m.field_id=f.id', array(
304
- 'item_id' => $entry->id,
305
- 'field_id !' => 0,
306
- ), 'field_id, meta_value, field_key, item_id' );
 
 
 
 
307
 
308
  $entry->metas = array();
309
 
@@ -641,10 +645,12 @@ class FrmEntry {
641
  if ( isset( $values['description'] ) && ! empty( $values['description'] ) ) {
642
  $description = maybe_serialize( $values['description'] );
643
  } else {
644
- $description = serialize( array(
645
- 'browser' => FrmAppHelper::get_server_value( 'HTTP_USER_AGENT' ),
646
- 'referrer' => FrmAppHelper::get_server_value( 'HTTP_REFERER' ),
647
- ) );
 
 
648
  }
649
 
650
  return $description;
300
  }
301
 
302
  global $wpdb;
303
+ $metas = FrmDb::get_results(
304
+ $wpdb->prefix . 'frm_item_metas m LEFT JOIN ' . $wpdb->prefix . 'frm_fields f ON m.field_id=f.id',
305
+ array(
306
+ 'item_id' => $entry->id,
307
+ 'field_id !' => 0,
308
+ ),
309
+ 'field_id, meta_value, field_key, item_id'
310
+ );
311
 
312
  $entry->metas = array();
313
 
645
  if ( isset( $values['description'] ) && ! empty( $values['description'] ) ) {
646
  $description = maybe_serialize( $values['description'] );
647
  } else {
648
+ $description = serialize(
649
+ array(
650
+ 'browser' => FrmAppHelper::get_server_value( 'HTTP_USER_AGENT' ),
651
+ 'referrer' => FrmAppHelper::get_server_value( 'HTTP_REFERER' ),
652
+ )
653
+ );
654
  }
655
 
656
  return $description;
classes/models/FrmEntryFormat.php CHANGED
@@ -192,10 +192,14 @@ class FrmEntryFormat {
192
  public static function prepare_field_output( $atts, &$val ) {
193
  _deprecated_function( __FUNCTION__, '2.04', 'instance of FrmEntryValues or FrmProEntryValues' );
194
 
195
- $val = apply_filters( 'frm_display_' . $atts['field']->type . '_value_custom', $val, array(
196
- 'field' => $atts['field'],
197
- 'atts' => $atts,
198
- ) );
 
 
 
 
199
 
200
  self::flatten_array_value( $atts, $val );
201
  self::maybe_strip_html( $atts['plain_text'], $val );
192
  public static function prepare_field_output( $atts, &$val ) {
193
  _deprecated_function( __FUNCTION__, '2.04', 'instance of FrmEntryValues or FrmProEntryValues' );
194
 
195
+ $val = apply_filters(
196
+ 'frm_display_' . $atts['field']->type . '_value_custom',
197
+ $val,
198
+ array(
199
+ 'field' => $atts['field'],
200
+ 'atts' => $atts,
201
+ )
202
+ );
203
 
204
  self::flatten_array_value( $atts, $val );
205
  self::maybe_strip_html( $atts['plain_text'], $val );
classes/models/FrmEntryMeta.php CHANGED
@@ -91,10 +91,13 @@ class FrmEntryMeta {
91
  private static function get_value_to_save( $atts, &$value ) {
92
  if ( is_object( $atts['field'] ) ) {
93
  $field_obj = FrmFieldFactory::get_field_object( $atts['field'] );
94
- $value = $field_obj->get_value_to_save( $value, array(
95
- 'entry_id' => $atts['entry_id'],
96
- 'field_id' => $atts['field_id'],
97
- ) );
 
 
 
98
  }
99
 
100
  $value = apply_filters( 'frm_prepare_data_before_db', $value, $atts['field_id'], $atts['entry_id'], array( 'field' => $atts['field'] ) );
@@ -103,10 +106,14 @@ class FrmEntryMeta {
103
  public static function update_entry_metas( $entry_id, $values ) {
104
  global $wpdb;
105
 
106
- $prev_values = FrmDb::get_col( $wpdb->prefix . 'frm_item_metas', array(