Guest User

Untitled

a guest
Feb 15th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. <?php
  2. /**
  3. * Core functions and definitions for Reach Theme.
  4. *
  5. * @package Reach
  6. */
  7.  
  8. require_once( 'inc/class-reach-theme.php' );
  9.  
  10. /**
  11. * Start the theme.
  12. */
  13. reach_get_theme();
  14.  
  15. /**
  16. * Set the content width based on the theme's design and stylesheet.
  17. */
  18. if ( ! isset( $content_width ) ) {
  19. $content_width = 640; /* pixels */
  20. }
  21.  
  22. /**
  23. * Define whether we're in debug mode.
  24. *
  25. * This is set to false by default. If set to true,
  26. * scripts and stylesheets are NOT cached or minified
  27. * to make debugging easier.
  28. */
  29. if ( ! defined( 'REACH_DEBUG' ) ) {
  30. define( 'REACH_DEBUG', false );
  31. }
  32.  
  33. /**
  34. * Return the one true instance of the Reach_Theme.
  35. *
  36. * @return Reach_Theme
  37. * @since 1.0.0
  38. */
  39. function reach_get_theme() {
  40. return Reach_Theme::get_instance();
  41. }
  42.  
  43.  
  44. add_action('wp_enqueue_scripts', 'load_js_assets');
  45.  
  46.  
  47. function ed_charitable_register_new_checkbox_field() {
  48.  
  49.  
  50. /**
  51. * Define a new checkbox field.
  52. */
  53. $field = new Charitable_Donation_Field( 'new_checkbox_field', array(
  54. 'label' => __( 'Indian', 'charitable' ),
  55. 'data_type' => 'user',
  56. 'donation_form' => array(
  57. 'type' => 'checkbox',
  58. 'show_after' => 'phone',
  59. 'required' => true,
  60. 'name'=> 'indian',
  61. 'id' => 'myCheck',
  62. 'onClick'=>'myFunction()',
  63. ),
  64. 'admin_form' => true,
  65. 'show_in_meta' => true,
  66. 'show_in_export' => true,
  67. 'email_tag' => array(
  68. 'description' => __( 'Indian or not' , 'charitable' ),
  69. ),
  70. ) );
  71.  
  72.  
  73. /**
  74. * Register the checkbox field.
  75. */
  76. charitable()->donation_fields()->register_field( $field );
  77. }
  78.  
  79. add_action( 'init', 'ed_charitable_register_new_checkbox_field' );
  80.  
  81.  
  82.  
  83.  
  84. This is my functions.php. I have added the custom checkbox using the above code present in your github. But i am not able to display a danamojo donate button after clicking the checkbox. It should display it in donation receipt after submitting and should also save in database. For example, if a user or donor is an Indian, then he will check the checkbox and then the button will gets displayed below the checkbox. Then he will pay the donation amount. After that the donation amount and the Indian value in the checkbox should be saved and displayed in the donation receipt. The checkbox should be added after phone number text box. Thank you.
Add Comment
Please, Sign In to add comment