ninja_forms_register_field_credit_card

Function to register a new field for user's country.

Description

ninja_forms_register_field_credit_card(); 

Usage

  1. if ( !function_exists( 'ninja_forms_register_field_credit_card' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/fields/credit-card.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ninja_forms_register_field_credit_card(); 
  7.  

Defined (1)

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

/deprecated/includes/fields/credit-card.php  
  1. function ninja_forms_register_field_credit_card() { 
  2.  
  3. $reg_field = apply_filters( 'ninja_forms_enable_credit_card_field', false ); 
  4.  
  5. $args = array( 
  6. 'name' => __( 'Credit Card', 'ninja-forms' ),  
  7. 'sidebar' => '',  
  8. 'display_function' => 'ninja_forms_field_credit_card_display',  
  9. 'group' => 'standard_fields',  
  10. 'edit_conditional' => true,  
  11. 'edit_custom_class' => false,  
  12. 'edit_options' => array(),  
  13. //'post_process' => 'ninja_forms_field_credit_card_test',  
  14. 'save_sub' => false,  
  15. 'process_field' => false,  
  16. 'edit_label' => false,  
  17. 'edit_label_pos' => false,  
  18. 'edit_options' => array( 
  19. array( 
  20. 'type' => 'hidden',  
  21. 'name' => 'payment_field_group',  
  22. 'default' => 1,  
  23. ),  
  24. array( 
  25. 'type' => 'text',  
  26. 'name' => 'cc_number_label',  
  27. 'label' => __( 'Card Number Label', 'ninja-forms' ),  
  28. 'default' => __( 'Card Number', 'ninja-forms' ),  
  29. 'width' => 'wide',  
  30. 'class' => 'widefat',  
  31. ),  
  32. array( 
  33. 'type' => 'text',  
  34. 'name' => 'cc_number_desc',  
  35. 'label' => __( 'Card Number Description', 'ninja-forms' ),  
  36. 'default' => __( 'The (typically) 16 digits on the front of your credit card.', 'ninja-forms' ),  
  37. 'width' => 'wide',  
  38. 'class' => 'widefat',  
  39. ),  
  40. array( 
  41. 'type' => 'text',  
  42. 'name' => 'cc_cvc_label',  
  43. 'label' => __( 'Card CVC Label', 'ninja-forms' ),  
  44. 'default' => __( 'CVC', 'ninja-forms' ),  
  45. 'width' => 'wide',  
  46. 'class' => 'widefat',  
  47. ),  
  48. array( 
  49. 'type' => 'text',  
  50. 'name' => 'cc_cvc_desc',  
  51. 'label' => __( 'Card CVC Description', 'ninja-forms' ),  
  52. 'default' => __( 'The 3 digit (back) or 4 digit (front) value on your card.', 'ninja-forms' ),  
  53. 'width' => 'wide',  
  54. 'class' => 'widefat',  
  55. ),  
  56. array( 
  57. 'type' => 'text',  
  58. 'name' => 'cc_name_label',  
  59. 'label' => __( 'Card Name Label', 'ninja-forms' ),  
  60. 'default' => __( 'Name on the card', 'ninja-forms' ),  
  61. 'width' => 'wide',  
  62. 'class' => 'widefat',  
  63. ),  
  64. array( 
  65. 'type' => 'text',  
  66. 'name' => 'cc_name_desc',  
  67. 'label' => __( 'Card Name Description', 'ninja-forms' ),  
  68. 'default' => __( 'The name printed on the front of your credit card.', 'ninja-forms' ),  
  69. 'width' => 'wide',  
  70. 'class' => 'widefat',  
  71. ),  
  72. array( 
  73. 'type' => 'text',  
  74. 'name' => 'cc_exp_month_label',  
  75. 'label' => __( 'Card Expiry Month Label', 'ninja-forms' ),  
  76. 'default' => __( 'Expiration month (MM)', 'ninja-forms' ),  
  77. 'width' => 'wide',  
  78. 'class' => 'widefat',  
  79. ),  
  80. array( 
  81. 'type' => 'text',  
  82. 'name' => 'cc_exp_month_desc',  
  83. 'label' => __( 'Card Expiry Month Description', 'ninja-forms' ),  
  84. 'default' => __( 'The month your credit card expires, typically on the front of the card.', 'ninja-forms' ),  
  85. 'width' => 'wide',  
  86. 'class' => 'widefat',  
  87. ),  
  88. array( 
  89. 'type' => 'text',  
  90. 'name' => 'cc_exp_year_label',  
  91. 'label' => __( 'Card Expiry Year Label', 'ninja-forms' ),  
  92. 'default' => __( 'Expiration year (YYYY)', 'ninja-forms' ),  
  93. 'width' => 'wide',  
  94. 'class' => 'widefat',  
  95. ),  
  96. array( 
  97. 'type' => 'text',  
  98. 'name' => 'cc_exp_year_desc',  
  99. 'label' => __( 'Card Expiry Year Description', 'ninja-forms' ),  
  100. 'default' => __( 'The year your credit card expires, typically on the front of the card.', 'ninja-forms' ),  
  101. 'width' => 'wide',  
  102. 'class' => 'widefat',  
  103. ),  
  104.  
  105. ),  
  106. ); 
  107.  
  108. if ( $reg_field ) { 
  109. ninja_forms_register_field( '_credit_card', $args );