# ablocks/2.9.0/includes/frontend/dynamic-content/interpreters/image.php

aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder &amp; Animation Builder, version 2.9.0. 38 lines.

- Page: https://pluginprobe.com/plugins/ablocks/2.9.0/code/includes/frontend/dynamic-content/interpreters/image.php
- Raw: https://pluginprobe.com/plugins/ablocks/2.9.0/raw/includes/frontend/dynamic-content/interpreters/image.php
- Modified: 2025-04-09T16:19:26+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/ablocks/2.9.0/code/includes/frontend/dynamic-content/interpreters/image.php#L10-L20`.

```php
<?php
namespace ABlocks\Frontend\DynamicContent\Interpreters;

use ABlocks\Helper;
if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
class Image extends Abstracts\Interpreter {
	protected string $field;

	public function __construct( string $name, array $setting, bool $is_richtext = false ) {
		parent::__construct( $name, $setting, $is_richtext );
		$this->field   = strval( $this->setting[0] ?? '' );
	}
	public function content() : string {

		switch ( $this->field ) {
			case 'featured-image':
				$this->content = get_the_post_thumbnail_url( get_the_ID(), 'full' );
				break;

			case 'site-logo':
				$this->content = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' )[0] ?? '';
				break;

			case 'author-profile-picture':
				$author_id = get_post_field( 'post_author', get_the_ID() );
				$this->content = get_avatar_url( $author_id );
				break;

			case 'user-profile-picture':
				$this->content = is_user_logged_in() ? get_avatar_url( get_current_user_id() ) : '';
				break;
		}
		return $this->content;
	}
}

```
