# photonic/3.33/Components/Grid_Image.php

Photonic Gallery &amp; Lightbox for Flickr, SmugMug &amp; Others, version 3.33. 34 lines.

- Page: https://pluginprobe.com/plugins/photonic/3.33/code/Components/Grid_Image.php
- Raw: https://pluginprobe.com/plugins/photonic/3.33/raw/Components/Grid_Image.php
- Modified: 2026-07-10T18:22:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/photonic/3.33/code/Components/Grid_Image.php#L10-L20`.

```php
<?php

namespace Photonic_Plugin\Components;

use Photonic_Plugin\Core\Photonic;
use Photonic_Plugin\Layouts\Core_Layout;
use Photonic_Plugin\Platforms\Base;

require_once 'Grid_Anchor.php';

class Grid_Image implements Printable {
	public string $alt = '';
	public string $src_attr = 'src';
	public string $src = '';
	public array $classes = [];
	public array $dimensions = [];
	public string $lazy_load;

	public function html(Base $module, Core_Layout $layout, $print = false): string { // phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter
		$img_dim = '';
		if (!empty($this->dimensions) && !empty($this->dimensions['w']) && !empty($this->dimensions['h'])) {
			$img_dim = " width='{$this->dimensions['w']}' height='{$this->dimensions['h']}'";
		}
		$alt = esc_attr($this->alt);
		$classes = esc_attr(implode(' ', $this->classes));

		$ret = "<img alt='$alt' class='$classes' {$this->src_attr}='" . esc_url($this->src) . "' loading='{$this->lazy_load}' $img_dim />";
		if ($print) {
			echo wp_kses($ret, Photonic::$safe_tags);
		}
		return wp_kses($ret, Photonic::$safe_tags);
	}
}

```
