'size', 'type' => 'select', 'label' => __('Size', 'zadex'), 'default' => 'full', 'options' => [ ['value' => 'thumbnail', 'label' => __('Thumbnail', 'zadex')], ['value' => 'medium', 'label' => __('Medium', 'zadex')], ['value' => 'large', 'label' => __('Large', 'zadex')], ['value' => 'full', 'label' => __('Full', 'zadex')], ]], ]; } public function render(array $settings, Context $ctx) { if ($ctx->post_id <= 0) { return ''; } $id = (int) get_post_thumbnail_id($ctx->post_id); if ($id <= 0) { return ''; } $size = in_array($settings['size'] ?? 'full', ['thumbnail', 'medium', 'large', 'full'], true) ? $settings['size'] : 'full'; return (string) wp_get_attachment_image_url($id, $size); } }