aiwoo_shortcode_cart

The WooCommerce Menu Extension aiwoo shortcode cart function.

Description

aiwoo_shortcode_cart( $atts, (null) $content = null ); 

Parameters (2)

0. $atts
The atts.
1. $content — Optional. (null) => null
The content.

Usage

  1. if ( !function_exists( 'aiwoo_shortcode_cart' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-menu-extension/include/frontend.inc.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // The content. 
  8. $content = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = aiwoo_shortcode_cart($atts, $content); 
  12.  

Defined (1)

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

/include/frontend.inc.php  
  1. function aiwoo_shortcode_cart( $atts, $content = null ) { 
  2. global $woocommerce; 
  3. extract(shortcode_atts(array( 
  4. "edit_tag" => "" 
  5. ), $atts ) ); 
  6.  
  7. $edit_tag = esc_html( strip_tags( $edit_tag ) ); 
  8. $href = get_permalink( woocommerce_get_page_id( 'cart' ) ); 
  9. $content = $content != '' ? $content : __( 'Cart' ); 
  10. return '<a href="' . esc_url( $href ) . '"' .$edit_tag . '>' . $content . '</a>';