/includes/deprecated.php

  1. <?php 
  2.  
  3. /** 
  4. |-------------------------------------------------------------------------- 
  5. | Deprecated Functions 
  6. |-------------------------------------------------------------------------- 
  7. */ 
  8.  
  9. function ninja_forms_display_form( $form_id = '' ) { 
  10. Ninja_Forms::deprecated_notice( 'ninja_forms_display_form', '3.0', 'Ninja_Forms()->display( $form_id, $is_preview )', debug_backtrace() ); 
  11. Ninja_Forms()->display( $form_id ); 
  12.  
  13. function ninja_forms_get_fields_by_form_id($form_id, $orderby = 'ORDER BY `order` ASC') { 
  14.  
  15. $fields = Ninja_Forms()->form( $form_id )->get_fields(); 
  16.  
  17. $field_results = array(); 
  18. foreach( $fields as $field ) { 
  19. $field_results[] = array( 
  20. 'id' => $field->get_id(),  
  21. 'form_id' => $form_id,  
  22. 'type' => $field->get_setting( 'type' ),  
  23. 'order' => $field->get_setting( 'order' ),  
  24. 'data' => $field->get_settings(),  
  25. 'fav_id' => null,  
  26. 'def_id' => null,  
  27. ); 
  28. return $field_results; 
  29.  
  30. /** 
  31. * Included for backwards compatibility with Visual Composer. 
  32. */ 
  33. function ninja_forms_get_all_forms() { 
  34. // Ninja_Forms::deprecated_notice( 'ninja_forms_get_all_forms', '3.0', 'Ninja_Forms()->form()->get_forms()', debug_backtrace() ); 
  35. $forms = array(); 
  36. foreach( Ninja_Forms()->form()->get_forms() as $form ) { 
  37. $forms[] = array( 
  38. 'id' => $form->get_id(),  
  39. 'data' => $form->get_settings(),  
  40. 'name' => $form->get_setting( 'title' ) 
  41. ); 
  42. return $forms; 
  43.  
  44. function nf_is_func_disabled( $function ) { 
  45. Ninja_Forms::deprecated_notice( 'nf_is_func_disabled', '3.0', 'WPN_Helper::is_func_disabled()', debug_backtrace() ); 
  46. return WPN_Helper::is_func_disabled( $function ); 
  47.  
  48. /** 
  49. |-------------------------------------------------------------------------- 
  50. | Deprecated Hooks 
  51. |-------------------------------------------------------------------------- 
  52. */ 
  53.  
  54. add_action( 'init', '_nf_get_actions', 999 ); 
  55. function _nf_get_actions() { 
  56. if ( isset( $_POST['nf_action'] ) ) { 
  57. do_action( 'nf_' . $_POST['nf_action'], $_POST ); 
  58.  
  59. add_action( 'init', '_nf_post_actions', 999 ); 
  60. function _nf_post_actions() { 
  61. if ( isset( $_GET['nf_action'] ) ) { 
  62. do_action( 'nf_' . $_GET['nf_action'], $_GET ); 
  63.  
  64. // add_action( 'shutdown', '_nf_removed_hooks' ); 
  65. function _nf_removed_hooks() { 
  66. global $wp_filter; 
  67.  
  68. $hooks = array( 
  69. /** Removed Action Hooks */ 
  70. 'ninja_forms_insert_sub',  
  71. 'nf_email_notification_after_settings',  
  72. 'nf_edit_notification_settings',  
  73. 'ninja_forms_edit_field_before_li',  
  74. 'ninja_forms_edit_field_after_li',  
  75. 'ninja_forms_edit_field_before_closing_li',  
  76. 'ninja_forms_edit_field_before_registered',  
  77. // 'nf_edit_field_*',  
  78. 'ninja_forms_edit_field_after_registered',  
  79. 'ninja_forms_edit_field_before_ul',  
  80. 'ninja_forms_edit_field_ul',  
  81. 'ninja_forms_edit_field_after_ul',  
  82. 'ninja_forms_email_admin',  
  83. 'ninja_forms_email_user',  
  84. 'ninja_forms_display_before_field_label',  
  85. 'ninja_forms_display_field_label',  
  86. 'ninja_forms_display_after_field_label',  
  87. 'ninja_forms_display_field_help',  
  88. 'ninja_forms_display_field_label',  
  89. 'ninja_forms_display_field_help',  
  90. 'nf_before_display_loading',  
  91. 'ninja_forms_display_open_form_wrap',  
  92. 'ninja_forms_display_form_title',  
  93. 'ninja_forms_display_open_form_tag',  
  94. 'ninja_forms_display_fields',  
  95. 'ninja_forms_display_close_form_tag',  
  96. 'ninja_forms_display_close_form_wrap',  
  97. 'nf_notification_before_process',  
  98. 'nf_save_notification',  
  99. 'nf_sub_table_after_row_actions_trash',  
  100. 'nf_sub_table_after_row_actions',  
  101. 'nf_sub_table_before_row_actions_trash',  
  102. 'nf_sub_table_before_row_actions',  
  103. 'ninja_forms_after_import_form',  
  104. 'ninja_forms_display_after_closing_field_wrap',  
  105. 'ninja_forms_display_after_field_function',  
  106. 'ninja_forms_display_after_field_label',  
  107. 'ninja_forms_display_after_field',  
  108. 'ninja_forms_display_after_opening_field_wrap',  
  109. 'ninja_forms_display_before_closing_field_wrap',  
  110. 'ninja_forms_display_before_field_function',  
  111. 'ninja_forms_display_before_field_label',  
  112. 'ninja_forms_display_before_field',  
  113. 'ninja_forms_display_before_opening_field_wrap',  
  114. 'ninja_forms_display_css',  
  115. 'ninja_forms_save_admin_metabox_option',  
  116. 'ninja_forms_save_admin_metabox',  
  117. 'ninja_forms_save_admin_sidebar',  
  118. 'ninja_forms_save_admin_tab',  
  119. 'ninja_forms_before_pre_process',  
  120. 'ninja_forms_display_after_fields',  
  121. 'ninja_forms_display_after_form_title',  
  122. 'ninja_forms_display_after_form_wrap',  
  123. 'ninja_forms_display_after_open_form_tag',  
  124. 'ninja_forms_display_before_fields',  
  125. 'ninja_forms_display_before_form_title',  
  126. 'ninja_forms_display_before_form_wrap',  
  127. 'ninja_forms_display_before_form',  
  128. 'ninja_forms_post_process',  
  129. 'ninja_forms_pre_process',  
  130. 'ninja_forms_process',  
  131.  
  132. /** Removed Filter Hooks */ 
  133. 'nf_export_form_row',  
  134. 'nf_notification_admin_js_vars',  
  135. 'nf_success_message_locations',  
  136. 'nf_notification_types',  
  137. 'ninja_forms_admin_submissions_datepicker_args',  
  138. 'ninja_forms_starter_form_contents',  
  139. 'ninja_forms_preview_page_title',  
  140. 'nf_input_limit_types',  
  141. 'ninja_forms_edit_field_li_label',  
  142. 'nf_edit_field_settings_sections',  
  143. 'ninja_forms_use_post_fields',  
  144. 'nf_general_settings_advanced',  
  145. 'nf_new_form_defaults',  
  146. 'ninja_forms_use_post_fields',  
  147. 'ninja_forms_form_settings_basic',  
  148. 'ninja_forms_form_settings_restrictions',  
  149. 'nf_upgrade_handler_register',  
  150. 'ninja_forms_save_sub',  
  151. 'ninja_forms_export_subs_csv_file_name',  
  152. 'ninja_forms_export_sub_label',  
  153. 'ninja_forms_export_subs_label_array',  
  154. 'ninja_forms_export_sub_pre_value',  
  155. 'ninja_forms_export_sub_value',  
  156. 'ninja_forms_export_subs_value_array',  
  157. 'ninja_forms_csv_bom',  
  158. 'ninja_forms_csv_delimiter',  
  159. 'ninja_forms_csv_enclosure',  
  160. 'ninja_forms_csv_terminator',  
  161. 'ninja_forms_sub_table_row_actions',  
  162. 'ninja_forms_csv_delimiter',  
  163. 'ninja_forms_csv_enclosure',  
  164. 'ninja_forms_csv_terminator',  
  165. 'ninja_forms_admin_menu_capabilities',  
  166. 'ninja_forms_email_all_fields_array',  
  167. 'nf_email_user_values_title',  
  168. 'ninja_forms_email_field_label',  
  169. 'ninja_forms_email_user_value',  
  170. 'ninja_forms_email_field_list',  
  171. 'ninja_forms_admin_email_message_wpautop',  
  172. 'ninja_forms_admin_email_from',  
  173. 'ninja_forms_user_email_message_wpautop',  
  174. 'ninja_forms_submission_csv_name',  
  175. 'ninja_forms_success_msg',  
  176. 'nf_delete_form_capabilities',  
  177. 'ninja_forms_field',  
  178. 'ninja_forms_display_field_type',  
  179. 'ninja_forms_use_post_fields',  
  180. 'ninja_forms_list_terms',  
  181. 'ninja_forms_display_form_form_data',  
  182. 'ninja_forms_admin_subject',  
  183. 'ninja_forms_user_subject',  
  184. 'ninja_forms_admin_email',  
  185. 'ninja_forms_user_email',  
  186. 'ninja_forms_save_msg',  
  187. 'ninja_forms_display_script_field_data',  
  188. 'ninja_forms_display_form_form_data',  
  189. 'ninja_forms_enable_credit_card_field',  
  190. 'ninja_forms_post_credit_card_field',  
  191. 'ninja_forms_credit_card_field_desc_pos',  
  192. 'ninja_forms_hide_cc_field',  
  193. 'ninja_forms_display_list_options_span_class',  
  194. 'nf_import_notification_meta',  
  195. 'ninja_forms_labels/timed_submit_error',  
  196. 'ninja_forms_form_list_template_function',  
  197. 'nf_all_fields_field_value',  
  198. 'nf_all_fields_table',  
  199. 'nf_before_import_field',  
  200. 'nf_delete_field_capabilities',  
  201. 'nf_download_all_filename',  
  202. 'nf_email_notification_attachment_types',  
  203. 'nf_email_notification_attachments',  
  204. 'nf_email_notification_process_setting',  
  205. 'nf_general_settings_recaptcha',  
  206. 'nf_new_field_capabilities',  
  207. 'nf_notification_process_setting',  
  208. 'nf_step_processing_labels',  
  209. 'nf_sub_csv_bom',  
  210. 'nf_sub_edit_status',  
  211. 'nf_sub_human_time',  
  212. 'nf_sub_table_row_actions',  
  213. 'nf_sub_table_status',  
  214. 'nf_sub_table_user_value_max_items',  
  215. 'nf_sub_table_user_value_max_len',  
  216. 'nf_sub_title_time',  
  217. 'nf_subs_csv_field_label',  
  218. 'nf_subs_csv_filename',  
  219. 'nf_subs_csv_label_array_before_fields',  
  220. 'nf_subs_csv_value_array',  
  221. 'nf_subs_export_pre_value',  
  222. 'nf_subs_table_qv',  
  223. 'nf_success_msg',  
  224. 'ninja_forms_admin_email_message_wpautop',  
  225. 'ninja_forms_admin_metabox_rte',  
  226. 'ninja_forms_ajax_url',  
  227. 'ninja_forms_before_import_form',  
  228. 'ninja_forms_cont_class',  
  229. 'ninja_forms_credit_card_cvc_desc',  
  230. 'ninja_forms_credit_card_cvc_label',  
  231. 'ninja_forms_credit_card_exp_month_desc',  
  232. 'ninja_forms_credit_card_exp_month_label',  
  233. 'ninja_forms_credit_card_exp_year_desc',  
  234. 'ninja_forms_credit_card_exp_year_label',  
  235. 'ninja_forms_credit_card_name_desc',  
  236. 'ninja_forms_credit_card_name_label',  
  237. 'ninja_forms_credit_card_number_desc',  
  238. 'ninja_forms_display_field_class',  
  239. 'ninja_forms_display_field_desc_class',  
  240. 'ninja_forms_display_field_processing_error_class',  
  241. 'ninja_forms_display_fields_wrap_visibility',  
  242. 'ninja_forms_display_form_visibility',  
  243. 'ninja_forms_display_required_items_class',  
  244. 'ninja_forms_display_response_message_class',  
  245. 'ninja_forms_display_show_form',  
  246. 'ninja_forms_dropdown_open_tag',  
  247. 'ninja_forms_dropdown_placeholder',  
  248. 'ninja_forms_edit_field_rte',  
  249. 'ninja_forms_field_post_process_user_value',  
  250. 'ninja_forms_field_pre_process_user_value',  
  251. 'ninja_forms_field_process_user_value',  
  252. 'ninja_forms_field_shortcode',  
  253. 'ninja_forms_field_wrap_class',  
  254. 'ninja_forms_fields_wrap_class',  
  255. 'ninja_forms_form_class',  
  256. 'ninja_forms_form_list_forms',  
  257. 'ninja_forms_form_wrap_class',  
  258. 'ninja_forms_label_class',  
  259. 'ninja_forms_labels/currency_symbol',  
  260. 'ninja_forms_labels/date_format',  
  261. 'ninja_forms_labels/honeypot_error',  
  262. 'ninja_forms_labels/invalid_email',  
  263. 'ninja_forms_labels/javascript_error',  
  264. 'ninja_forms_labels/password_mismatch',  
  265. 'ninja_forms_labels/process_label',  
  266. 'ninja_forms_labels/req_div_label',  
  267. 'ninja_forms_labels/req_error_label',  
  268. 'ninja_forms_labels/req_field_error',  
  269. 'ninja_forms_labels/req_field_symbol',  
  270. 'ninja_forms_labels/spam_error',  
  271. 'ninja_forms_display_fields_array',  
  272.  
  273. ); 
  274.  
  275. foreach( $hooks as $hook ) { 
  276. apply_filters( $hook, '' ); // add_action() is just a wrapper for add_filter(), so use add_filter() for both. 
  277. if( ! isset( $wp_filter[ $hook ] ) || ! $wp_filter[ $hook ] ) continue; 
  278. Ninja_Forms::deprecated_notice( $hook, '3.0', null ); 
  279.  
  280. function ninja_forms_get_form_by_id( $form_id ) { 
  281. Ninja_Forms::deprecated_notice( $hook, '3.0', null ); 
  282. return array(); 
.