Guest User

Untitled

a guest
Dec 11th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: GF-webinar-order
  4. Description: get product data and add to gravity form based on disease selection of user
  5. Developer: Eyal Ron
  6. version: 1.0
  7. */
  8.  
  9. //gravity forms variables
  10. $formIDArray = array('144');
  11. //Gform data
  12. foreach ($formIDArray as $id) {
  13. add_action( 'gform_enqueue_scripts_'.$id, 'getProductData', 10, 2 );
  14. }
  15.  
  16. function add_stylesheet()
  17. {
  18. wp_enqueue_style( 'webinar-GF-create-order.css', plugins_url( '/css/webinar-GF-create-order.css', __FILE__ ) );
  19. }
  20. add_action( 'wp_enqueue_scripts', 'add_stylesheet' );
  21.  
  22. /* functions definition */
  23.  
  24. //run function on form looaded
  25.  
  26. function getProductData(){
  27. wp_enqueue_script( 'webinar-GF-main.js', plugins_url( '/inc/main.js', __FILE__ ) );
  28. }
Add Comment
Please, Sign In to add comment