wc_placeholder_img

Get the placeholder image.

Description

(string) wc_placeholder_img( (string) $size = 'shop_thumbnail' ); 

Returns (string)

Parameters (1)

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

Usage

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

Defined (1)

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

/includes/wc-product-functions.php  
  1. function wc_placeholder_img( $size = 'shop_thumbnail' ) { 
  2. $dimensions = wc_get_image_size( $size ); 
  3.  
  4. return apply_filters( 'woocommerce_placeholder_img', '<img src="' . wc_placeholder_img_src() . '" alt="' . esc_attr__( 'Placeholder', woocommerce ) . '" width="' . esc_attr( $dimensions['width'] ) . '" class="woocommerce-placeholder wp-post-image" height="' . esc_attr( $dimensions['height'] ) . '" />', $size, $dimensions );