ninja_forms_register_form_settings_basic_metabox

The Ninja Forms ninja forms register form settings basic metabox function.

Description

ninja_forms_register_form_settings_basic_metabox(); 

Usage

  1. if ( !function_exists( 'ninja_forms_register_form_settings_basic_metabox' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/admin/pages/ninja-forms/tabs/form-settings/form-settings.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ninja_forms_register_form_settings_basic_metabox(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/deprecated/includes/admin/pages/ninja-forms/tabs/form-settings/form-settings.php  
  1. function ninja_forms_register_form_settings_basic_metabox() { 
  2.  
  3. if( isset( $_REQUEST['form_id'] ) ) { 
  4. $form_id = absint( $_REQUEST['form_id'] ); 
  5. $form_data = Ninja_Forms()->form( $form_id )->get_all_settings(); 
  6. }else{ 
  7. $form_id = ''; 
  8. $form_row = ''; 
  9. $form_data = ''; 
  10.  
  11. $pages = get_pages(); 
  12. $pages_array = array(); 
  13. $append_array = array(); 
  14. array_push($pages_array, array('name' => __( '- None', 'ninja-forms' ), 'value' => '')); 
  15. array_push($append_array, array('name' => __( '- None', 'ninja-forms' ), 'value' => '')); 
  16. foreach ($pages as $pagg) { 
  17. array_push($pages_array, array('name' => $pagg->post_title, 'value' => get_page_link($pagg->ID))); 
  18. array_push($append_array, array('name' => $pagg->post_title, 'value' => $pagg->ID)); 
  19.  
  20. if( isset( $form_data['ajax'] ) ) { 
  21. $ajax = $form_data['ajax']; 
  22. }else{ 
  23. $ajax = 0; 
  24.  
  25. $args = apply_filters( 'ninja_forms_form_settings_basic', array( 
  26. 'page' => 'ninja-forms',  
  27. 'tab' => 'form_settings',  
  28. 'slug' => 'basic_settings',  
  29. 'title' => __( 'Display', 'ninja-forms' ),  
  30. 'state' => 'closed',  
  31. 'settings' => array( 
  32. array(  
  33. 'name' => 'form_title',  
  34. 'type' => 'text',  
  35. 'label' => __( 'Form Title', 'ninja-forms' ),  
  36. ),  
  37. array( 
  38. 'name' => 'show_title',  
  39. 'type' => 'checkbox',  
  40. 'label' => __( 'Display Form Title', 'ninja-forms' ),  
  41. ),  
  42. array( 
  43. 'name' => 'append_page',  
  44. 'type' => 'select',  
  45. 'desc' => '',  
  46. 'label' => __( 'Add form to this page', 'ninja-forms' ),  
  47. 'display_function' => '',  
  48. 'help' => '',  
  49. 'options' => $append_array,  
  50. ),  
  51. array( 
  52. 'name' => 'ajax',  
  53. 'type' => 'checkbox',  
  54. 'desc' => '',  
  55. 'label' => __( 'Submit via AJAX (without page reload)?', 'ninja-forms' ),  
  56. 'display_function' => '',  
  57. 'help' => '',  
  58. ),  
  59. array( 
  60. 'name' => 'clear_complete',  
  61. 'type' => 'checkbox',  
  62. 'desc' => '',  
  63. 'label' => __( 'Clear successfully completed form?', 'ninja-forms' ),  
  64. 'display_function' => '',  
  65. 'desc' => __( 'If this box is checked, Ninja Forms will clear the form values after it has been successfully submitted.', 'ninja-forms' ),  
  66. 'default_value' => 1,  
  67. ),  
  68. array( 
  69. 'name' => 'hide_complete',  
  70. 'type' => 'checkbox',  
  71. 'desc' => '',  
  72. 'label' => __( 'Hide successfully completed form?', 'ninja-forms' ),  
  73. 'display_function' => '',  
  74. 'desc' => __( 'If this box is checked, Ninja Forms will hide the form after it has been successfully submitted.', 'ninja-forms' ),  
  75. 'default_value' => 1,  
  76. ),  
  77. ),  
  78. )); 
  79.  
  80. $args = apply_filters( 'ninja_forms_form_settings_restrictions', array( 
  81. 'page' => 'ninja-forms',  
  82. 'tab' => 'form_settings',  
  83. 'slug' => 'restrictions',  
  84. 'title' => __( 'Restrictions', 'ninja-forms' ),  
  85. 'state' => 'closed',  
  86. 'settings' => array( 
  87. array( 
  88. 'name' => 'logged_in',  
  89. 'type' => 'checkbox',  
  90. 'desc' => '',  
  91. 'label' => __( 'Require user to be logged in to view form?', 'ninja-forms' ),  
  92. 'display_function' => '',  
  93. 'help' => '',  
  94. ),  
  95. array( 
  96. 'name' => 'not_logged_in_msg',  
  97. 'type' => 'rte',  
  98. 'label' => __( 'Not Logged-In Message', 'ninja-forms' ),  
  99. 'desc' => __( 'Message shown to users if the "logged in" checkbox above is checked and they are not logged-in.', 'ninja-forms' ),  
  100. 'tr_class' => '',  
  101. ),  
  102. array( 
  103. 'name' => 'sub_limit_number',  
  104. 'type' => 'number',  
  105. 'desc' => '',  
  106. 'label' => __( 'Limit Submissions', 'ninja-forms' ),  
  107. 'display_function' => '',  
  108. 'desc' => __( 'Select the number of submissions that this form will accept. Leave empty for no limit.', 'ninja-forms' ),  
  109. 'default_value' => '',  
  110. 'tr_class' => '',  
  111. 'min' => 0,  
  112. ),  
  113. array( 
  114. 'name' => 'sub_limit_msg',  
  115. 'type' => 'rte',  
  116. 'label' => __( 'Limit Reached Message', 'ninja-forms' ),  
  117. 'desc' => __( 'Please enter a message that you want displayed when this form has reached its submission limit and will not accept new submissions.', 'ninja-forms' ),  
  118. 'tr_class' => '',  
  119. ),  
  120. ),  
  121. )); 
  122.  
  123.