/deprecated/includes/admin/pages/ninja-forms-settings/tabs/label-settings/label-settings.php

  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; 
  2. add_action( 'init', 'ninja_forms_register_tab_label_settings' ); 
  3.  
  4. function ninja_forms_register_tab_label_settings() { 
  5. $args = array( 
  6. 'name' => __( 'Labels', 'ninja-forms' ),  
  7. 'page' => 'ninja-forms-settings',  
  8. 'display_function' => '',  
  9. 'save_function' => 'ninja_forms_save_label_settings',  
  10. ); 
  11. ninja_forms_register_tab( 'label_settings', $args ); 
  12.  
  13.  
  14. add_action( 'init', 'ninja_forms_register_label_settings_metabox' ); 
  15.  
  16. function ninja_forms_register_label_settings_metabox() { 
  17.  
  18. $args = array( 
  19. 'page' => 'ninja-forms-settings',  
  20. 'tab' => 'label_settings',  
  21. 'slug' => 'label_labels',  
  22. 'title' => __( 'Message Labels', 'ninja-forms' ),  
  23. 'settings' => array( 
  24. array( 
  25. 'name' => 'req_div_label',  
  26. 'type' => 'text',  
  27. 'label' => __( 'Required Field Label', 'ninja-forms' ),  
  28. 'desc' => '',  
  29. 'help_text' => '',  
  30. ),  
  31. array( 
  32. 'name' => 'req_field_symbol',  
  33. 'type' => 'text',  
  34. 'label' => __( 'Required field symbol', 'ninja-forms' ),  
  35. ),  
  36. array( 
  37. 'name' => 'req_error_label',  
  38. 'type' => 'text',  
  39. 'label' => __( 'Error message given if all required fields are not completed', 'ninja-forms' ),  
  40. ),  
  41. array( 
  42. 'name' => 'req_field_error',  
  43. 'type' => 'text',  
  44. 'label' => __( 'Required Field Error', 'ninja-forms' ),  
  45. 'desc' => '',  
  46. ),  
  47. array( 
  48. 'name' => 'spam_error',  
  49. 'type' => 'text',  
  50. 'label' => __( 'Anti-spam error message', 'ninja-forms' ),  
  51. 'desc' => '',  
  52. ),  
  53. array( 
  54. 'name' => 'honeypot_error',  
  55. 'type' => 'text',  
  56. 'label' => __( 'Honeypot error message', 'ninja-forms' ),  
  57. 'desc' => '',  
  58. ),  
  59. array( 
  60. 'name' => 'timed_submit_error',  
  61. 'type' => 'text',  
  62. 'label' => __( 'Timer error message', 'ninja-forms' ),  
  63. 'desc' => '',  
  64. ),  
  65. array( 
  66. 'name' => 'javascript_error',  
  67. 'type' => 'text',  
  68. 'label' => __( 'JavaScript disabled error message', 'ninja-forms' ),  
  69. 'desc' => '',  
  70. ),  
  71. array( 
  72. 'name' => 'invalid_email',  
  73. 'type' => 'text',  
  74. 'label' => __( 'Please enter a valid email address', 'ninja-forms' ),  
  75. 'desc' => '',  
  76. ),  
  77. array( 
  78. 'name' => 'process_label',  
  79. 'type' => 'text',  
  80. 'label' => __( 'Processing Submission Label', 'ninja-forms' ),  
  81. 'desc' => __( 'This message is shown inside the submit button whenever a user clicks "submit" to let them know it is processing.', 'ninja-forms' ),  
  82. ),  
  83. array( 
  84. 'name' => 'password_mismatch',  
  85. 'type' => 'text',  
  86. 'label' => __( 'Password Mismatch Label', 'ninja-forms' ),  
  87. 'desc' => __( 'This message is shown to a user when non-matching values are placed in the password field.', 'ninja-forms' ),  
  88. ),  
  89. ),  
  90. ); 
  91. ninja_forms_register_tab_metabox( $args ); 
  92.  
  93.  
  94. function ninja_forms_save_label_settings( $data ) { 
  95. $plugin_settings = nf_get_settings(); 
  96. foreach( $data as $key => $val ) { 
  97. $plugin_settings[$key] = $val; 
  98. update_option( "ninja_forms_settings", $plugin_settings ); 
  99. $update_msg = __( 'Settings Saved', 'ninja-forms' ); 
  100. return $update_msg; 
.