-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
display image in better way #607
base: main
Are you sure you want to change the base?
Conversation
$html .= !empty($attachment['icon']) ? '<img src="' . $attachment['icon'] . '" />' : ''; | ||
$html .= '<span>' . $attachment['name'] . '</span>'; | ||
if (isset($attachment['mime']) && strpos($attachment['mime'], 'image') !== false) { | ||
$html .= !empty($attachment['icon']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth moving !empty($attachment['icon'])
to line 990
$html .= !empty($attachment['icon']) | ||
? '<img src="' . | ||
$attachment['icon'] . | ||
'" style="max-height: 240px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we please add a class for this instead of inline styling?
includes/events/event-builder.php
Outdated
@@ -987,8 +987,18 @@ private function get_attachments($attachments) | |||
foreach ($attachments as $attachment) { | |||
$html .= '<li class="simcal-attachment">'; | |||
$html .= '<a href="' . $attachment['url'] . '" target="_blank">'; | |||
$html .= !empty($attachment['icon']) ? '<img src="' . $attachment['icon'] . '" />' : ''; | |||
$html .= '<span>' . $attachment['name'] . '</span>'; | |||
if (isset($attachment['mime']) && strpos($attachment['mime'], 'image') !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this part to a new shortcode cover_image
includes/events/event-builder.php
Outdated
@@ -987,8 +987,18 @@ private function get_attachments($attachments) | |||
foreach ($attachments as $attachment) { | |||
$html .= '<li class="simcal-attachment">'; | |||
$html .= '<a href="' . $attachment['url'] . '" target="_blank">'; | |||
$html .= !empty($attachment['icon']) ? '<img src="' . $attachment['icon'] . '" />' : ''; | |||
$html .= '<span>' . $attachment['name'] . '</span>'; | |||
if (isset($attachment['mime']) && strpos($attachment['mime'], 'image') !== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do test if it does not run on core plugin since we can't have drive access there
$response_arr = json_decode($response, true); | ||
|
||
if (isset($response_arr['response']) && !empty($response_arr['response'])) { | ||
if ($response_arr['response']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems irrelevant condition
]; | ||
return $response; | ||
} | ||
$response = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need since it will be unreachable code
$send_data = [ | ||
'site_url' => self::$my_site_url, | ||
'auth_token' => get_option('simple_calendar_auth_site_token'), | ||
'arguments' => $args, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'arguments' => $args, | |
'arguments' => [ | |
'attachments' => $args['attachments'] | |
], |
Description: Display event attahcment image in better way by showing image rather then just name and link.
Clickup: https://app.clickup.com/t/86cxwtak1
Before & after: https://www.screenpresso.com/=HG0kuVJR8zzv