version_check()) {
$img_ids = $product->get_gallery_image_ids();
}
else {
$img_ids = $product->get_gallery_attachment_ids();
}
if (!essb_option_bool_value('sso_deactivate_woogallery')) {
if ( is_array( $img_ids ) && $img_ids !== array() ) {
foreach ( $img_ids as $img_id ) {
$img_url = wp_get_attachment_url( $img_id );
$this->og_tag('og:image', $img_url );
}
}
}
/**
* Filter: essb_woocommerce_og_price - Allow developers to prevent the output of the price in the OpenGraph tags
*
* @api bool unsigned Defaults to true.
*/
if ( apply_filters( 'essb_woocommerce_og_price', true ) ) {
echo '\n";
echo '\n";
}
if ( $product->is_in_stock() ) {
echo '' . "\n";
}
}
public function version_check( $version = '3.0' ) {
if ( class_exists( 'WooCommerce' ) ) {
global $woocommerce;
if ( version_compare( $woocommerce->version, $version, ">=" ) ) {
return true;
}
}
return false;
}
/**
* Generate single open graph tag inside page content
*
* @param string $property
* @param string $content
* @return boolean
*/
public function og_tag( $property, $content ) {
$og_property = str_replace( ':', '_', $property );
$content = apply_filters( 'essb_og_' . $og_property, $content );
if ( empty( $content ) ) {
return false;
}
echo '', "\n";
return true;
}
}