edd_agree_to_terms_js

Outputs the JavaScript code for the Agree to Terms section to toggle the T&Cs text.

Description

edd_agree_to_terms_js(); 

Usage

  1. if ( !function_exists( 'edd_agree_to_terms_js' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'easy-digital-downloads/includes/checkout/template.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = edd_agree_to_terms_js(); 
  7.  

Defined (1)

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

/includes/checkout/template.php  
  1. function edd_agree_to_terms_js() { 
  2. if ( edd_get_option( 'show_agree_to_terms', false ) ) { 
  3. ?> 
  4. <script type="text/javascript"> 
  5. jQuery(document).ready(function($) { 
  6. $( document.body ).on('click', '.edd_terms_links', function(e) { 
  7. //e.preventDefault(); 
  8. $('#edd_terms').slideToggle(); 
  9. $('.edd_terms_links').toggle(); 
  10. return false; 
  11. }); 
  12. }); 
  13. </script> 
  14. <?php