wc_gzd_get_legal_text

The WooCommerce Germanized wc gzd get legal text function.

Description

wc_gzd_get_legal_text( (string) $text = '' ); 

Parameters (1)

0. $text — Optional. (string) => ''
The text.

Usage

  1. if ( !function_exists( 'wc_gzd_get_legal_text' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-germanized/includes/wc-gzd-cart-functions.php'; 
  3.  
  4. // The text. 
  5. $text = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wc_gzd_get_legal_text($text); 
  9.  

Defined (1)

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

/includes/wc-gzd-cart-functions.php  
  1. function wc_gzd_get_legal_text( $text = '' ) { 
  2. $plain_text = ( $text == '' ? get_option( 'woocommerce_gzd_checkout_legal_text' ) : $text ); 
  3. if ( ! empty( $plain_text ) ) { 
  4. $plain_text = str_replace(  
  5. array( '{term_link}', '{data_security_link}', '{revocation_link}', '{/term_link}', '{/data_security_link}', '{/revocation_link}' ),  
  6. array(  
  7. '<a href="' . esc_url( wc_gzd_get_page_permalink( 'terms' ) ) . '" target="_blank">',  
  8. '<a href="' . esc_url( wc_gzd_get_page_permalink( 'data_security' ) ) . '" target="_blank">',  
  9. '<a href="' . esc_url( wc_gzd_get_page_permalink( 'revocation' ) ) . '" target="_blank">',  
  10. '</a>',  
  11. '</a>',  
  12. '</a>',  
  13. ),  
  14. $plain_text  
  15. ); 
  16. return $plain_text;