Version Description
Download this release
Release Info
| Developer | wpdevteam |
| Plugin | |
| Version | 3.4.1 |
| Comparing to | |
| See all releases | |
Code changes from version 3.4.0 to 3.4.1
- EmbedPress/Shortcode.php +41 -7
- embedpress.php +1 -1
- includes.php +1 -1
- readme.txt +4 -1
EmbedPress/Shortcode.php
CHANGED
|
@@ -4,6 +4,7 @@ namespace EmbedPress;
|
|
| 4 |
|
| 5 |
use Embera\Embera;
|
| 6 |
use Embera\ProviderCollection\DefaultProviderCollection;
|
|
|
|
| 7 |
use WP_oEmbed;
|
| 8 |
|
| 9 |
( defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' ) ) or die( "No direct script access allowed." );
|
|
@@ -773,18 +774,51 @@ KAMAL;
|
|
| 773 |
'powered_by' => 'no',
|
| 774 |
];
|
| 775 |
$attributes = wp_parse_args( $attributes, $default );
|
| 776 |
-
$pdf = new \EmbedPress\Elementor\Widgets\Embedpress_Pdf();
|
| 777 |
$url = preg_replace( '/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
|
| 778 |
"", $subject );
|
| 779 |
-
$settings = [
|
| 780 |
-
'embedpress_elementor_document_width' => ['size' => $attributes['width']],
|
| 781 |
-
'embedpress_elementor_document_height' => ['size' => $attributes['height']],
|
| 782 |
-
'embedpress_pdf_powered_by' => $attributes['powered_by'],
|
| 783 |
-
];
|
| 784 |
|
| 785 |
ob_start();
|
| 786 |
-
$pdf->_render($url, $settings, 'sdfg');
|
| 787 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 788 |
return ob_get_clean();
|
| 789 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 790 |
}
|
| 4 |
|
| 5 |
use Embera\Embera;
|
| 6 |
use Embera\ProviderCollection\DefaultProviderCollection;
|
| 7 |
+
use EmbedPress\Includes\Classes\Helper;
|
| 8 |
use WP_oEmbed;
|
| 9 |
|
| 10 |
( defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' ) ) or die( "No direct script access allowed." );
|
| 774 |
'powered_by' => 'no',
|
| 775 |
];
|
| 776 |
$attributes = wp_parse_args( $attributes, $default );
|
|
|
|
| 777 |
$url = preg_replace( '/(\[' . EMBEDPRESS_SHORTCODE . '(?:\]|.+?\])|\[\/' . EMBEDPRESS_SHORTCODE . '\])/i',
|
| 778 |
"", $subject );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 779 |
|
| 780 |
ob_start();
|
|
|
|
| 781 |
|
| 782 |
+
$id = 'embedpress-pdf-shortcode';
|
| 783 |
+
$dimension = "width: {$attributes['width']}px;height: {$attributes['height']}px";
|
| 784 |
+
?>
|
| 785 |
+
<div class="embedpress-document-embed ose-document <?php echo 'ep-doc-'.md5( $id);?>" style="<?php echo esc_attr( $dimension); ?>; max-width:100%; display: inline-block">
|
| 786 |
+
<?php if ( $url != '' ) {
|
| 787 |
+
if ( self::is_pdf( $url ) && ! self::is_external_url( $url) ) {
|
| 788 |
+
$renderer = Helper::get_pdf_renderer();
|
| 789 |
+
$src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . $url;
|
| 790 |
+
?>
|
| 791 |
+
<iframe style="<?php echo esc_attr( $dimension); ?>; max-width:100%; display: inline-block" data-emsrc="<?php echo esc_attr( $url); ?>" data-emid="<?php echo esc_attr( $id); ?>" class="embedpress-embed-document-pdf <?php echo esc_attr( $id); ?>" src="<?php echo esc_attr( $src); ?>"
|
| 792 |
+
frameborder="0"></iframe>
|
| 793 |
+
<?php
|
| 794 |
+
|
| 795 |
+
} else {
|
| 796 |
+
?>
|
| 797 |
+
<div>
|
| 798 |
+
<iframe allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true" style="<?php echo esc_attr( $dimension); ?>; max-width:100%;" src="<?php echo esc_url( $url); ?>" data-emsrc="<?php echo esc_attr( $url); ?>" data-emid="<?php echo esc_attr( $id); ?>" class="embedpress-embed-document-pdf <?php echo esc_attr( $id); ?>"></iframe>
|
| 799 |
+
</div>
|
| 800 |
+
|
| 801 |
+
<?php
|
| 802 |
+
}
|
| 803 |
+
if ( $attributes['powered_by'] === 'yes' ) {
|
| 804 |
+
|
| 805 |
+
printf( '<p class="embedpress-el-powered">%s</p>', __( 'Powered By EmbedPress', 'embedpress' ) );
|
| 806 |
+
}
|
| 807 |
+
}
|
| 808 |
+
?>
|
| 809 |
+
</div>
|
| 810 |
+
|
| 811 |
+
<?php
|
| 812 |
return ob_get_clean();
|
| 813 |
}
|
| 814 |
+
|
| 815 |
+
protected static function is_external_url( $url ) {
|
| 816 |
+
return strpos( $url, get_site_url()) === false;
|
| 817 |
+
}
|
| 818 |
+
|
| 819 |
+
protected static function is_pdf( $url )
|
| 820 |
+
{
|
| 821 |
+
$arr = explode( '.', $url );
|
| 822 |
+
return end( $arr ) === 'pdf';
|
| 823 |
+
}
|
| 824 |
}
|
embedpress.php
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* Description: EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 100+ sources supported.
|
| 6 |
* Author: WPDeveloper
|
| 7 |
* Author URI: https://wpdeveloper.com
|
| 8 |
-
* Version: 3.4.
|
| 9 |
* Text Domain: embedpress
|
| 10 |
* Domain Path: /languages
|
| 11 |
*
|
| 5 |
* Description: EmbedPress lets you embed videos, images, posts, audio, maps and upload PDF, DOC, PPT & all other types of content into your WordPress site with one-click and showcase it beautifully for the visitors. 100+ sources supported.
|
| 6 |
* Author: WPDeveloper
|
| 7 |
* Author URI: https://wpdeveloper.com
|
| 8 |
+
* Version: 3.4.1
|
| 9 |
* Text Domain: embedpress
|
| 10 |
* Domain Path: /languages
|
| 11 |
*
|
includes.php
CHANGED
|
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
|
|
| 22 |
}
|
| 23 |
|
| 24 |
if ( ! defined('EMBEDPRESS_VERSION')) {
|
| 25 |
-
define('EMBEDPRESS_VERSION', "3.4.
|
| 26 |
/**
|
| 27 |
* @deprecated 2.2.0
|
| 28 |
*/
|
| 22 |
}
|
| 23 |
|
| 24 |
if ( ! defined('EMBEDPRESS_VERSION')) {
|
| 25 |
+
define('EMBEDPRESS_VERSION', "3.4.1");
|
| 26 |
/**
|
| 27 |
* @deprecated 2.2.0
|
| 28 |
*/
|
readme.txt
CHANGED
|
@@ -6,7 +6,7 @@ Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embe
|
|
| 6 |
Requires at least: 4.6
|
| 7 |
Tested up to: 6.0
|
| 8 |
Requires PHP: 5.6
|
| 9 |
-
Stable tag: 3.4.
|
| 10 |
License: GPLv3 or later
|
| 11 |
License URI: https://opensource.org/licenses/GPL-3.0
|
| 12 |
|
|
@@ -382,6 +382,9 @@ Not at all. You can set up everything your team needs without any coding knowled
|
|
| 382 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
| 383 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
| 384 |
|
|
|
|
|
|
|
|
|
|
| 385 |
= [3.4.0] - 2022-06-07 =
|
| 386 |
* Added: PDF embedding support in Classic and other editors.
|
| 387 |
* Fixed: Meetup layout breaking issues.
|
| 6 |
Requires at least: 4.6
|
| 7 |
Tested up to: 6.0
|
| 8 |
Requires PHP: 5.6
|
| 9 |
+
Stable tag: 3.4.1
|
| 10 |
License: GPLv3 or later
|
| 11 |
License URI: https://opensource.org/licenses/GPL-3.0
|
| 12 |
|
| 382 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
| 383 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
| 384 |
|
| 385 |
+
= [3.4.1] - 2022-06-07 =
|
| 386 |
+
* Fixed: Fatal error if Elementor editor is deactivated.
|
| 387 |
+
|
| 388 |
= [3.4.0] - 2022-06-07 =
|
| 389 |
* Added: PDF embedding support in Classic and other editors.
|
| 390 |
* Fixed: Meetup layout breaking issues.
|
