HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.30
System: Linux iZj6c1151k3ad370bosnmsZ 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User: root (0)
PHP: 7.4.30
Disabled: NONE
Upload Files
File: /var/www/html/breadsecret.com/wp-content/plugins/woothumbs-premium/inc/class-shortcodes.php
<?php
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * Iconic_WooThumbs_Shortcodes.
 *
 * @class    Iconic_WooThumbs_Shortcodes
 * @version  1.0.0
 * @package  Iconic_WooThumbs
 * @category Class
 * @author   Iconic
 */
class Iconic_WooThumbs_Shortcodes {
	/*
	 * Init shortcodes
	 */
	public static function run() {
		if ( is_admin() && ! wp_doing_ajax() ) {
			return;
		}

		add_shortcode( 'woothumbs-gallery', array( __CLASS__, 'gallery' ) );
	}

	public static function gallery( $atts ) {
		global $post, $iconic_woothumbs_class;

		$atts = shortcode_atts( array(
			'id' => false,
		), $atts, 'woothumbs-gallery' );

		$atts['id'] = $atts['id'] ? $atts['id'] : $post->ID;

		if ( ! $atts['id'] ) {
			return;
		}

		ob_start();

		$post_object = get_post( $atts['id'] );

		if ( ! $post_object ) {
			return;
		}

		$GLOBALS['post'] =& $post_object;

		setup_postdata( $GLOBALS['post'] );

		$iconic_woothumbs_class->show_product_images();

		wp_reset_postdata();

		return ob_get_clean();
	}
}