-
Notifications
You must be signed in to change notification settings - Fork 1
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
Private files preview and google drawings support #8
base: custom-oembed-provider
Are you sure you want to change the base?
Conversation
abhishekfdd
commented
Nov 4, 2020
- Fixes Preview for private files
- Adds google drawings embed support
$basedir = ''; | ||
$baseurl = ''; | ||
|
||
$file_id = $this->get_file_id_from_url( $url ); |
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.
Indentation. =
should align with =
below.
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.
Check this at all instances
$baseurl = ''; | ||
|
||
$file_id = $this->get_file_id_from_url( $url ); | ||
$cached_data = $this->get_cached_data_from_file_id( $file_id ); |
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.
We're already getting cached file URL in get_thumbnail_url
function, then why do we need this code again? $thumbnail_url
itself is a cached URL here if the file is cached.
</a> | ||
<img src="<?php echo esc_url( $thumbnail_url ); ?>" alt="<?php esc_attr_e( 'Shared Document Preview', 'rt-google-embeds' ); ?>" style="border: 1px solid #eee; margin: 15px auto; display: block;" /> | ||
</div> | ||
if ( file_exists( $cached_file ) ) : ?> |
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.
This is not supposed to be done here. Do this before calling render_embed
function and pass only 1 URL here. That URL will be used here directly.
@abhishekfdd We will only pass |