plugin updates
This commit is contained in:
@@ -210,6 +210,8 @@ class WpmfPdfEmbed
|
||||
$plugin_dir_url = plugin_dir_url(__DIR__);
|
||||
$viewer_base_url = $plugin_dir_url . 'class/templates/pdf-embed.php';
|
||||
|
||||
$remove_items = apply_filters('wpmf_pdf_embed_remove_button', false);
|
||||
|
||||
$response = wp_remote_head($url);
|
||||
if (is_wp_error($response)) {
|
||||
$url = $plugin_dir_url . 'assets/pdf-loading-error.pdf';
|
||||
@@ -222,6 +224,11 @@ class WpmfPdfEmbed
|
||||
|
||||
$attachment_info = '?file=' . urlencode($url);
|
||||
$final_url = $viewer_base_url . $attachment_info . '&plugins_url=' . urlencode($plugin_dir_url);
|
||||
if (!empty($remove_items) && is_array($remove_items)) {
|
||||
$remove_items = implode(',', $remove_items);
|
||||
$remove_items = urlencode($remove_items);
|
||||
$final_url .= '&remove_items='.$remove_items;
|
||||
}
|
||||
$return = '<div><iframe width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" src="' . esc_url($final_url) . '" title="Embedded PDF" class="wpmf-pdfjs-iframe"></iframe></div>';
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user