Version Description
Download this release
Release Info
Developer | Asif2BD |
Plugin | EmbedPress – Embed Google Docs, YouTube, Maps, Vimeo, Wistia Videos & Upload PDF, PPT in Gutenberg & Elementor |
Version | 3.1.0 |
Comparing to | |
See all releases |
Code changes from version 3.0.4 to 3.1.0
- EmbedPress/Core.php +11 -49
- EmbedPress/CoreLegacy.php +4 -52
- EmbedPress/Elementor/Embedpress_Elementor_Integration.php +11 -6
- EmbedPress/Elementor/Widgets/Embedpress_Elementor.php +1252 -117
- EmbedPress/Ends/Back/Handler.php +29 -2
- EmbedPress/Ends/Back/Settings.php +0 -279
- EmbedPress/Ends/Back/Settings/EmbedpressSettings.php +43 -7
- EmbedPress/Ends/Back/Settings/assets/img/dailymotion.svg +1 -0
- EmbedPress/Ends/Back/Settings/assets/img/soundcloud.svg +73 -0
- EmbedPress/Ends/Back/Settings/templates/custom-logo.php +0 -1
- EmbedPress/Ends/Back/Settings/templates/dailymotion.php +158 -0
- EmbedPress/Ends/Back/Settings/templates/partials/sidebar.php +12 -0
- EmbedPress/Ends/Back/Settings/templates/soundcloud.php +192 -0
- EmbedPress/Includes/Classes/Elementor_Enhancer.php +528 -0
- EmbedPress/Includes/Classes/Feature_Enhancer.php +194 -13
- EmbedPress/Plugins/Html/Field.php +0 -182
- EmbedPress/Plugins/Html/index.html +0 -9
- EmbedPress/Plugins/Plugin.php +3 -136
- EmbedPress/Shortcode.php +14 -3
- EmbedPress/simple_html_dom.php +23 -3
- Gutenberg/dist/blocks.editor.build.css +1 -1
- PROVIDERS.md +1 -1
- assets/css/el-icon.css +24 -0
- assets/css/embedpress-elementor.css +258 -1
- assets/css/embedpress.css +255 -0
- assets/js/preview.js +2 -2
- embedpress.php +36 -40
- includes.php +49 -1
- readme.txt +9 -2
EmbedPress/Core.php
CHANGED
@@ -128,11 +128,6 @@ class Core {
|
|
128 |
new EmbedpressSettings();
|
129 |
$plgSettings = self::getSettings();
|
130 |
$this->admin_notice();
|
131 |
-
//$settingsClassNamespace = '\\EmbedPress\\Ends\\Back\\Settings';
|
132 |
-
//add_action('admin_menu', [$settingsClassNamespace, 'registerMenuItem']);
|
133 |
-
//add_action('admin_init', [$settingsClassNamespace, 'registerActions']);
|
134 |
-
//unset($settingsClassNamespace);
|
135 |
-
|
136 |
add_filter('plugin_action_links_embedpress/embedpress.php', ['\\EmbedPress\\Core', 'handleActionLinks'], 10,
|
137 |
2);
|
138 |
|
@@ -141,7 +136,7 @@ class Core {
|
|
141 |
|
142 |
$plgHandlerAdminInstance = new EndHandlerAdmin($this->getPluginName(), $this->getPluginVersion());
|
143 |
|
144 |
-
if (
|
145 |
$this->loaderInstance->add_action('admin_enqueue_scripts', $plgHandlerAdminInstance, 'enqueueScripts');
|
146 |
}
|
147 |
} else {
|
@@ -376,7 +371,12 @@ class Core {
|
|
376 |
*
|
377 |
*/
|
378 |
public static function onPluginActivationCallback () {
|
|
|
|
|
|
|
|
|
379 |
flush_rewrite_rules();
|
|
|
380 |
}
|
381 |
|
382 |
/**
|
@@ -389,6 +389,11 @@ class Core {
|
|
389 |
*/
|
390 |
public static function onPluginDeactivationCallback () {
|
391 |
flush_rewrite_rules();
|
|
|
|
|
|
|
|
|
|
|
392 |
}
|
393 |
|
394 |
/**
|
@@ -476,49 +481,6 @@ class Core {
|
|
476 |
return (object) $settings;
|
477 |
}
|
478 |
|
479 |
-
/**
|
480 |
-
* Method that register an EmbedPress plugin.
|
481 |
-
*
|
482 |
-
* @param array $pluginMeta Associative array containing plugin's name, slug and namespace
|
483 |
-
*
|
484 |
-
* @return void
|
485 |
-
* @since 1.4.0
|
486 |
-
* @static
|
487 |
-
*
|
488 |
-
*/
|
489 |
-
public static function registerPlugin ($pluginMeta) {
|
490 |
-
$pluginMeta = json_decode(json_encode($pluginMeta));
|
491 |
-
|
492 |
-
if (empty($pluginMeta->name) || empty($pluginMeta->slug) || empty($pluginMeta->namespace)) {
|
493 |
-
return;
|
494 |
-
}
|
495 |
-
|
496 |
-
if (!isset(self::$plugins[$pluginMeta->slug])) {
|
497 |
-
AutoLoader::register($pluginMeta->namespace,
|
498 |
-
WP_PLUGIN_DIR.'/'.EMBEDPRESS_PLG_NAME.'-'.$pluginMeta->slug.'/'.$pluginMeta->name);
|
499 |
-
|
500 |
-
$plugin = "{$pluginMeta->namespace}\Plugin";
|
501 |
-
if (\defined("{$plugin}::SLUG") && $plugin::SLUG !== null) {
|
502 |
-
self::$plugins[$pluginMeta->slug] = $pluginMeta->namespace;
|
503 |
-
|
504 |
-
$bsFilePath = $plugin::PATH.EMBEDPRESS_PLG_NAME.'-'.$plugin::SLUG.'.php';
|
505 |
-
|
506 |
-
register_activation_hook($bsFilePath, [$plugin::NAMESPACE_STRING, 'onActivationCallback']);
|
507 |
-
register_deactivation_hook($bsFilePath, [$plugin::NAMESPACE_STRING, 'onDeactivationCallback']);
|
508 |
-
|
509 |
-
add_action('admin_init', [$plugin, 'onLoadAdminCallback']);
|
510 |
-
|
511 |
-
add_action(EMBEDPRESS_PLG_NAME.':'.$plugin::SLUG.':settings:register',
|
512 |
-
[$plugin, 'registerSettings']);
|
513 |
-
add_action(EMBEDPRESS_PLG_NAME.':settings:render:tab', [$plugin, 'renderTab']);
|
514 |
-
|
515 |
-
add_filter('plugin_action_links_embedpress-'.$plugin::SLUG.'/embedpress-'.$plugin::SLUG.'.php',
|
516 |
-
[$plugin, 'handleActionLinks'], 10, 2);
|
517 |
-
|
518 |
-
$plugin::registerEvents();
|
519 |
-
}
|
520 |
-
}
|
521 |
-
}
|
522 |
|
523 |
/**
|
524 |
* Retrieve all registered plugins.
|
128 |
new EmbedpressSettings();
|
129 |
$plgSettings = self::getSettings();
|
130 |
$this->admin_notice();
|
|
|
|
|
|
|
|
|
|
|
131 |
add_filter('plugin_action_links_embedpress/embedpress.php', ['\\EmbedPress\\Core', 'handleActionLinks'], 10,
|
132 |
2);
|
133 |
|
136 |
|
137 |
$plgHandlerAdminInstance = new EndHandlerAdmin($this->getPluginName(), $this->getPluginVersion());
|
138 |
|
139 |
+
if ( $plgSettings->enablePluginInAdmin ) {
|
140 |
$this->loaderInstance->add_action('admin_enqueue_scripts', $plgHandlerAdminInstance, 'enqueueScripts');
|
141 |
}
|
142 |
} else {
|
371 |
*
|
372 |
*/
|
373 |
public static function onPluginActivationCallback () {
|
374 |
+
$dirname = wp_get_upload_dir()['basedir'].'/embedpress';
|
375 |
+
if (!file_exists($dirname)) {
|
376 |
+
mkdir($dirname, 0777);
|
377 |
+
}
|
378 |
flush_rewrite_rules();
|
379 |
+
embedpress_schedule_cache_cleanup();
|
380 |
}
|
381 |
|
382 |
/**
|
389 |
*/
|
390 |
public static function onPluginDeactivationCallback () {
|
391 |
flush_rewrite_rules();
|
392 |
+
embedpress_cache_cleanup();
|
393 |
+
$timestamp = wp_next_scheduled( 'embedpress_backup_cleanup_action' );
|
394 |
+
if ( $timestamp ) {
|
395 |
+
wp_unschedule_event( $timestamp, 'embedpress_backup_cleanup_action' );
|
396 |
+
}
|
397 |
}
|
398 |
|
399 |
/**
|
481 |
return (object) $settings;
|
482 |
}
|
483 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
484 |
|
485 |
/**
|
486 |
* Retrieve all registered plugins.
|
EmbedPress/CoreLegacy.php
CHANGED
@@ -5,6 +5,7 @@ namespace EmbedPress;
|
|
5 |
use EmbedPress\Ends\Back\Handler as EndHandlerAdmin;
|
6 |
use EmbedPress\Ends\Back\Settings\EmbedpressSettings;
|
7 |
use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
|
|
|
8 |
|
9 |
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
10 |
|
@@ -19,7 +20,7 @@ use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
|
|
19 |
*/
|
20 |
class CoreLegacy
|
21 |
{
|
22 |
-
use
|
23 |
/**
|
24 |
* The name of the plugin.
|
25 |
*
|
@@ -126,23 +127,18 @@ class CoreLegacy
|
|
126 |
new EmbedpressSettings();
|
127 |
$plgSettings = self::getSettings();
|
128 |
$this->admin_notice();
|
129 |
-
//$settingsClassNamespace = '\\EmbedPress\\Ends\\Back\\Settings';
|
130 |
-
//add_action('admin_menu', [$settingsClassNamespace, 'registerMenuItem']);
|
131 |
-
//add_action('admin_init', [$settingsClassNamespace, 'registerActions']);
|
132 |
-
//unset($settingsClassNamespace);
|
133 |
|
134 |
add_filter('plugin_action_links_embedpress/embedpress.php',
|
135 |
['\\EmbedPress\\CoreLegacy', 'handleActionLinks'], 10, 2);
|
136 |
|
137 |
add_action('admin_enqueue_scripts', ['\\EmbedPress\\Ends\\Back\\Handler', 'enqueueStyles']);
|
138 |
add_action('wp_ajax_embedpress_notice_dismiss', ['\\EmbedPress\\Ends\\Back\\Handler', 'embedpress_notice_dismiss']);
|
139 |
-
|
140 |
add_action('init', ['\\EmbedPress\\DisablerLegacy', 'run'], 1);
|
141 |
add_action('init', [$this, 'configureTinyMCE'], 1);
|
142 |
|
143 |
$plgHandlerAdminInstance = new EndHandlerAdmin($this->getPluginName(), $this->getPluginVersion());
|
144 |
|
145 |
-
if (
|
146 |
$this->loaderInstance->add_action('admin_enqueue_scripts', $plgHandlerAdminInstance, 'enqueueScripts');
|
147 |
}
|
148 |
|
@@ -285,50 +281,6 @@ class CoreLegacy
|
|
285 |
return (object)$settings;
|
286 |
}
|
287 |
|
288 |
-
/**
|
289 |
-
* Method that register an EmbedPress plugin.
|
290 |
-
*
|
291 |
-
* @since 1.4.0
|
292 |
-
* @static
|
293 |
-
*
|
294 |
-
* @param array $pluginMeta Associative array containing plugin's name, slug and namespace
|
295 |
-
*
|
296 |
-
* @return void
|
297 |
-
*/
|
298 |
-
public static function registerPlugin($pluginMeta)
|
299 |
-
{
|
300 |
-
$pluginMeta = json_decode(json_encode($pluginMeta));
|
301 |
-
|
302 |
-
if (empty($pluginMeta->name) || empty($pluginMeta->slug) || empty($pluginMeta->namespace)) {
|
303 |
-
return;
|
304 |
-
}
|
305 |
-
|
306 |
-
if ( ! isset(self::$plugins[$pluginMeta->slug])) {
|
307 |
-
AutoLoader::register($pluginMeta->namespace,
|
308 |
-
WP_PLUGIN_DIR . '/' . EMBEDPRESS_PLG_NAME . '-' . $pluginMeta->slug . '/' . $pluginMeta->name);
|
309 |
-
|
310 |
-
$plugin = "{$pluginMeta->namespace}\Plugin";
|
311 |
-
if (\defined("{$plugin}::SLUG") && $plugin::SLUG !== null) {
|
312 |
-
self::$plugins[$pluginMeta->slug] = $pluginMeta->namespace;
|
313 |
-
|
314 |
-
$bsFilePath = $plugin::PATH . EMBEDPRESS_PLG_NAME . '-' . $plugin::SLUG . '.php';
|
315 |
-
|
316 |
-
register_activation_hook($bsFilePath, [$plugin::NAMESPACE_STRING, 'onActivationCallback']);
|
317 |
-
register_deactivation_hook($bsFilePath, [$plugin::NAMESPACE_STRING, 'onDeactivationCallback']);
|
318 |
-
|
319 |
-
add_action('admin_init', [$plugin, 'onLoadAdminCallback']);
|
320 |
-
|
321 |
-
add_action(EMBEDPRESS_PLG_NAME . ':' . $plugin::SLUG . ':settings:register',
|
322 |
-
[$plugin, 'registerSettings']);
|
323 |
-
add_action(EMBEDPRESS_PLG_NAME . ':settings:render:tab', [$plugin, 'renderTab']);
|
324 |
-
|
325 |
-
add_filter('plugin_action_links_embedpress-' . $plugin::SLUG . '/embedpress-' . $plugin::SLUG . '.php',
|
326 |
-
[$plugin, 'handleActionLinks'], 10, 2);
|
327 |
-
|
328 |
-
$plugin::registerEvents();
|
329 |
-
}
|
330 |
-
}
|
331 |
-
}
|
332 |
|
333 |
/**
|
334 |
* Retrieve all registered plugins.
|
@@ -413,7 +365,7 @@ class CoreLegacy
|
|
413 |
// We hook here because the onPaste is sometimes called after the content was already added to the editor.
|
414 |
// If you copy text from the editor and paste there, it will give no way to use a normal onPaste event hook
|
415 |
// to modify the input since it was already injected.
|
416 |
-
$mceInit['paste_preprocess'] = 'function (plugin, args) {EmbedPress.onPaste(plugin, args);}';
|
417 |
}
|
418 |
|
419 |
|
5 |
use EmbedPress\Ends\Back\Handler as EndHandlerAdmin;
|
6 |
use EmbedPress\Ends\Back\Settings\EmbedpressSettings;
|
7 |
use EmbedPress\Ends\Front\Handler as EndHandlerPublic;
|
8 |
+
use EmbedPress\Includes\Traits\Shared;
|
9 |
|
10 |
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
11 |
|
20 |
*/
|
21 |
class CoreLegacy
|
22 |
{
|
23 |
+
use Shared;
|
24 |
/**
|
25 |
* The name of the plugin.
|
26 |
*
|
127 |
new EmbedpressSettings();
|
128 |
$plgSettings = self::getSettings();
|
129 |
$this->admin_notice();
|
|
|
|
|
|
|
|
|
130 |
|
131 |
add_filter('plugin_action_links_embedpress/embedpress.php',
|
132 |
['\\EmbedPress\\CoreLegacy', 'handleActionLinks'], 10, 2);
|
133 |
|
134 |
add_action('admin_enqueue_scripts', ['\\EmbedPress\\Ends\\Back\\Handler', 'enqueueStyles']);
|
135 |
add_action('wp_ajax_embedpress_notice_dismiss', ['\\EmbedPress\\Ends\\Back\\Handler', 'embedpress_notice_dismiss']);
|
|
|
136 |
add_action('init', ['\\EmbedPress\\DisablerLegacy', 'run'], 1);
|
137 |
add_action('init', [$this, 'configureTinyMCE'], 1);
|
138 |
|
139 |
$plgHandlerAdminInstance = new EndHandlerAdmin($this->getPluginName(), $this->getPluginVersion());
|
140 |
|
141 |
+
if ( $plgSettings->enablePluginInAdmin ) {
|
142 |
$this->loaderInstance->add_action('admin_enqueue_scripts', $plgHandlerAdminInstance, 'enqueueScripts');
|
143 |
}
|
144 |
|
281 |
return (object)$settings;
|
282 |
}
|
283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
|
285 |
/**
|
286 |
* Retrieve all registered plugins.
|
365 |
// We hook here because the onPaste is sometimes called after the content was already added to the editor.
|
366 |
// If you copy text from the editor and paste there, it will give no way to use a normal onPaste event hook
|
367 |
// to modify the input since it was already injected.
|
368 |
+
$mceInit['paste_preprocess'] = 'function (plugin, args) { if (typeof EmbedPress !== "undefined") {EmbedPress.onPaste(plugin, args); } }';
|
369 |
}
|
370 |
|
371 |
|
EmbedPress/Elementor/Embedpress_Elementor_Integration.php
CHANGED
@@ -18,6 +18,7 @@ class Embedpress_Elementor_Integration {
|
|
18 |
$e_blocks = isset( $elements['elementor']) ? (array) $elements['elementor'] : [];
|
19 |
if ( !empty($e_blocks['embedpress']) || !empty($e_blocks['embedpress-document']) ) {
|
20 |
add_action( 'elementor/frontend/after_enqueue_styles', [ $this, 'embedpress_enqueue_style' ] );
|
|
|
21 |
add_action('elementor/editor/before_enqueue_scripts', array($this, 'editor_enqueue_scripts'));
|
22 |
add_action( 'elementor/elements/categories_registered', array( $this, 'register_widget_categories' ) );
|
23 |
add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widget' ) );
|
@@ -70,14 +71,18 @@ class Embedpress_Elementor_Integration {
|
|
70 |
EMBEDPRESS_VERSION
|
71 |
);
|
72 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
public function editor_enqueue_scripts(){
|
75 |
-
|
76 |
-
'embedpress-el-icon',
|
77 |
-
EMBEDPRESS_URL_ASSETS . 'css/el-icon.css',
|
78 |
-
false,
|
79 |
-
EMBEDPRESS_VERSION
|
80 |
-
);
|
81 |
}
|
82 |
|
83 |
public function addOEmbedProviders( $providers ) {
|
18 |
$e_blocks = isset( $elements['elementor']) ? (array) $elements['elementor'] : [];
|
19 |
if ( !empty($e_blocks['embedpress']) || !empty($e_blocks['embedpress-document']) ) {
|
20 |
add_action( 'elementor/frontend/after_enqueue_styles', [ $this, 'embedpress_enqueue_style' ] );
|
21 |
+
add_action('elementor/editor/before_enqueue_styles', array($this, 'editor_enqueue_style'));
|
22 |
add_action('elementor/editor/before_enqueue_scripts', array($this, 'editor_enqueue_scripts'));
|
23 |
add_action( 'elementor/elements/categories_registered', array( $this, 'register_widget_categories' ) );
|
24 |
add_action( 'elementor/widgets/widgets_registered', array( $this, 'register_widget' ) );
|
71 |
EMBEDPRESS_VERSION
|
72 |
);
|
73 |
}
|
74 |
+
|
75 |
+
public function editor_enqueue_style(){
|
76 |
+
wp_enqueue_style(
|
77 |
+
'embedpress-el-icon',
|
78 |
+
EMBEDPRESS_URL_ASSETS . 'css/el-icon.css',
|
79 |
+
false,
|
80 |
+
EMBEDPRESS_VERSION
|
81 |
+
);
|
82 |
+
}
|
83 |
|
84 |
public function editor_enqueue_scripts(){
|
85 |
+
|
|
|
|
|
|
|
|
|
|
|
86 |
}
|
87 |
|
88 |
public function addOEmbedProviders( $providers ) {
|
EmbedPress/Elementor/Widgets/Embedpress_Elementor.php
CHANGED
@@ -6,13 +6,15 @@ namespace EmbedPress\Elementor\Widgets;
|
|
6 |
use \Elementor\Controls_Manager as Controls_Manager;
|
7 |
use Elementor\Group_Control_Background;
|
8 |
use \Elementor\Group_Control_Css_Filter;
|
|
|
9 |
use \Elementor\Widget_Base as Widget_Base;
|
10 |
use \EmbedPress\Shortcode;
|
11 |
|
12 |
(defined( 'ABSPATH' )) or die( "No direct script access allowed." );
|
13 |
|
14 |
class Embedpress_Elementor extends Widget_Base {
|
15 |
-
|
|
|
16 |
public function get_name() {
|
17 |
return 'embedpres_elementor';
|
18 |
}
|
@@ -70,7 +72,8 @@ class Embedpress_Elementor extends Widget_Base {
|
|
70 |
}
|
71 |
|
72 |
protected function _register_controls() {
|
73 |
-
|
|
|
74 |
/**
|
75 |
* EmbedPress Content Settings
|
76 |
*/
|
@@ -82,12 +85,29 @@ class Embedpress_Elementor extends Widget_Base {
|
|
82 |
);
|
83 |
|
84 |
do_action( 'embedpress/embeded/extend', $this );
|
85 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
$this->add_control(
|
87 |
'embedpress_embeded_link',
|
88 |
[
|
89 |
|
90 |
-
'label' => __( '
|
91 |
'type' => Controls_Manager::TEXT,
|
92 |
'dynamic' => [
|
93 |
'active' => true,
|
@@ -97,18 +117,17 @@ class Embedpress_Elementor extends Widget_Base {
|
|
97 |
|
98 |
]
|
99 |
);
|
100 |
-
|
101 |
$this->add_control(
|
102 |
'spotify_theme',
|
103 |
[
|
104 |
-
'label' => __( 'Player Background', 'embedpress
|
105 |
-
'description' => __( 'Dynamic option will use the most vibrant color from the album art.', 'embedpress
|
106 |
'type' => Controls_Manager::SELECT,
|
107 |
'label_block' => false,
|
108 |
'default' => '1',
|
109 |
'options' => [
|
110 |
-
'1' => __( 'Dynamic', 'embedpress
|
111 |
-
'0' => __( 'Black & White', 'embedpress
|
112 |
],
|
113 |
'condition' => [
|
114 |
'embedpress_pro_embeded_source' => 'spotify'
|
@@ -116,121 +135,1241 @@ class Embedpress_Elementor extends Widget_Base {
|
|
116 |
]
|
117 |
);
|
118 |
do_action( 'embedpress/control/extend', $this );
|
119 |
-
|
120 |
-
$this->end_controls_section();
|
121 |
-
|
122 |
-
$this->start_controls_section(
|
123 |
-
'embedpress_style_section',
|
124 |
-
[
|
125 |
-
'label' => __( 'Style', 'elementor' ),
|
126 |
-
'tab' => Controls_Manager::TAB_STYLE,
|
127 |
-
]
|
128 |
-
);
|
129 |
-
|
130 |
-
|
131 |
-
$this->add_control(
|
132 |
-
'embedpress_elementor_aspect_ratio',
|
133 |
-
[
|
134 |
-
'label' => __( 'Aspect Ratio', 'embedpress' ),
|
135 |
-
'description' => __( 'Good for any video. You may turn it off for other embed type.', 'embedpress' ),
|
136 |
-
'type' => Controls_Manager::SELECT,
|
137 |
-
'options' => [
|
138 |
-
0 => __('None'),
|
139 |
-
'169' => '16:9',
|
140 |
-
'219' => '21:9',
|
141 |
-
'43' => '4:3',
|
142 |
-
'32' => '3:2',
|
143 |
-
'11' => '1:1',
|
144 |
-
'916' => '9:16',
|
145 |
-
],
|
146 |
-
'default' => 0,
|
147 |
-
'prefix_class' => 'embedpress-aspect-ratio-',
|
148 |
-
'frontend_available' => true,
|
149 |
-
]
|
150 |
-
);
|
151 |
-
|
152 |
$this->add_control(
|
153 |
-
'
|
154 |
[
|
155 |
-
'label'
|
156 |
-
'type'
|
157 |
-
'
|
158 |
-
'
|
159 |
-
|
160 |
-
|
161 |
-
'max' => 1500,
|
162 |
-
'step' => 5,
|
163 |
-
],
|
164 |
-
],
|
165 |
-
'default' => [
|
166 |
-
'unit' => 'px',
|
167 |
-
'size' => 600,
|
168 |
-
]
|
169 |
-
]
|
170 |
-
);
|
171 |
-
$this->add_control(
|
172 |
-
'height',
|
173 |
-
[
|
174 |
-
'label' => __( 'Height', 'embedpress' ),
|
175 |
-
'type' => Controls_Manager::SLIDER,
|
176 |
-
'size_units' => [ 'px' ],
|
177 |
-
'range' => [
|
178 |
-
'px' => [
|
179 |
-
'min' => 0,
|
180 |
-
'max' => 1500,
|
181 |
-
'step' => 5,
|
182 |
-
],
|
183 |
],
|
184 |
-
'default' => [
|
185 |
-
'unit' => 'px',
|
186 |
-
'size' => 400,
|
187 |
-
]
|
188 |
]
|
189 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
-
$this->add_responsive_control(
|
192 |
-
'margin',
|
193 |
-
[
|
194 |
-
'label' => __( 'Margin', 'embedpress' ),
|
195 |
-
'type' => Controls_Manager::DIMENSIONS,
|
196 |
-
'size_units' => [ 'px', '%', 'em' ],
|
197 |
-
'selectors' => [
|
198 |
-
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
199 |
-
],
|
200 |
-
]
|
201 |
-
);
|
202 |
-
$this->add_responsive_control(
|
203 |
-
'padding',
|
204 |
-
[
|
205 |
-
'label' => __( 'Padding', 'embedpress' ),
|
206 |
-
'type' => Controls_Manager::DIMENSIONS,
|
207 |
-
'size_units' => [ 'px', '%', 'em' ],
|
208 |
-
'selectors' => [
|
209 |
-
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
210 |
-
],
|
211 |
-
]
|
212 |
-
);
|
213 |
-
$this->add_group_control(
|
214 |
-
Group_Control_Background::get_type(),
|
215 |
-
[
|
216 |
-
'name' => 'background',
|
217 |
-
'label' => __( 'Background', 'embedpress' ),
|
218 |
-
'types' => [ 'classic', 'gradient' ],
|
219 |
-
'selector' => '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper, {{WRAPPER}} .embedpress-fit-aspect-ratio .embedpress-wrapper iframe',
|
220 |
-
]
|
221 |
-
);
|
222 |
-
$this->add_group_control(
|
223 |
-
Group_Control_Css_Filter::get_type(),
|
224 |
-
[
|
225 |
-
'name' => 'embedpress_elementor_css_filters',
|
226 |
-
'selector' => '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper',
|
227 |
-
]
|
228 |
-
);
|
229 |
$this->end_controls_section();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
|
|
232 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
234 |
protected function render() {
|
235 |
add_filter( 'embedpress_should_modify_spotify', '__return_false');
|
236 |
$settings = $this->get_settings_for_display();
|
@@ -250,7 +1389,6 @@ class Embedpress_Elementor extends Widget_Base {
|
|
250 |
</div>
|
251 |
<?php
|
252 |
}
|
253 |
-
|
254 |
public function onAfterEmbedSpotify( $embed, $setting ) {
|
255 |
if ( !isset( $embed->provider_name ) || strtolower( $embed->provider_name ) !== 'spotify' || !isset( $embed->embed ) ) {
|
256 |
return $embed;
|
@@ -271,7 +1409,4 @@ class Embedpress_Elementor extends Widget_Base {
|
|
271 |
$embed->embed = str_replace( $url_full, $modified_url, $embed->embed );
|
272 |
return $embed;
|
273 |
}
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
}
|
6 |
use \Elementor\Controls_Manager as Controls_Manager;
|
7 |
use Elementor\Group_Control_Background;
|
8 |
use \Elementor\Group_Control_Css_Filter;
|
9 |
+
use Elementor\Group_Control_Image_Size;
|
10 |
use \Elementor\Widget_Base as Widget_Base;
|
11 |
use \EmbedPress\Shortcode;
|
12 |
|
13 |
(defined( 'ABSPATH' )) or die( "No direct script access allowed." );
|
14 |
|
15 |
class Embedpress_Elementor extends Widget_Base {
|
16 |
+
protected $pro_class = '';
|
17 |
+
protected $pro_text = '';
|
18 |
public function get_name() {
|
19 |
return 'embedpres_elementor';
|
20 |
}
|
72 |
}
|
73 |
|
74 |
protected function _register_controls() {
|
75 |
+
$this->pro_class = is_embedpress_pro_active() ? '': 'embedpress-pro-control';
|
76 |
+
$this->pro_text = is_embedpress_pro_active() ? '': __('<sup class="embedpress-pro-label" style="color:red">Pro</sup>', 'embedpress');
|
77 |
/**
|
78 |
* EmbedPress Content Settings
|
79 |
*/
|
85 |
);
|
86 |
|
87 |
do_action( 'embedpress/embeded/extend', $this );
|
88 |
+
$this->add_control(
|
89 |
+
'embedpress_pro_embeded_source',
|
90 |
+
[
|
91 |
+
'label' => __( 'Source Name', 'embedpress' ),
|
92 |
+
'type' => Controls_Manager::SELECT,
|
93 |
+
'label_block' => false,
|
94 |
+
'default' => ['default'],
|
95 |
+
'options' => [
|
96 |
+
'default' => __( 'Default', 'embedpress' ),
|
97 |
+
'youtube' => __( 'YouTube', 'embedpress' ),
|
98 |
+
'vimeo' => __( 'Vimeo', 'embedpress' ),
|
99 |
+
'dailymotion' => __( 'Dailymotion', 'embedpress' ),
|
100 |
+
'wistia' => __( 'Wistia', 'embedpress' ),
|
101 |
+
'twitch' => __( 'Twitch', 'embedpress' ),
|
102 |
+
'soundcloud' => __( 'SoundCloud', 'embedpress' ),
|
103 |
+
]
|
104 |
+
]
|
105 |
+
);
|
106 |
$this->add_control(
|
107 |
'embedpress_embeded_link',
|
108 |
[
|
109 |
|
110 |
+
'label' => __( 'Embedded Link', 'embedpress' ),
|
111 |
'type' => Controls_Manager::TEXT,
|
112 |
'dynamic' => [
|
113 |
'active' => true,
|
117 |
|
118 |
]
|
119 |
);
|
|
|
120 |
$this->add_control(
|
121 |
'spotify_theme',
|
122 |
[
|
123 |
+
'label' => __( 'Player Background', 'embedpress' ),
|
124 |
+
'description' => __( 'Dynamic option will use the most vibrant color from the album art.', 'embedpress' ),
|
125 |
'type' => Controls_Manager::SELECT,
|
126 |
'label_block' => false,
|
127 |
'default' => '1',
|
128 |
'options' => [
|
129 |
+
'1' => __( 'Dynamic', 'embedpress' ),
|
130 |
+
'0' => __( 'Black & White', 'embedpress' )
|
131 |
],
|
132 |
'condition' => [
|
133 |
'embedpress_pro_embeded_source' => 'spotify'
|
135 |
]
|
136 |
);
|
137 |
do_action( 'embedpress/control/extend', $this );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
$this->add_control(
|
139 |
+
'embedpress_pro_video_start_time',
|
140 |
[
|
141 |
+
'label' => sprintf( __( 'Start Time %s', 'embedpress' ), $this->pro_text),
|
142 |
+
'type' => Controls_Manager::NUMBER,
|
143 |
+
'classes' => $this->pro_class,
|
144 |
+
'description' => __( 'Specify a start time (in seconds)', 'embedpress' ),
|
145 |
+
'condition' => [
|
146 |
+
'embedpress_pro_embeded_source' => ['youtube', 'vimeo', 'wistia', 'dailymotion', 'twitch']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
],
|
|
|
|
|
|
|
|
|
148 |
]
|
149 |
);
|
150 |
+
$this->init_youtube_controls();
|
151 |
+
$this->init_vimeo_controls();
|
152 |
+
$this->init_wistia_controls();
|
153 |
+
$this->init_soundcloud_controls();
|
154 |
+
$this->init_dailymotion_control();
|
155 |
+
$this->init_twitch_control();
|
156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
$this->end_controls_section();
|
158 |
+
if (! is_embedpress_pro_active()) {
|
159 |
+
$this->start_controls_section(
|
160 |
+
'embedpress_pro_section',
|
161 |
+
[
|
162 |
+
'label' => __('Go Premium for More Features', 'embedpress'),
|
163 |
+
]
|
164 |
+
);
|
165 |
|
166 |
+
$this->add_control(
|
167 |
+
'embedpress_pro_cta',
|
168 |
+
[
|
169 |
+
'label' => __('Unlock more possibilities', 'embedpress'),
|
170 |
+
'type' => Controls_Manager::CHOOSE,
|
171 |
+
'options' => [
|
172 |
+
'1' => [
|
173 |
+
'title' => '',
|
174 |
+
'icon' => 'fa fa-unlock-alt',
|
175 |
+
],
|
176 |
+
],
|
177 |
+
'default' => '1',
|
178 |
+
'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.net/in/upgrade-embedpress" target="_blank">Pro version</a> for more provider support and customization options.</span>',
|
179 |
+
]
|
180 |
+
);
|
181 |
+
|
182 |
+
$this->end_controls_section();
|
183 |
+
}
|
184 |
|
185 |
+
$this->init_style_controls();
|
186 |
}
|
187 |
+
public function init_youtube_controls() {
|
188 |
+
$yt_condition = [
|
189 |
+
'embedpress_pro_embeded_source' => 'youtube'
|
190 |
+
];
|
191 |
+
$this->add_control(
|
192 |
+
'embedpress_pro_youtube_end_time',
|
193 |
+
[
|
194 |
+
'label' => __( 'End Time', 'embedpress' ),
|
195 |
+
'type' => Controls_Manager::NUMBER,
|
196 |
+
'description' => __( 'Specify an end time (in seconds)', 'embedpress' ),
|
197 |
+
'condition' => $yt_condition,
|
198 |
+
]
|
199 |
+
);
|
200 |
+
|
201 |
+
|
202 |
+
$this->add_control(
|
203 |
+
'embedpress_pro_youtube_auto_play',
|
204 |
+
[
|
205 |
+
'label' => __( 'Auto Play', 'embedpress' ),
|
206 |
+
'type' => Controls_Manager::SWITCHER,
|
207 |
+
'label_block' => false,
|
208 |
+
'return_value' => 'yes',
|
209 |
+
'default' => 'no',
|
210 |
+
'condition' => $yt_condition,
|
211 |
+
]
|
212 |
+
);
|
213 |
+
|
214 |
+
$this->add_control(
|
215 |
+
'embedpress_pro_youtube_player_options',
|
216 |
+
[
|
217 |
+
'label' => __( 'Player Options', 'embedpress' ),
|
218 |
+
'type' => Controls_Manager::HEADING,
|
219 |
+
'condition' => $yt_condition,
|
220 |
+
]
|
221 |
+
);
|
222 |
+
|
223 |
+
$this->add_control(
|
224 |
+
'embedpress_pro_youtube_display_controls',
|
225 |
+
[
|
226 |
+
'label' => __( 'Controls', 'embedpress' ),
|
227 |
+
'type' => Controls_Manager::SELECT,
|
228 |
+
'label_block' => false,
|
229 |
+
'default' => 1,
|
230 |
+
'options' => [
|
231 |
+
'1' => __( 'Display immediately', 'embedpress' ),
|
232 |
+
'2' => __( 'Display after user initiation', 'embedpress' ),
|
233 |
+
'0' => __( 'Hide controls', 'embedpress' )
|
234 |
+
],
|
235 |
+
'condition' => $yt_condition,
|
236 |
+
]
|
237 |
+
);
|
238 |
+
|
239 |
+
$this->add_control(
|
240 |
+
'embedpress_pro_youtube_enable_fullscreen_button',
|
241 |
+
[
|
242 |
+
'label' => __( 'Fullscreen button', 'embedpress' ),
|
243 |
+
'type' => Controls_Manager::SWITCHER,
|
244 |
+
'label_block' => false,
|
245 |
+
'return_value' => 'yes',
|
246 |
+
'default' => 'yes',
|
247 |
+
'condition' => [
|
248 |
+
'embedpress_pro_embeded_source' => 'youtube',
|
249 |
+
'embedpress_pro_youtube_display_controls!' => '0'
|
250 |
+
]
|
251 |
+
]
|
252 |
+
);
|
253 |
+
|
254 |
+
$this->add_control(
|
255 |
+
'embedpress_pro_youtube_display_video_annotations',
|
256 |
+
[
|
257 |
+
'label' => __( 'Video Annotations', 'embedpress' ),
|
258 |
+
'type' => Controls_Manager::SWITCHER,
|
259 |
+
'label_block' => false,
|
260 |
+
'default' => 1,
|
261 |
+
'options' => [
|
262 |
+
'1' => __( 'Display', 'embedpress' ),
|
263 |
+
'3' => __( 'Do Not Display', 'embedpress' )
|
264 |
+
],
|
265 |
+
'condition' => $yt_condition,
|
266 |
+
]
|
267 |
+
);
|
268 |
+
|
269 |
+
//--- Youtube Pro control starts ---
|
270 |
+
$this->add_control(
|
271 |
+
'embedpress_pro_youtube_progress_bar_color',
|
272 |
+
[
|
273 |
+
'label' => sprintf( __( 'Progress Bar Color %s', 'embedpress' ), $this->pro_text),
|
274 |
+
'type' => Controls_Manager::SELECT,
|
275 |
+
'label_block' => false,
|
276 |
+
'classes' => $this->pro_class,
|
277 |
+
'default' => 'red',
|
278 |
+
'options' => [
|
279 |
+
'red' => __( 'Red', 'embedpress' ),
|
280 |
+
'white' => __( 'White', 'embedpress' )
|
281 |
+
],
|
282 |
+
'condition' => $yt_condition,
|
283 |
+
]
|
284 |
+
);
|
285 |
+
|
286 |
+
$this->add_control(
|
287 |
+
'embedpress_pro_youtube_force_closed_captions',
|
288 |
+
[
|
289 |
+
'label' => sprintf(__( 'Closed Captions %s', 'embedpress' ), $this->pro_text ),
|
290 |
+
'type' => Controls_Manager::SWITCHER,
|
291 |
+
'label_block' => false,
|
292 |
+
'return_value' => 'yes',
|
293 |
+
'default' => 'no',
|
294 |
+
'separator' => 'after',
|
295 |
+
'classes' => $this->pro_class,
|
296 |
+
'condition' => $yt_condition,
|
297 |
+
]
|
298 |
+
);
|
299 |
+
$this->add_control(
|
300 |
+
'embedpress_pro_youtube_modest_branding',
|
301 |
+
[
|
302 |
+
'label' => sprintf(__( 'Modest Branding %s', 'embedpress' ), $this->pro_text ),
|
303 |
+
'type' => Controls_Manager::SELECT,
|
304 |
+
'label_block' => false,
|
305 |
+
'default' => 1,
|
306 |
+
'options' => [
|
307 |
+
'0' => __( 'Display', 'embedpress' ),
|
308 |
+
'1' => __( 'Do Not Display', 'embedpress' )
|
309 |
+
],
|
310 |
+
'condition' => [
|
311 |
+
'embedpress_pro_embeded_source' => 'youtube',
|
312 |
+
'embedpress_pro_youtube_display_controls!' => '0',
|
313 |
+
'embedpress_pro_youtube_progress_bar_color!' => 'white'
|
314 |
+
],
|
315 |
+
'classes' => $this->pro_class,
|
316 |
+
]
|
317 |
+
);
|
318 |
+
|
319 |
+
$this->add_control(
|
320 |
+
'embedpress_pro_youtube_display_related_videos',
|
321 |
+
[
|
322 |
+
'label' => sprintf(__( 'Related Videos %s', 'embedpress' ), $this->pro_text ),
|
323 |
+
'type' => Controls_Manager::SWITCHER,
|
324 |
+
'label_block' => false,
|
325 |
+
'return_value' => 'yes',
|
326 |
+
'default' => 'yes',
|
327 |
+
'condition' => $yt_condition,
|
328 |
+
'classes' => $this->pro_class,
|
329 |
+
]
|
330 |
+
);
|
331 |
+
|
332 |
+
$this->init_branding_controls( 'youtube');
|
333 |
+
}
|
334 |
+
public function init_dailymotion_control ( ){
|
335 |
+
$this->add_control(
|
336 |
+
'embedpress_pro_dailymotion_logo',
|
337 |
+
[
|
338 |
+
'label' => sprintf(__( 'Logo %s', 'embedpress' ), $this->pro_text ),
|
339 |
+
'type' => Controls_Manager::SWITCHER,
|
340 |
+
'label_block' => false,
|
341 |
+
'return_value' => 'yes',
|
342 |
+
'default' => 'yes',
|
343 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
344 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
345 |
+
'condition' => [
|
346 |
+
'embedpress_pro_embeded_source' => 'dailymotion'
|
347 |
+
],
|
348 |
+
'classes' => $this->pro_class,
|
349 |
+
]
|
350 |
+
);
|
351 |
+
$this->add_control(
|
352 |
+
'embedpress_pro_dailymotion_autoplay',
|
353 |
+
[
|
354 |
+
'label' => __( 'Auto Play', 'embedpress' ),
|
355 |
+
'type' => Controls_Manager::SWITCHER,
|
356 |
+
'label_block' => false,
|
357 |
+
'return_value' => 'yes',
|
358 |
+
'default' => 'no',
|
359 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
360 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
361 |
+
'condition' => [
|
362 |
+
'embedpress_pro_embeded_source' => 'dailymotion'
|
363 |
+
]
|
364 |
+
]
|
365 |
+
);
|
366 |
+
|
367 |
+
$this->add_control(
|
368 |
+
'embedpress_pro_dailymotion_play_on_mobile',
|
369 |
+
[
|
370 |
+
'label' => __( 'Play On Mobile', 'embedpress' ),
|
371 |
+
'type' => Controls_Manager::SWITCHER,
|
372 |
+
'label_block' => false,
|
373 |
+
'return_value' => 'yes',
|
374 |
+
'default' => 'no',
|
375 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
376 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
377 |
+
'condition' => [
|
378 |
+
'embedpress_pro_embeded_source' => 'dailymotion',
|
379 |
+
'embedpress_pro_dailymotion_autoplay' => 'yes'
|
380 |
+
]
|
381 |
+
]
|
382 |
+
);
|
383 |
+
|
384 |
+
$this->add_control(
|
385 |
+
'embedpress_pro_dailymotion_mute',
|
386 |
+
[
|
387 |
+
'label' => __( 'Mute', 'embedpress' ),
|
388 |
+
'type' => Controls_Manager::SWITCHER,
|
389 |
+
'label_block' => false,
|
390 |
+
'return_value' => 'yes',
|
391 |
+
'default' => 'no',
|
392 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
393 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
394 |
+
'condition' => [
|
395 |
+
'embedpress_pro_embeded_source' => 'dailymotion'
|
396 |
+
]
|
397 |
+
]
|
398 |
+
);
|
399 |
+
|
400 |
+
$this->add_control(
|
401 |
+
'embedpress_pro_dailymotion_player_control',
|
402 |
+
[
|
403 |
+
'label' => __( 'Player Controls', 'embedpress' ),
|
404 |
+
'type' => Controls_Manager::SWITCHER,
|
405 |
+
'label_block' => false,
|
406 |
+
'return_value' => 'yes',
|
407 |
+
'default' => 'yes',
|
408 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
409 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
410 |
+
'condition' => [
|
411 |
+
'embedpress_pro_embeded_source' => 'dailymotion'
|
412 |
+
]
|
413 |
+
]
|
414 |
+
);
|
415 |
|
416 |
+
$this->add_control(
|
417 |
+
'embedpress_pro_dailymotion_video_info',
|
418 |
+
[
|
419 |
+
'label' => __( 'Video Info', 'embedpress' ),
|
420 |
+
'type' => Controls_Manager::SWITCHER,
|
421 |
+
'label_block' => false,
|
422 |
+
'return_value' => 'yes',
|
423 |
+
'default' => 'yes',
|
424 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
425 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
426 |
+
'condition' => [
|
427 |
+
'embedpress_pro_embeded_source' => 'dailymotion'
|
428 |
+
]
|
429 |
+
]
|
430 |
+
);
|
431 |
+
|
432 |
+
|
433 |
+
|
434 |
+
$this->add_control(
|
435 |
+
'embedpress_pro_dailymotion_control_color',
|
436 |
+
[
|
437 |
+
'label' => __( 'Control Color', 'embedpress' ),
|
438 |
+
'type' => Controls_Manager::COLOR,
|
439 |
+
'label_block' => false,
|
440 |
+
'default' => '#dd3333',
|
441 |
+
'condition' => [
|
442 |
+
'embedpress_pro_embeded_source' => 'dailymotion'
|
443 |
+
]
|
444 |
+
]
|
445 |
+
);
|
446 |
+
}
|
447 |
+
public function init_wistia_controls( ) {
|
448 |
+
$this->add_control(
|
449 |
+
'embedpress_pro_wistia_auto_play',
|
450 |
+
[
|
451 |
+
'label' => __( 'Auto Play', 'embedpress' ),
|
452 |
+
'type' => Controls_Manager::SWITCHER,
|
453 |
+
'label_block' => false,
|
454 |
+
'return_value' => 'yes',
|
455 |
+
'default' => 'no',
|
456 |
+
'condition' => [
|
457 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
458 |
+
],
|
459 |
+
]
|
460 |
+
);
|
461 |
+
|
462 |
+
$this->add_control(
|
463 |
+
'embedpress_pro_wistia_color',
|
464 |
+
[
|
465 |
+
'label' => __( 'Scheme', 'embedpress' ),
|
466 |
+
'type' => Controls_Manager::COLOR,
|
467 |
+
'label_block' => false,
|
468 |
+
'default' => '#dd3333',
|
469 |
+
'condition' => [
|
470 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
471 |
+
]
|
472 |
+
]
|
473 |
+
);
|
474 |
+
|
475 |
+
|
476 |
+
|
477 |
+
$this->add_control(
|
478 |
+
'embedpress_pro_wistia_captions_enabled_by_default',
|
479 |
+
[
|
480 |
+
'label' => __( 'Captions Enabled By Default', 'embedpress' ),
|
481 |
+
'type' => Controls_Manager::SWITCHER,
|
482 |
+
'label_block' => false,
|
483 |
+
'return_value' => 'yes',
|
484 |
+
'default' => 'no',
|
485 |
+
'condition' => [
|
486 |
+
'embedpress_pro_embeded_source' => 'wistia',
|
487 |
+
'embedpress_pro_wistia_captions' => 'yes'
|
488 |
+
],
|
489 |
+
'classes' => $this->pro_class,
|
490 |
+
]
|
491 |
+
);
|
492 |
+
|
493 |
+
$this->add_control(
|
494 |
+
'embedpress_pro_wistia_player_options',
|
495 |
+
[
|
496 |
+
'label' => __( 'Player Options', 'embedpress' ),
|
497 |
+
'type' => Controls_Manager::HEADING,
|
498 |
+
'separator' => 'before',
|
499 |
+
'condition' => [
|
500 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
501 |
+
]
|
502 |
+
]
|
503 |
+
);
|
504 |
+
|
505 |
+
|
506 |
+
|
507 |
+
$this->add_control(
|
508 |
+
'embedpress_pro_wistia_fullscreen_button',
|
509 |
+
[
|
510 |
+
'label' => __( 'Fullscreen Button', 'embedpress' ),
|
511 |
+
'type' => Controls_Manager::SWITCHER,
|
512 |
+
'label_block' => false,
|
513 |
+
'return_value' => 'yes',
|
514 |
+
'default' => 'no',
|
515 |
+
'condition' => [
|
516 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
517 |
+
],
|
518 |
+
]
|
519 |
+
);
|
520 |
+
|
521 |
+
$this->add_control(
|
522 |
+
'embedpress_pro_wistia_small_play_button',
|
523 |
+
[
|
524 |
+
'label' => __( 'Small Play Button', 'embedpress' ),
|
525 |
+
'type' => Controls_Manager::SWITCHER,
|
526 |
+
'label_block' => false,
|
527 |
+
'return_value' => 'yes',
|
528 |
+
'default' => 'no',
|
529 |
+
'condition' => [
|
530 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
531 |
+
],
|
532 |
+
]
|
533 |
+
);
|
534 |
+
|
535 |
+
|
536 |
+
|
537 |
+
|
538 |
+
$this->add_control(
|
539 |
+
'embedpress_pro_wistia_resumable',
|
540 |
+
[
|
541 |
+
'label' => __( 'Resumable', 'embedpress' ),
|
542 |
+
'type' => Controls_Manager::SWITCHER,
|
543 |
+
'label_block' => false,
|
544 |
+
'return_value' => 'yes',
|
545 |
+
'default' => 'no',
|
546 |
+
'condition' => [
|
547 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
548 |
+
],
|
549 |
+
]
|
550 |
+
);
|
551 |
+
|
552 |
+
|
553 |
+
$this->add_control(
|
554 |
+
'embedpress_pro_wistia_focus',
|
555 |
+
[
|
556 |
+
'label' => __( 'Focus', 'embedpress' ),
|
557 |
+
'type' => Controls_Manager::SWITCHER,
|
558 |
+
'label_block' => false,
|
559 |
+
'return_value' => 'yes',
|
560 |
+
'default' => 'no',
|
561 |
+
'condition' => [
|
562 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
563 |
+
],
|
564 |
+
]
|
565 |
+
);
|
566 |
+
|
567 |
+
// --- Wistia PRO Controls --
|
568 |
+
$this->add_control(
|
569 |
+
'embedpress_pro_wistia_captions',
|
570 |
+
[
|
571 |
+
'label' => sprintf(__( 'Captions %s', 'embedpress' ), $this->pro_text ),
|
572 |
+
'type' => Controls_Manager::SWITCHER,
|
573 |
+
'label_block' => false,
|
574 |
+
'return_value' => 'yes',
|
575 |
+
'default' => 'no',
|
576 |
+
'condition' => [
|
577 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
578 |
+
],
|
579 |
+
'classes' => $this->pro_class,
|
580 |
+
]
|
581 |
+
);
|
582 |
+
$this->add_control(
|
583 |
+
'embedpress_pro_wistia_playbar',
|
584 |
+
[
|
585 |
+
'label' => sprintf(__( 'Playbar %s', 'embedpress' ), $this->pro_text ),
|
586 |
+
'type' => Controls_Manager::SWITCHER,
|
587 |
+
'label_block' => false,
|
588 |
+
'return_value' => 'yes',
|
589 |
+
'default' => 'no',
|
590 |
+
'condition' => [
|
591 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
592 |
+
],
|
593 |
+
'classes' => $this->pro_class,
|
594 |
+
]
|
595 |
+
);
|
596 |
+
|
597 |
+
$this->add_control(
|
598 |
+
'embedpress_pro_wistia_volume_control',
|
599 |
+
[
|
600 |
+
'label' => sprintf(__( 'Volume Control %s', 'embedpress' ), $this->pro_text ),
|
601 |
+
'type' => Controls_Manager::SWITCHER,
|
602 |
+
'label_block' => false,
|
603 |
+
'return_value' => 'yes',
|
604 |
+
'default' => 'yes',
|
605 |
+
'condition' => [
|
606 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
607 |
+
],
|
608 |
+
'classes' => $this->pro_class,
|
609 |
+
]
|
610 |
+
);
|
611 |
+
|
612 |
+
|
613 |
+
$this->add_control(
|
614 |
+
'embedpress_pro_wistia_volume',
|
615 |
+
[
|
616 |
+
'label' => sprintf(__( 'Volume %s', 'embedpress' ), $this->pro_text ),
|
617 |
+
'type' => Controls_Manager::SLIDER,
|
618 |
+
'default' => [
|
619 |
+
'size' => 100,
|
620 |
+
],
|
621 |
+
'range' => [
|
622 |
+
'px' => [
|
623 |
+
'min' => 0,
|
624 |
+
'max' => 100,
|
625 |
+
]
|
626 |
+
],
|
627 |
+
'condition' => [
|
628 |
+
'embedpress_pro_embeded_source' => 'wistia',
|
629 |
+
'embedpress_pro_wistia_volume_control' => 'yes'
|
630 |
+
],
|
631 |
+
'classes' => $this->pro_class,
|
632 |
+
]
|
633 |
+
);
|
634 |
+
|
635 |
+
$this->add_control(
|
636 |
+
'embedpress_pro_wistia_rewind',
|
637 |
+
[
|
638 |
+
'label' => sprintf(__( 'Rewind %s', 'embedpress' ), $this->pro_text ),
|
639 |
+
'type' => Controls_Manager::SWITCHER,
|
640 |
+
'label_block' => false,
|
641 |
+
'return_value' => 'yes',
|
642 |
+
'default' => 'no',
|
643 |
+
'condition' => [
|
644 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
645 |
+
],
|
646 |
+
'classes' => $this->pro_class,
|
647 |
+
]
|
648 |
+
);
|
649 |
+
|
650 |
+
$this->add_control(
|
651 |
+
'embedpress_pro_wistia_rewind_time',
|
652 |
+
[
|
653 |
+
'label' => sprintf(__( 'Rewind time', 'embedpress' ), $this->pro_text ),
|
654 |
+
'type' => Controls_Manager::SLIDER,
|
655 |
+
'default' => [
|
656 |
+
'size' => 10,
|
657 |
+
],
|
658 |
+
'range' => [
|
659 |
+
'px' => [
|
660 |
+
'min' => 1,
|
661 |
+
'max' => 100,
|
662 |
+
]
|
663 |
+
],
|
664 |
+
'condition' => [
|
665 |
+
'embedpress_pro_wistia_rewind' => 'yes',
|
666 |
+
'embedpress_pro_embeded_source' => 'wistia'
|
667 |
+
],
|
668 |
+
'classes' => $this->pro_class,
|
669 |
+
]
|
670 |
+
);
|
671 |
+
$this->init_branding_controls( 'wistia');
|
672 |
+
|
673 |
+
}
|
674 |
+
public function init_twitch_control( ) {
|
675 |
+
$condition = [
|
676 |
+
'embedpress_pro_embeded_source' => 'twitch'
|
677 |
+
];
|
678 |
+
$this->add_control(
|
679 |
+
'embedpress_pro_twitch_autoplay',
|
680 |
+
[
|
681 |
+
'label' => __( 'Autoplay', 'embedpress' ),
|
682 |
+
'type' => Controls_Manager::SWITCHER,
|
683 |
+
'label_off' => __( 'No', 'embedpress' ),
|
684 |
+
'label_on' => __( 'Yes', 'embedpress' ),
|
685 |
+
'default' => 'yes',
|
686 |
+
'condition' => $condition,
|
687 |
+
]
|
688 |
+
);
|
689 |
+
$this->add_control(
|
690 |
+
'embedpress_pro_fs',
|
691 |
+
[
|
692 |
+
'label' => __( 'Allow Full Screen Video', 'embedpress' ),
|
693 |
+
'type' => Controls_Manager::SWITCHER,
|
694 |
+
'label_off' => __( 'No', 'embedpress' ),
|
695 |
+
'label_on' => __( 'Yes', 'embedpress' ),
|
696 |
+
'default' => 'yes',
|
697 |
+
'condition' => $condition,
|
698 |
+
]
|
699 |
+
);
|
700 |
+
|
701 |
+
// -- Twitch PRO controls --
|
702 |
+
$this->add_control(
|
703 |
+
'embedpress_pro_twitch_chat',
|
704 |
+
[
|
705 |
+
'label' => sprintf(__( 'Show Chat %s', 'embedpress' ), $this->pro_text ),
|
706 |
+
'type' => Controls_Manager::SWITCHER,
|
707 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
708 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
709 |
+
'condition' => $condition,
|
710 |
+
'classes' => $this->pro_class,
|
711 |
+
|
712 |
+
]
|
713 |
+
);
|
714 |
+
$this->add_control(
|
715 |
+
'embedpress_pro_twitch_mute',
|
716 |
+
[
|
717 |
+
'label' => sprintf(__( 'Mute on start %s', 'embedpress' ), $this->pro_text ),
|
718 |
+
'type' => Controls_Manager::SWITCHER,
|
719 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
720 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
721 |
+
'condition' => $condition,
|
722 |
+
'classes' => $this->pro_class,
|
723 |
+
]
|
724 |
+
);
|
725 |
+
$this->add_control(
|
726 |
+
'embedpress_pro_twitch_theme',
|
727 |
+
[
|
728 |
+
'label' => sprintf(__( 'Theme %s', 'embedpress' ), $this->pro_text ),
|
729 |
+
'type' => Controls_Manager::SELECT,
|
730 |
+
'default' => 'dark',
|
731 |
+
'options' => [
|
732 |
+
'dark' => __( 'Dark', 'embedpress' ),
|
733 |
+
'light' => __( 'Light', 'embedpress' ),
|
734 |
+
],
|
735 |
+
'condition' => $condition,
|
736 |
+
'classes' => $this->pro_class,
|
737 |
+
]
|
738 |
+
);
|
739 |
+
|
740 |
+
$this->init_branding_controls( 'twitch');
|
741 |
+
|
742 |
+
}
|
743 |
+
public function init_soundcloud_controls( ) {
|
744 |
+
$this->add_control(
|
745 |
+
'embedpress_pro_soundcloud_visual',
|
746 |
+
[
|
747 |
+
'label' => __( 'Visual Player', 'embedpress' ),
|
748 |
+
'type' => Controls_Manager::SWITCHER,
|
749 |
+
'label_block' => false,
|
750 |
+
'return_value' => 'yes',
|
751 |
+
'default' => 'no',
|
752 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
753 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
754 |
+
'condition' => [
|
755 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
756 |
+
],
|
757 |
+
]
|
758 |
+
);
|
759 |
+
|
760 |
+
$this->add_control(
|
761 |
+
'embedpress_pro_soundcloud_color',
|
762 |
+
[
|
763 |
+
'label' => __( 'Scheme', 'embedpress' ),
|
764 |
+
'type' => Controls_Manager::COLOR,
|
765 |
+
'label_block' => false,
|
766 |
+
'default' => '#FF5500',
|
767 |
+
'condition' => [
|
768 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
769 |
+
]
|
770 |
+
]
|
771 |
+
);
|
772 |
+
|
773 |
+
$this->add_control(
|
774 |
+
'embedpress_pro_soundcloud_autoplay',
|
775 |
+
[
|
776 |
+
'label' => __( 'Auto Play', 'embedpress' ),
|
777 |
+
'type' => Controls_Manager::SWITCHER,
|
778 |
+
'label_block' => false,
|
779 |
+
'return_value' => 'yes',
|
780 |
+
'default' => 'no',
|
781 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
782 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
783 |
+
'condition' => [
|
784 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
785 |
+
],
|
786 |
+
]
|
787 |
+
);
|
788 |
+
|
789 |
+
|
790 |
+
|
791 |
+
$this->add_control(
|
792 |
+
'embedpress_pro_soundcloud_share_button',
|
793 |
+
[
|
794 |
+
'label' => __( 'Share Button', 'embedpress' ),
|
795 |
+
'type' => Controls_Manager::SWITCHER,
|
796 |
+
'label_block' => false,
|
797 |
+
'return_value' => 'yes',
|
798 |
+
'default' => 'yes',
|
799 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
800 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
801 |
+
'condition' => [
|
802 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
803 |
+
],
|
804 |
+
]
|
805 |
+
);
|
806 |
+
|
807 |
+
$this->add_control(
|
808 |
+
'embedpress_pro_soundcloud_comments',
|
809 |
+
[
|
810 |
+
'label' => __( 'Comments', 'embedpress' ),
|
811 |
+
'type' => Controls_Manager::SWITCHER,
|
812 |
+
'label_block' => false,
|
813 |
+
'return_value' => 'yes',
|
814 |
+
'default' => 'yes',
|
815 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
816 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
817 |
+
'condition' => [
|
818 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
819 |
+
],
|
820 |
+
]
|
821 |
+
);
|
822 |
+
|
823 |
+
|
824 |
+
|
825 |
+
$this->add_control(
|
826 |
+
'embedpress_pro_soundcloud_artwork',
|
827 |
+
[
|
828 |
+
'label' => __( 'Artwork', 'embedpress' ),
|
829 |
+
'type' => Controls_Manager::SWITCHER,
|
830 |
+
'label_block' => false,
|
831 |
+
'return_value' => 'yes',
|
832 |
+
'default' => 'yes',
|
833 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
834 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
835 |
+
'condition' => [
|
836 |
+
'embedpress_pro_embeded_source' => 'soundcloud',
|
837 |
+
'embedpress_pro_soundcloud_visual!' => 'yes'
|
838 |
+
]
|
839 |
+
]
|
840 |
+
);
|
841 |
+
|
842 |
+
$this->add_control(
|
843 |
+
'embedpress_pro_soundcloud_play_count',
|
844 |
+
[
|
845 |
+
'label' => __( 'Play Count', 'embedpress' ),
|
846 |
+
'type' => Controls_Manager::SWITCHER,
|
847 |
+
'label_block' => false,
|
848 |
+
'return_value' => 'yes',
|
849 |
+
'default' => 'yes',
|
850 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
851 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
852 |
+
'condition' => [
|
853 |
+
'embedpress_pro_embeded_source' => 'soundcloud',
|
854 |
+
'embedpress_pro_soundcloud_visual!' => 'yes'
|
855 |
+
],
|
856 |
+
]
|
857 |
+
);
|
858 |
+
|
859 |
+
$this->add_control(
|
860 |
+
'embedpress_pro_soundcloud_user_name',
|
861 |
+
[
|
862 |
+
'label' => __( 'User Name', 'embedpress' ),
|
863 |
+
'type' => Controls_Manager::SWITCHER,
|
864 |
+
'label_block' => false,
|
865 |
+
'return_value' => 'yes',
|
866 |
+
'default' => 'yes',
|
867 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
868 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
869 |
+
'condition' => [
|
870 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
871 |
+
],
|
872 |
+
]
|
873 |
+
);
|
874 |
+
|
875 |
+
$this->add_control(
|
876 |
+
'embedpress_pro_soundcloud_buy_button',
|
877 |
+
[
|
878 |
+
'label' => sprintf(__( 'Buy Button %s', 'embedpress' ), $this->pro_text ),
|
879 |
+
'type' => Controls_Manager::SWITCHER,
|
880 |
+
'label_block' => false,
|
881 |
+
'return_value' => 'yes',
|
882 |
+
'default' => 'yes',
|
883 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
884 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
885 |
+
'condition' => [
|
886 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
887 |
+
],
|
888 |
+
'classes' => $this->pro_class,
|
889 |
+
]
|
890 |
+
);
|
891 |
+
$this->add_control(
|
892 |
+
'embedpress_pro_soundcloud_download_button',
|
893 |
+
[
|
894 |
+
'label' => sprintf(__( 'Download Button %s', 'embedpress' ), $this->pro_text ),
|
895 |
+
'type' => Controls_Manager::SWITCHER,
|
896 |
+
'label_block' => false,
|
897 |
+
'return_value' => 'yes',
|
898 |
+
'default' => 'yes',
|
899 |
+
'label_off' => __( 'Hide', 'embedpress' ),
|
900 |
+
'label_on' => __( 'Show', 'embedpress' ),
|
901 |
+
'condition' => [
|
902 |
+
'embedpress_pro_embeded_source' => 'soundcloud'
|
903 |
+
],
|
904 |
+
'classes' => $this->pro_class,
|
905 |
+
]
|
906 |
+
);
|
907 |
+
}
|
908 |
+
public function init_vimeo_controls( ) {
|
909 |
+
$this->add_control(
|
910 |
+
'embedpress_pro_vimeo_auto_play',
|
911 |
+
[
|
912 |
+
'label' => __( 'Auto Play', 'embedpress' ),
|
913 |
+
'type' => Controls_Manager::SWITCHER,
|
914 |
+
'label_block' => false,
|
915 |
+
'return_value' => 'yes',
|
916 |
+
'default' => 'no',
|
917 |
+
'condition' => [
|
918 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
919 |
+
]
|
920 |
+
]
|
921 |
+
);
|
922 |
+
|
923 |
+
|
924 |
+
$this->add_control(
|
925 |
+
'embedpress_pro_vimeo_color',
|
926 |
+
[
|
927 |
+
'label' => __( 'Scheme', 'embedpress' ),
|
928 |
+
'type' => Controls_Manager::COLOR,
|
929 |
+
'label_block' => false,
|
930 |
+
'default' => '#00adef',
|
931 |
+
'condition' => [
|
932 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
933 |
+
]
|
934 |
+
]
|
935 |
+
);
|
936 |
+
|
937 |
+
$this->add_control(
|
938 |
+
'embedpress_pro_vimeo_author_options',
|
939 |
+
[
|
940 |
+
'label' => __( 'Author Information', 'embedpress' ),
|
941 |
+
'type' => Controls_Manager::HEADING,
|
942 |
+
'separator' => 'before',
|
943 |
+
'condition' => [
|
944 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
945 |
+
]
|
946 |
+
]
|
947 |
+
);
|
948 |
+
|
949 |
+
$this->add_control(
|
950 |
+
'embedpress_pro_vimeo_display_title',
|
951 |
+
[
|
952 |
+
'label' => __( 'Title', 'embedpress' ),
|
953 |
+
'type' => Controls_Manager::SWITCHER,
|
954 |
+
'label_block' => false,
|
955 |
+
'return_value' => 'yes',
|
956 |
+
'default' => 'yes',
|
957 |
+
'condition' => [
|
958 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
959 |
+
]
|
960 |
+
]
|
961 |
+
);
|
962 |
+
|
963 |
+
//----- Vimeo PRO controls
|
964 |
+
|
965 |
+
$this->add_control(
|
966 |
+
'embedpress_pro_vimeo_display_author',
|
967 |
+
[
|
968 |
+
'label' => sprintf(__( 'Author %s', 'embedpress' ), $this->pro_text ),
|
969 |
+
'type' => Controls_Manager::SWITCHER,
|
970 |
+
'label_block' => false,
|
971 |
+
'return_value' => 'yes',
|
972 |
+
'default' => 'yes',
|
973 |
+
'condition' => [
|
974 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
975 |
+
],
|
976 |
+
'classes' => $this->pro_class,
|
977 |
+
]
|
978 |
+
);
|
979 |
+
|
980 |
+
$this->add_control(
|
981 |
+
'embedpress_pro_vimeo_avatar',
|
982 |
+
[
|
983 |
+
'label' => sprintf(__( 'Avatar %s', 'embedpress' ), $this->pro_text ),
|
984 |
+
'type' => Controls_Manager::SWITCHER,
|
985 |
+
'label_block' => false,
|
986 |
+
'return_value' => 'yes',
|
987 |
+
'default' => 'yes',
|
988 |
+
'condition' => [
|
989 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
990 |
+
],
|
991 |
+
'classes' => $this->pro_class,
|
992 |
+
]
|
993 |
+
);
|
994 |
+
|
995 |
+
$this->add_control(
|
996 |
+
'embedpress_pro_vimeo_loop',
|
997 |
+
[
|
998 |
+
'label' => sprintf(__( 'Loop %s', 'embedpress' ), $this->pro_text ),
|
999 |
+
'type' => Controls_Manager::SWITCHER,
|
1000 |
+
'label_block' => false,
|
1001 |
+
'return_value' => 'yes',
|
1002 |
+
'default' => 'no',
|
1003 |
+
'condition' => [
|
1004 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
1005 |
+
],
|
1006 |
+
'classes' => $this->pro_class,
|
1007 |
+
]
|
1008 |
+
);
|
1009 |
+
|
1010 |
+
$this->add_control(
|
1011 |
+
'embedpress_pro_vimeo_autopause',
|
1012 |
+
[
|
1013 |
+
'label' => sprintf(__( 'Auto Pause %s', 'embedpress' ), $this->pro_text ),
|
1014 |
+
'type' => Controls_Manager::SWITCHER,
|
1015 |
+
'label_block' => false,
|
1016 |
+
'return_value' => 'yes',
|
1017 |
+
'default' => 'no',
|
1018 |
+
'condition' => [
|
1019 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
1020 |
+
],
|
1021 |
+
'classes' => $this->pro_class,
|
1022 |
+
]
|
1023 |
+
);
|
1024 |
+
|
1025 |
+
$this->add_control(
|
1026 |
+
'embedpress_pro_vimeo_dnt',
|
1027 |
+
[
|
1028 |
+
'label' => sprintf(__( 'DNT %s', 'embedpress' ), $this->pro_text ),
|
1029 |
+
'type' => Controls_Manager::SWITCHER,
|
1030 |
+
'label_block' => false,
|
1031 |
+
'return_value' => 'yes',
|
1032 |
+
'default' => 'yes',
|
1033 |
+
'description' => __( 'Set this parameter to "yes" will block the player from tracking any session data, including all cookies',
|
1034 |
+
'embedpress' ),
|
1035 |
+
'condition' => [
|
1036 |
+
'embedpress_pro_embeded_source' => 'vimeo'
|
1037 |
+
],
|
1038 |
+
'classes' => $this->pro_class,
|
1039 |
+
]
|
1040 |
+
);
|
1041 |
+
|
1042 |
+
|
1043 |
+
$this->init_branding_controls( 'vimeo');
|
1044 |
+
|
1045 |
+
}
|
1046 |
+
public function init_spotify_controls() {
|
1047 |
+
$condition = [
|
1048 |
+
'embedpress_pro_embeded_source' => 'spotify'
|
1049 |
+
];
|
1050 |
+
|
1051 |
+
|
1052 |
+
$this->add_control(
|
1053 |
+
'spotify_theme',
|
1054 |
+
[
|
1055 |
+
'label' => __( 'Player Background', 'embedpress' ),
|
1056 |
+
'description' => __( 'Dynamic option will use the most vibrant color from the album art.', 'embedpress' ),
|
1057 |
+
'type' => Controls_Manager::SELECT,
|
1058 |
+
'label_block' => false,
|
1059 |
+
'default' => '1',
|
1060 |
+
'options' => [
|
1061 |
+
'1' => __( 'Dynamic', 'embedpress' ),
|
1062 |
+
'0' => __( 'Black & White', 'embedpress' )
|
1063 |
+
],
|
1064 |
+
'condition' => $condition
|
1065 |
+
]
|
1066 |
+
);
|
1067 |
+
|
1068 |
+
$this->add_control(
|
1069 |
+
'spotify_follow_theme',
|
1070 |
+
[
|
1071 |
+
'label' => __( 'Follow Widget Background', 'embedpress' ),
|
1072 |
+
'type' => Controls_Manager::SELECT,
|
1073 |
+
'label_block' => false,
|
1074 |
+
'default' => 'light',
|
1075 |
+
'options' => [
|
1076 |
+
'light' => __( 'Light', 'embedpress' ),
|
1077 |
+
'dark' => __( 'Dark', 'embedpress' )
|
1078 |
+
],
|
1079 |
+
'condition' => $condition
|
1080 |
+
]
|
1081 |
+
);
|
1082 |
+
}
|
1083 |
+
public function init_branding_controls( $provider_name='' ) {
|
1084 |
+
$condition = [
|
1085 |
+
'embedpress_pro_embeded_source' => $provider_name,
|
1086 |
+
];
|
1087 |
+
$logo_condition = [
|
1088 |
+
'embedpress_pro_embeded_source' => $provider_name,
|
1089 |
+
"embedpress_pro_{$provider_name}_logo[url]!" =>''
|
1090 |
+
];
|
1091 |
+
|
1092 |
+
$this->add_control(
|
1093 |
+
"{$provider_name}_custom_logo_cta_heading",
|
1094 |
+
[
|
1095 |
+
'label' => __( 'Custom Logo & CTA', 'embedpress' ),
|
1096 |
+
'type' => Controls_Manager::HEADING,
|
1097 |
+
'separator' => 'before',
|
1098 |
+
'condition' => $condition,
|
1099 |
+
]
|
1100 |
+
);
|
1101 |
+
$this->add_control(
|
1102 |
+
"embedpress_pro_{$provider_name}_logo",
|
1103 |
+
[
|
1104 |
+
'label' => sprintf(__( 'Custom Logo %s', 'embedpress' ), $this->pro_text ),
|
1105 |
+
'description' => __( 'Leave it empty to hide it', 'embedpress' ),
|
1106 |
+
'type' => Controls_Manager::MEDIA,
|
1107 |
+
'dynamic' => [
|
1108 |
+
'active' => true,
|
1109 |
+
],
|
1110 |
+
'condition' => $condition,
|
1111 |
+
'classes' => $this->pro_class,
|
1112 |
+
]
|
1113 |
+
);
|
1114 |
+
|
1115 |
+
$this->add_group_control(
|
1116 |
+
Group_Control_Image_Size::get_type(),
|
1117 |
+
[
|
1118 |
+
'name' => "embedpress_pro_{$provider_name}_logo",
|
1119 |
+
'default' => 'full',
|
1120 |
+
'condition' => $logo_condition,
|
1121 |
+
'classes' => $this->pro_class,
|
1122 |
+
]
|
1123 |
+
);
|
1124 |
+
|
1125 |
+
$this->add_responsive_control(
|
1126 |
+
"embedpress_pro_{$provider_name}_logo_xpos",
|
1127 |
+
[
|
1128 |
+
'label' => __( 'Logo X Position', 'embedpress' ),
|
1129 |
+
'description' => __( 'Change this number to move your logo in horizontal direction.', 'embedpress' ),
|
1130 |
+
'type' => Controls_Manager::SLIDER,
|
1131 |
+
'size_units' => [ 'px', '%' ],
|
1132 |
+
'range' => [
|
1133 |
+
'px' => [
|
1134 |
+
'min' => 0,
|
1135 |
+
'max' => 1000,
|
1136 |
+
'step' => 5,
|
1137 |
+
],
|
1138 |
+
'%' => [
|
1139 |
+
'min' => 0,
|
1140 |
+
'max' => 100,
|
1141 |
+
],
|
1142 |
+
],
|
1143 |
+
'default' => [
|
1144 |
+
'unit' => '%',
|
1145 |
+
'size' => 10,
|
1146 |
+
],
|
1147 |
+
'selectors' => [
|
1148 |
+
"{{WRAPPER}} .ose-{$provider_name} .watermark" => 'right: {{SIZE}}{{UNIT}};',
|
1149 |
+
],
|
1150 |
+
'condition' => $logo_condition,
|
1151 |
+
'classes' => $this->pro_class,
|
1152 |
+
]
|
1153 |
+
);
|
1154 |
+
$this->add_responsive_control(
|
1155 |
+
"embedpress_pro_{$provider_name}_logo_ypos",
|
1156 |
+
[
|
1157 |
+
'label' => __( 'Logo Y Position (%)', 'embedpress' ),
|
1158 |
+
'description' => __( 'Change this number to move your logo in vertical direction.', 'embedpress' ),
|
1159 |
+
'type' => Controls_Manager::SLIDER,
|
1160 |
+
'size_units' => [ 'px', '%' ],
|
1161 |
+
'range' => [
|
1162 |
+
'px' => [
|
1163 |
+
'min' => 0,
|
1164 |
+
'max' => 1000,
|
1165 |
+
'step' => 5,
|
1166 |
+
],
|
1167 |
+
'%' => [
|
1168 |
+
'min' => 0,
|
1169 |
+
'max' => 100,
|
1170 |
+
],
|
1171 |
+
],
|
1172 |
+
'default' => [
|
1173 |
+
'unit' => '%',
|
1174 |
+
'size' => 10,
|
1175 |
+
],
|
1176 |
+
'selectors' => [
|
1177 |
+
"{{WRAPPER}} .ose-{$provider_name} .watermark" => 'bottom: {{SIZE}}{{UNIT}};',
|
1178 |
+
],
|
1179 |
+
'condition' => $logo_condition,
|
1180 |
+
'classes' => $this->pro_class,
|
1181 |
+
|
1182 |
+
]
|
1183 |
+
);
|
1184 |
+
$this->start_controls_tabs(
|
1185 |
+
"ep_{$provider_name}_cta_style_tabs",
|
1186 |
+
[
|
1187 |
+
'condition' => $logo_condition,
|
1188 |
+
]
|
1189 |
+
);
|
1190 |
+
|
1191 |
+
$this->start_controls_tab( "ep_{$provider_name}_cta_normal_tab",
|
1192 |
+
[
|
1193 |
+
'label' => __( 'Normal', 'embedpress' ),
|
1194 |
+
]
|
1195 |
+
);
|
1196 |
+
$this->add_control(
|
1197 |
+
"embedpress_pro_{$provider_name}_logo_opacity",
|
1198 |
+
[
|
1199 |
+
'label' => __( 'Logo Opacity', 'embedpress' ),
|
1200 |
+
'type' => Controls_Manager::SLIDER,
|
1201 |
+
'default' => [
|
1202 |
+
'size' => .5,
|
1203 |
+
],
|
1204 |
+
'range' => [
|
1205 |
+
'px' => [
|
1206 |
+
'max' => 1,
|
1207 |
+
'step' => 0.01,
|
1208 |
+
],
|
1209 |
+
],
|
1210 |
+
'selectors' => [
|
1211 |
+
"{{WRAPPER}} .ose-{$provider_name} .watermark" => 'opacity: {{SIZE}};',
|
1212 |
+
],
|
1213 |
+
'condition' => $logo_condition,
|
1214 |
+
'classes' => $this->pro_class,
|
1215 |
+
|
1216 |
+
]
|
1217 |
+
);
|
1218 |
+
$this->end_controls_tab();
|
1219 |
+
$this->start_controls_tab( "ep_{$provider_name}_cta_hover__tab",
|
1220 |
+
[
|
1221 |
+
'label' => __( 'Hover', 'embedpress' ),
|
1222 |
+
]
|
1223 |
+
);
|
1224 |
+
$this->add_control(
|
1225 |
+
"embedpress_pro_{$provider_name}_logo_opacity_hover",
|
1226 |
+
[
|
1227 |
+
'label' => __( 'Logo Opacity', 'embedpress' ),
|
1228 |
+
'type' => Controls_Manager::SLIDER,
|
1229 |
+
'size_units' => [ '%'],
|
1230 |
+
'default' => [
|
1231 |
+
'size' => 1,
|
1232 |
+
],
|
1233 |
+
'range' => [
|
1234 |
+
'px' => [
|
1235 |
+
'max' => 1,
|
1236 |
+
'step' => 0.01,
|
1237 |
+
],
|
1238 |
+
],
|
1239 |
+
'selectors' => [
|
1240 |
+
"{{WRAPPER}} .ose-{$provider_name} .watermark:hover" => 'opacity: {{SIZE}};',
|
1241 |
+
],
|
1242 |
+
'condition' => $logo_condition,
|
1243 |
+
'classes' => $this->pro_class,
|
1244 |
+
|
1245 |
+
]
|
1246 |
+
);
|
1247 |
+
$this->end_controls_tab();
|
1248 |
+
$this->end_controls_tabs();
|
1249 |
+
|
1250 |
+
$this->add_control(
|
1251 |
+
"embedpress_pro_{$provider_name}_cta",
|
1252 |
+
[
|
1253 |
+
'label' => __( 'CTA link for Logo', 'embedpress' ),
|
1254 |
+
'description' => __( 'You can show the logo inside a link. Leave it empty to hide it', 'embedpress' ),
|
1255 |
+
'type' => Controls_Manager::URL,
|
1256 |
+
'dynamic' => [
|
1257 |
+
'active' => true,
|
1258 |
+
],
|
1259 |
+
'placeholder' => __( 'https://your-link.com', 'embedpress' ),
|
1260 |
+
'condition' => $logo_condition,
|
1261 |
+
'classes' => $this->pro_class,
|
1262 |
+
'separator' => 'before',
|
1263 |
+
]
|
1264 |
+
);
|
1265 |
+
}
|
1266 |
+
|
1267 |
+
public function init_style_controls() {
|
1268 |
+
$this->start_controls_section(
|
1269 |
+
'embedpress_style_section',
|
1270 |
+
[
|
1271 |
+
'label' => __( 'Style', 'elementor' ),
|
1272 |
+
'tab' => Controls_Manager::TAB_STYLE,
|
1273 |
+
]
|
1274 |
+
);
|
1275 |
+
$this->add_control(
|
1276 |
+
'embedpress_elementor_aspect_ratio',
|
1277 |
+
[
|
1278 |
+
'label' => __( 'Aspect Ratio', 'embedpress' ),
|
1279 |
+
'description' => __( 'Good for any video. You may turn it off for other embed type.', 'embedpress' ),
|
1280 |
+
'type' => Controls_Manager::SELECT,
|
1281 |
+
'options' => [
|
1282 |
+
0 => __('None'),
|
1283 |
+
'169' => '16:9',
|
1284 |
+
'219' => '21:9',
|
1285 |
+
'43' => '4:3',
|
1286 |
+
'32' => '3:2',
|
1287 |
+
'11' => '1:1',
|
1288 |
+
'916' => '9:16',
|
1289 |
+
],
|
1290 |
+
'default' => 0,
|
1291 |
+
'prefix_class' => 'embedpress-aspect-ratio-',
|
1292 |
+
'frontend_available' => true,
|
1293 |
+
]
|
1294 |
+
);
|
1295 |
+
$this->add_control(
|
1296 |
+
'width',
|
1297 |
+
[
|
1298 |
+
'label' => __( 'Width', 'embedpress' ),
|
1299 |
+
'type' => Controls_Manager::SLIDER,
|
1300 |
+
'size_units' => [ 'px' ],
|
1301 |
+
'range' => [
|
1302 |
+
'px' => [
|
1303 |
+
'min' => 0,
|
1304 |
+
'max' => 1500,
|
1305 |
+
'step' => 5,
|
1306 |
+
],
|
1307 |
+
],
|
1308 |
+
'default' => [
|
1309 |
+
'unit' => 'px',
|
1310 |
+
'size' => 600,
|
1311 |
+
]
|
1312 |
+
]
|
1313 |
+
);
|
1314 |
+
$this->add_control(
|
1315 |
+
'height',
|
1316 |
+
[
|
1317 |
+
'label' => __( 'Height', 'embedpress' ),
|
1318 |
+
'type' => Controls_Manager::SLIDER,
|
1319 |
+
'size_units' => [ 'px' ],
|
1320 |
+
'range' => [
|
1321 |
+
'px' => [
|
1322 |
+
'min' => 0,
|
1323 |
+
'max' => 1500,
|
1324 |
+
'step' => 5,
|
1325 |
+
],
|
1326 |
+
],
|
1327 |
+
'default' => [
|
1328 |
+
'unit' => 'px',
|
1329 |
+
'size' => 400,
|
1330 |
+
]
|
1331 |
+
]
|
1332 |
+
);
|
1333 |
+
$this->add_responsive_control(
|
1334 |
+
'margin',
|
1335 |
+
[
|
1336 |
+
'label' => __( 'Margin', 'embedpress' ),
|
1337 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1338 |
+
'size_units' => [ 'px', '%', 'em' ],
|
1339 |
+
'selectors' => [
|
1340 |
+
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1341 |
+
],
|
1342 |
+
]
|
1343 |
+
);
|
1344 |
+
$this->add_responsive_control(
|
1345 |
+
'padding',
|
1346 |
+
[
|
1347 |
+
'label' => __( 'Padding', 'embedpress' ),
|
1348 |
+
'type' => Controls_Manager::DIMENSIONS,
|
1349 |
+
'size_units' => [ 'px', '%', 'em' ],
|
1350 |
+
'selectors' => [
|
1351 |
+
'{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
|
1352 |
+
],
|
1353 |
+
]
|
1354 |
+
);
|
1355 |
+
$this->add_group_control(
|
1356 |
+
Group_Control_Background::get_type(),
|
1357 |
+
[
|
1358 |
+
'name' => 'background',
|
1359 |
+
'label' => __( 'Background', 'embedpress' ),
|
1360 |
+
'types' => [ 'classic', 'gradient' ],
|
1361 |
+
'selector' => '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper, {{WRAPPER}} .embedpress-fit-aspect-ratio .embedpress-wrapper iframe',
|
1362 |
+
]
|
1363 |
+
);
|
1364 |
+
$this->add_group_control(
|
1365 |
+
Group_Control_Css_Filter::get_type(),
|
1366 |
+
[
|
1367 |
+
'name' => 'embedpress_elementor_css_filters',
|
1368 |
+
'selector' => '{{WRAPPER}} .embedpress-elements-wrapper .embedpress-wrapper',
|
1369 |
+
]
|
1370 |
+
);
|
1371 |
+
$this->end_controls_section();
|
1372 |
+
}
|
1373 |
protected function render() {
|
1374 |
add_filter( 'embedpress_should_modify_spotify', '__return_false');
|
1375 |
$settings = $this->get_settings_for_display();
|
1389 |
</div>
|
1390 |
<?php
|
1391 |
}
|
|
|
1392 |
public function onAfterEmbedSpotify( $embed, $setting ) {
|
1393 |
if ( !isset( $embed->provider_name ) || strtolower( $embed->provider_name ) !== 'spotify' || !isset( $embed->embed ) ) {
|
1394 |
return $embed;
|
1409 |
$embed->embed = str_replace( $url_full, $modified_url, $embed->embed );
|
1410 |
return $embed;
|
1411 |
}
|
|
|
|
|
|
|
1412 |
}
|
EmbedPress/Ends/Back/Handler.php
CHANGED
@@ -86,8 +86,9 @@ class Handler extends EndHandlerAbstract {
|
|
86 |
*
|
87 |
*/
|
88 |
public static function enqueueStyles() {
|
89 |
-
|
90 |
-
|
|
|
91 |
}
|
92 |
|
93 |
/**
|
@@ -422,6 +423,32 @@ class Handler extends EndHandlerAbstract {
|
|
422 |
'fast.wistia.com/embed/medias/*.jsonp',
|
423 |
// Boomplay (http://boomplay.com/)
|
424 |
'boomplay.com/*',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
425 |
];
|
426 |
}
|
427 |
|
86 |
*
|
87 |
*/
|
88 |
public static function enqueueStyles() {
|
89 |
+
wp_register_style( 'embedpress-addons', plugins_url( 'embedpress/assets/css/admin.css' ) );
|
90 |
+
wp_enqueue_style( 'embedpress-admin', plugins_url( 'embedpress/assets/css/admin.css' ) );
|
91 |
+
wp_enqueue_style( 'embedpress-addons', plugins_url( 'embedpress/assets/css/addons.css' ) );
|
92 |
}
|
93 |
|
94 |
/**
|
423 |
'fast.wistia.com/embed/medias/*.jsonp',
|
424 |
// Boomplay (http://boomplay.com/)
|
425 |
'boomplay.com/*',
|
426 |
+
'codepen.io/*',
|
427 |
+
'archivos.digital/*',
|
428 |
+
'audioclip.naver.com/*',
|
429 |
+
'app.blogcast.host/*',
|
430 |
+
'codepoints.net/*',
|
431 |
+
'codesandbox.io/*',
|
432 |
+
'commaful.com/*',
|
433 |
+
'*.survey.fm/*',
|
434 |
+
'survey.fm/*',
|
435 |
+
'datawrapper.dwcdn.net/*',
|
436 |
+
'*.didacte.com/*',
|
437 |
+
'didacte.com/*',
|
438 |
+
'digiteka.com/*',
|
439 |
+
'docdro.id/*',
|
440 |
+
'edumedia-sciences.com/*',
|
441 |
+
'ethfiddle.com/*',
|
442 |
+
'eyrie.io/*',
|
443 |
+
'*.getfader.com/*',
|
444 |
+
'getfader.com/*',
|
445 |
+
'fitapp.pro/*',
|
446 |
+
'fite.tv/*',
|
447 |
+
'public.flourish.studio/*',
|
448 |
+
'geograph.org.gg/*',
|
449 |
+
'geo-en.hlipp.de/*',
|
450 |
+
'geograph.org.uk/*',
|
451 |
+
'fortest.getshow.io/*',
|
452 |
];
|
453 |
}
|
454 |
|
EmbedPress/Ends/Back/Settings.php
DELETED
@@ -1,279 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace EmbedPress\Ends\Back;
|
4 |
-
|
5 |
-
(defined( 'ABSPATH' ) && defined( 'EMBEDPRESS_IS_LOADED' )) or die( "No direct script access allowed." );
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Entity that handles the plugin's settings page.
|
9 |
-
*
|
10 |
-
* @package EmbedPress
|
11 |
-
* @subpackage EmbedPress/Ends/Back
|
12 |
-
* @author EmbedPress <help@embedpress.com>
|
13 |
-
* @copyright Copyright (C) 2020 WPDeveloper. All rights reserved.
|
14 |
-
* @license GPLv3 or later
|
15 |
-
* @since 1.0.0
|
16 |
-
*/
|
17 |
-
class Settings {
|
18 |
-
/**
|
19 |
-
* This class namespace.
|
20 |
-
*
|
21 |
-
* @since 1.0.0
|
22 |
-
* @access private
|
23 |
-
* @static
|
24 |
-
*
|
25 |
-
* @var string $namespace
|
26 |
-
*/
|
27 |
-
private static $namespace = '\\EmbedPress\\Ends\\Back\\Settings';
|
28 |
-
|
29 |
-
/**
|
30 |
-
* The plugin's unique identifier.
|
31 |
-
*
|
32 |
-
* @since 1.0.0
|
33 |
-
* @access private
|
34 |
-
* @static
|
35 |
-
*
|
36 |
-
* @var string $identifier
|
37 |
-
*/
|
38 |
-
private static $identifier = "plg_embedpress";
|
39 |
-
|
40 |
-
/**
|
41 |
-
* Unique identifier to the plugin's admin settings section.
|
42 |
-
*
|
43 |
-
* @since 1.0.0
|
44 |
-
* @access private
|
45 |
-
* @static
|
46 |
-
*
|
47 |
-
* @var string $sectionAdminIdentifier
|
48 |
-
*/
|
49 |
-
private static $sectionAdminIdentifier = "embedpress_options_admin";
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Unique identifier to the plugin's general settings section.
|
53 |
-
*
|
54 |
-
* @since 1.0.0
|
55 |
-
* @access private
|
56 |
-
* @static
|
57 |
-
*
|
58 |
-
* @var string $sectionGroupIdentifier The name of the plugin.
|
59 |
-
*/
|
60 |
-
private static $sectionGroupIdentifier = "embedpress";
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Class constructor. This prevents the class being directly instantiated.
|
64 |
-
*
|
65 |
-
* @since 1.0.0
|
66 |
-
*/
|
67 |
-
public function __construct() {
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* This prevents the class being cloned.
|
72 |
-
*
|
73 |
-
* @since 1.0.0
|
74 |
-
*/
|
75 |
-
public function __clone() {
|
76 |
-
}
|
77 |
-
|
78 |
-
/**
|
79 |
-
* Method that adds an sub-item for EmbedPress to the WordPress Settings menu.
|
80 |
-
*
|
81 |
-
* @since 1.0.0
|
82 |
-
* @static
|
83 |
-
*/
|
84 |
-
public static function registerMenuItem() {
|
85 |
-
add_menu_page( __('EmbedPress Settings', 'embedpress'), 'EmbedPress', 'manage_options', 'embedpress',
|
86 |
-
[ self::$namespace, 'renderForm' ], null, 64 );
|
87 |
-
}
|
88 |
-
|
89 |
-
/**
|
90 |
-
* Method that configures the EmbedPress settings page.
|
91 |
-
*
|
92 |
-
* @since 1.0.0
|
93 |
-
* @static
|
94 |
-
*/
|
95 |
-
public static function registerActions() {
|
96 |
-
$activeTab = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : "";
|
97 |
-
$action = ( $activeTab !== "embedpress" ) ? "embedpress:{$activeTab}:settings:register" : '';
|
98 |
-
if ( !empty( $activeTab ) && has_action( $action ) ) {
|
99 |
-
do_action( $action, [
|
100 |
-
'id' => self::$sectionAdminIdentifier,
|
101 |
-
'slug' => self::$identifier,
|
102 |
-
] );
|
103 |
-
}
|
104 |
-
}
|
105 |
-
|
106 |
-
/**
|
107 |
-
* Returns true if the plugin is active
|
108 |
-
*
|
109 |
-
* @param string $plugin
|
110 |
-
*
|
111 |
-
* @return boolean
|
112 |
-
*/
|
113 |
-
protected static function is_plugin_active( $plugin ) {
|
114 |
-
return is_plugin_active( "{$plugin}/{$plugin}.php" );
|
115 |
-
}
|
116 |
-
|
117 |
-
/**
|
118 |
-
* Returns true if the plugin is installed
|
119 |
-
*
|
120 |
-
* @param string $plugin
|
121 |
-
*
|
122 |
-
* @return boolean
|
123 |
-
*/
|
124 |
-
protected static function is_plugin_installed( $plugin ) {
|
125 |
-
return file_exists( plugin_dir_path( EMBEDPRESS_ROOT ) . "{$plugin}/{$plugin}.php" );
|
126 |
-
}
|
127 |
-
|
128 |
-
/**
|
129 |
-
* Method that render the settings form.
|
130 |
-
*
|
131 |
-
* @since 1.0.0
|
132 |
-
* @static
|
133 |
-
*/
|
134 |
-
public static function renderForm() {
|
135 |
-
// Add the color picker css file
|
136 |
-
wp_enqueue_style( 'wp-color-picker' );
|
137 |
-
// Include our custom jQuery file with WordPress Color Picker dependency
|
138 |
-
wp_enqueue_script( 'ep-settings', EMBEDPRESS_URL_ASSETS . 'js/settings.js', [ 'wp-color-picker' ],
|
139 |
-
EMBEDPRESS_VERSION, true );
|
140 |
-
|
141 |
-
$activeTab = isset( $_GET['tab'] ) ? strtolower( $_GET['tab'] ) : "";
|
142 |
-
$is_upgrade_tab_active = ($activeTab === 'embedpress_get_pro' || empty( $activeTab )) && !defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' );
|
143 |
-
$is_license_tab_active = ($activeTab === 'embedpress_license' || empty( $activeTab )) && defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' );
|
144 |
-
$settingsFieldsIdentifier = !empty( $activeTab ) ? "embedpress:{$activeTab}" : self::$sectionGroupIdentifier;
|
145 |
-
$settingsSectionsIdentifier = !empty( $activeTab ) ? "embedpress:{$activeTab}" : self::$identifier;
|
146 |
-
$five_stars = `
|
147 |
-
<span class="dashicons dashicons-star-filled"></span>
|
148 |
-
<span class="dashicons dashicons-star-filled"></span>
|
149 |
-
<span class="dashicons dashicons-star-filled"></span>
|
150 |
-
<span class="dashicons dashicons-star-filled"></span>
|
151 |
-
<span class="dashicons dashicons-star-filled"></span>
|
152 |
-
`;
|
153 |
-
?>
|
154 |
-
<div id="embedpress-settings-wrapper">
|
155 |
-
<header>
|
156 |
-
<h1 class="pressshack-title">
|
157 |
-
<a href="//wordpress.org/plugins/embedpress" target="_blank" rel="noopener noreferrer"
|
158 |
-
title="EmbedPress">
|
159 |
-
EmbedPress
|
160 |
-
</a>
|
161 |
-
</h1>
|
162 |
-
<div class="embedpress-version-name">
|
163 |
-
<span class="free"> <?php esc_html_e("Core Version: ", "embedpress"); echo EMBEDPRESS_VERSION; ?></span>
|
164 |
-
<?php if ( defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' ) ) { ?>
|
165 |
-
<span class="pro"> <?php esc_html_e("Pro Version: ", "embedpress"); echo EMBEDPRESS_PRO_PLUGIN_VERSION; ?></span>
|
166 |
-
<?php } ?>
|
167 |
-
</div>
|
168 |
-
</header>
|
169 |
-
|
170 |
-
<?php settings_errors(); ?>
|
171 |
-
<div>
|
172 |
-
<h2 class="nav-tab-wrapper">
|
173 |
-
<?php if ( !defined( 'EMBEDPRESS_PRO_PLUGIN_VERSION' ) ): ?>
|
174 |
-
<a href="?page=embedpress&tab=embedpress_get_pro"
|
175 |
-
class="nav-tab<?php echo $is_upgrade_tab_active ? ' nav-tab-active' : ''; ?> ">
|
176 |
-
<?php esc_html_e( 'Go Premium', 'embedpress'); ?>
|
177 |
-
</a>
|
178 |
-
<?php endif; ?>
|
179 |
-
<?php do_action( 'embedpress:settings:render:tab', $activeTab ); ?>
|
180 |
-
<?php do_action( 'embedpress_license_tab', $activeTab ); ?>
|
181 |
-
</h2>
|
182 |
-
|
183 |
-
<?php if ( $activeTab !== 'addons' ) : ?>
|
184 |
-
<form action="options.php" method="POST" style="padding-bottom: 20px;">
|
185 |
-
<?php settings_fields( $settingsFieldsIdentifier ); ?>
|
186 |
-
<?php do_settings_sections( $settingsSectionsIdentifier ); ?>
|
187 |
-
<?php if ( !$is_license_tab_active && !$is_upgrade_tab_active ) {
|
188 |
-
?>
|
189 |
-
<button type="submit" class="button button-primary embedpress-setting-save"><?php esc_html_e( 'Save Changes', 'embedpress'); ?>
|
190 |
-
</button>
|
191 |
-
<?php } ?>
|
192 |
-
|
193 |
-
</form>
|
194 |
-
<?php endif; ?>
|
195 |
-
<?php if ( $is_license_tab_active ) : ?>
|
196 |
-
<?php do_action( 'embedpress_license' ); ?>
|
197 |
-
<?php endif; ?>
|
198 |
-
<?php if ( $is_upgrade_tab_active ) : ?>
|
199 |
-
<div class=" embedpress-go-premium">
|
200 |
-
<div class="embedpress-col-half">
|
201 |
-
<div class="embedpress-admin-block-wrapper">
|
202 |
-
<div class="embedpress-admin-block embedpress-admin-block-docs">
|
203 |
-
<header class="embedpress-admin-block-header">
|
204 |
-
<div class="embedpress-admin-block-header-icon">
|
205 |
-
<img src="<?php echo plugins_url( 'assets/images/icon-why-premium.svg',
|
206 |
-
EMBEDPRESS_PLUGIN_BASENAME ); ?>" alt="embedpress-go-pro">
|
207 |
-
</div>
|
208 |
-
<h4 class="embedpress-admin-title"><?php esc_html_e( 'Why upgrade to Premium Version?', 'embedpress'); ?></h4>
|
209 |
-
</header>
|
210 |
-
<div class="embedpress-admin-block-content">
|
211 |
-
<p><?php esc_html_e( 'The premium version helps us to continue development of the product
|
212 |
-
incorporating even more features and enhancements.', 'embedpress'); ?></p>
|
213 |
-
<p><?php esc_html_e( 'You will also get world class support from our dedicated team, 24/7.', 'embedpress'); ?></p>
|
214 |
-
<a href="https://wpdeveloper.net/in/upgrade-embedpress" target="_blank"
|
215 |
-
class="button embedpress-btn"><?php esc_html_e( 'Get Pro Version', 'embedpress'); ?></a>
|
216 |
-
</div>
|
217 |
-
</div>
|
218 |
-
</div><!--admin block-wrapper end-->
|
219 |
-
</div>
|
220 |
-
</div>
|
221 |
-
<?php endif; ?>
|
222 |
-
</div>
|
223 |
-
|
224 |
-
<footer>
|
225 |
-
<p>
|
226 |
-
<a href="//embedpress.com/go/review-ep" target="_blank"
|
227 |
-
rel="noopener noreferrer">
|
228 |
-
<?php
|
229 |
-
/* translators: 1: EmbedPress Plugin Name, 2: 5 stars. */
|
230 |
-
printf( __('If you like %1$s please leave us a 5 stars %2$s
|
231 |
-
rating. Thank you!', 'embedpress'), '<strong>EmbedPress</strong>', $five_stars ) ?>
|
232 |
-
</a>
|
233 |
-
</p>
|
234 |
-
<hr>
|
235 |
-
<nav>
|
236 |
-
<ul>
|
237 |
-
<li>
|
238 |
-
<a href="//embedpress.com" target="_blank" rel="noopener noreferrer"
|
239 |
-
title="About EmbedPress"><?php esc_html_e( 'About', 'embedpress'); ?></a>
|
240 |
-
</li>
|
241 |
-
<li>
|
242 |
-
<a href="//embedpress.com/sources/" target="_blank" rel="noopener noreferrer"
|
243 |
-
title="List of supported sources by EmbedPress"><?php esc_html_e( 'Supported Sources', 'embedpress'); ?></a>
|
244 |
-
</li>
|
245 |
-
<li>
|
246 |
-
<a href="//embedpress.com/documentation/" target="_blank" rel="noopener noreferrer"
|
247 |
-
title="EmbedPress Documentation"><?php esc_html_e( 'Documentation', 'embedpress'); ?></a>
|
248 |
-
</li>
|
249 |
-
<li>
|
250 |
-
<a href="https://wpdeveloper.net/in/upgrade-embedpress" target="_blank" rel="noopener noreferrer"
|
251 |
-
title="Get EmbedPress Pro"><?php esc_html_e( 'Get EmbedPress Pro', 'embedpress'); ?></a>
|
252 |
-
</li>
|
253 |
-
<li>
|
254 |
-
<a href="//embedpress.com/support/" target="_blank" rel="noopener noreferrer"
|
255 |
-
title="Contact the EmbedPress team"><?php esc_html_e( 'Contact', 'embedpress'); ?></a>
|
256 |
-
</li>
|
257 |
-
<li>
|
258 |
-
<a href="//twitter.com/wpdevteam" target="_blank" rel="noopener noreferrer">
|
259 |
-
<span class="dashicons dashicons-twitter"></span>
|
260 |
-
</a>
|
261 |
-
</li>
|
262 |
-
<li>
|
263 |
-
<a href="//www.facebook.com/WPDeveloperNet/" target="_blank" rel="noopener noreferrer">
|
264 |
-
<span class="dashicons dashicons-facebook"></span>
|
265 |
-
</a>
|
266 |
-
</li>
|
267 |
-
</ul>
|
268 |
-
</nav>
|
269 |
-
<p>
|
270 |
-
<a href="//embedpress.com" target="_blank" rel="noopener noreferrer">
|
271 |
-
<img width="100" alt="embedpress logo" src="<?php echo plugins_url( 'assets/images/embedpress.png',
|
272 |
-
EMBEDPRESS_PLUGIN_BASENAME ); ?>">
|
273 |
-
</a>
|
274 |
-
</p>
|
275 |
-
</footer>
|
276 |
-
</div>
|
277 |
-
<?php
|
278 |
-
}
|
279 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmbedPress/Ends/Back/Settings/EmbedpressSettings.php
CHANGED
@@ -154,7 +154,7 @@ class EmbedpressSettings {
|
|
154 |
$nonce_field = wp_nonce_field('ep_settings_nonce', 'ep_settings_nonce', true, false);
|
155 |
$ep_page = admin_url('admin.php?page='.$this->page_slug);
|
156 |
$gen_menu_template_names = apply_filters('ep_general_menu_tmpl_names', ['general', 'shortcode',]);
|
157 |
-
$platform_menu_template_names = apply_filters('
|
158 |
$brand_menu_template_names = apply_filters('ep_brand_menu_templates', ['custom-logo', 'branding',]);
|
159 |
$pro_active = is_embedpress_pro_active();
|
160 |
$coming_soon = "<span class='ep-coming-soon'>". esc_html__( '(Coming soon)', 'embedpress'). "</span>";
|
@@ -185,7 +185,7 @@ class EmbedpressSettings {
|
|
185 |
}
|
186 |
|
187 |
public function save_general_settings() {
|
188 |
-
$settings = (array) get_option( EMBEDPRESS_PLG_NAME);
|
189 |
$settings ['enableEmbedResizeWidth'] = isset( $_POST['enableEmbedResizeWidth']) ? intval( $_POST['enableEmbedResizeWidth']) : 600;
|
190 |
$settings ['enableEmbedResizeHeight'] = isset( $_POST['enableEmbedResizeHeight']) ? intval( $_POST['enableEmbedResizeHeight']) : 550;
|
191 |
|
@@ -198,7 +198,7 @@ class EmbedpressSettings {
|
|
198 |
|
199 |
public function save_youtube_settings() {
|
200 |
$option_name = EMBEDPRESS_PLG_NAME.':youtube';
|
201 |
-
$settings = get_option( $option_name);
|
202 |
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
203 |
$settings['controls'] = isset( $_POST['controls']) ? sanitize_text_field( $_POST['controls']) : '';
|
204 |
$settings['fs'] = isset( $_POST['fs']) ? sanitize_text_field( $_POST['fs']) : '';
|
@@ -214,7 +214,7 @@ class EmbedpressSettings {
|
|
214 |
|
215 |
public function save_wistia_settings() {
|
216 |
$option_name = EMBEDPRESS_PLG_NAME.':wistia';
|
217 |
-
$settings = get_option( $option_name);
|
218 |
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
219 |
$settings['display_fullscreen_button'] = isset( $_POST['display_fullscreen_button']) ? sanitize_text_field( $_POST['display_fullscreen_button']) : '';
|
220 |
$settings['small_play_button'] = isset( $_POST['small_play_button']) ? sanitize_text_field( $_POST['small_play_button']) : '';
|
@@ -230,7 +230,7 @@ class EmbedpressSettings {
|
|
230 |
|
231 |
public function save_vimeo_settings() {
|
232 |
$option_name = EMBEDPRESS_PLG_NAME.':vimeo';
|
233 |
-
$settings = get_option( $option_name);
|
234 |
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
235 |
$settings['color'] = isset( $_POST['color']) ? sanitize_text_field( $_POST['color']) : '#00adef';
|
236 |
$settings['display_title'] = isset( $_POST['display_title']) ? sanitize_text_field( $_POST['display_title']) : 1;
|
@@ -243,7 +243,7 @@ class EmbedpressSettings {
|
|
243 |
|
244 |
public function save_twitch_settings() {
|
245 |
$option_name = EMBEDPRESS_PLG_NAME.':twitch';
|
246 |
-
$settings = get_option( $option_name);
|
247 |
$settings['embedpress_pro_twitch_autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : 'no';
|
248 |
$settings['embedpress_pro_fs'] = isset( $_POST['fs']) ? sanitize_text_field( $_POST['fs']) : 'yes';
|
249 |
$settings['license_key'] = 1; // backward compatibility
|
@@ -255,7 +255,7 @@ class EmbedpressSettings {
|
|
255 |
|
256 |
public function save_spotify_settings() {
|
257 |
$option_name = EMBEDPRESS_PLG_NAME.':spotify';
|
258 |
-
$settings = get_option( $option_name);
|
259 |
$settings['theme'] = isset( $_POST['spotify_theme']) ? sanitize_text_field( $_POST['spotify_theme']) : '1';
|
260 |
$settings['license_key'] = 1; // backward compatibility
|
261 |
|
@@ -274,4 +274,40 @@ class EmbedpressSettings {
|
|
274 |
do_action( 'after_embedpress_branding_save');
|
275 |
|
276 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
}
|
154 |
$nonce_field = wp_nonce_field('ep_settings_nonce', 'ep_settings_nonce', true, false);
|
155 |
$ep_page = admin_url('admin.php?page='.$this->page_slug);
|
156 |
$gen_menu_template_names = apply_filters('ep_general_menu_tmpl_names', ['general', 'shortcode',]);
|
157 |
+
$platform_menu_template_names = apply_filters('ep_platform_menu_tmpl_names', [ 'youtube', 'vimeo', 'wistia', 'twitch','dailymotion', 'soundcloud' ,'spotify']);
|
158 |
$brand_menu_template_names = apply_filters('ep_brand_menu_templates', ['custom-logo', 'branding',]);
|
159 |
$pro_active = is_embedpress_pro_active();
|
160 |
$coming_soon = "<span class='ep-coming-soon'>". esc_html__( '(Coming soon)', 'embedpress'). "</span>";
|
185 |
}
|
186 |
|
187 |
public function save_general_settings() {
|
188 |
+
$settings = (array) get_option( EMBEDPRESS_PLG_NAME, []);
|
189 |
$settings ['enableEmbedResizeWidth'] = isset( $_POST['enableEmbedResizeWidth']) ? intval( $_POST['enableEmbedResizeWidth']) : 600;
|
190 |
$settings ['enableEmbedResizeHeight'] = isset( $_POST['enableEmbedResizeHeight']) ? intval( $_POST['enableEmbedResizeHeight']) : 550;
|
191 |
|
198 |
|
199 |
public function save_youtube_settings() {
|
200 |
$option_name = EMBEDPRESS_PLG_NAME.':youtube';
|
201 |
+
$settings = get_option( $option_name, []);
|
202 |
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
203 |
$settings['controls'] = isset( $_POST['controls']) ? sanitize_text_field( $_POST['controls']) : '';
|
204 |
$settings['fs'] = isset( $_POST['fs']) ? sanitize_text_field( $_POST['fs']) : '';
|
214 |
|
215 |
public function save_wistia_settings() {
|
216 |
$option_name = EMBEDPRESS_PLG_NAME.':wistia';
|
217 |
+
$settings = get_option( $option_name, []);
|
218 |
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
219 |
$settings['display_fullscreen_button'] = isset( $_POST['display_fullscreen_button']) ? sanitize_text_field( $_POST['display_fullscreen_button']) : '';
|
220 |
$settings['small_play_button'] = isset( $_POST['small_play_button']) ? sanitize_text_field( $_POST['small_play_button']) : '';
|
230 |
|
231 |
public function save_vimeo_settings() {
|
232 |
$option_name = EMBEDPRESS_PLG_NAME.':vimeo';
|
233 |
+
$settings = get_option( $option_name, []);
|
234 |
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
235 |
$settings['color'] = isset( $_POST['color']) ? sanitize_text_field( $_POST['color']) : '#00adef';
|
236 |
$settings['display_title'] = isset( $_POST['display_title']) ? sanitize_text_field( $_POST['display_title']) : 1;
|
243 |
|
244 |
public function save_twitch_settings() {
|
245 |
$option_name = EMBEDPRESS_PLG_NAME.':twitch';
|
246 |
+
$settings = get_option( $option_name, []);
|
247 |
$settings['embedpress_pro_twitch_autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : 'no';
|
248 |
$settings['embedpress_pro_fs'] = isset( $_POST['fs']) ? sanitize_text_field( $_POST['fs']) : 'yes';
|
249 |
$settings['license_key'] = 1; // backward compatibility
|
255 |
|
256 |
public function save_spotify_settings() {
|
257 |
$option_name = EMBEDPRESS_PLG_NAME.':spotify';
|
258 |
+
$settings = get_option( $option_name, []);
|
259 |
$settings['theme'] = isset( $_POST['spotify_theme']) ? sanitize_text_field( $_POST['spotify_theme']) : '1';
|
260 |
$settings['license_key'] = 1; // backward compatibility
|
261 |
|
274 |
do_action( 'after_embedpress_branding_save');
|
275 |
|
276 |
}
|
277 |
+
|
278 |
+
public function save_dailymotion_settings() {
|
279 |
+
$option_name = EMBEDPRESS_PLG_NAME.':dailymotion';
|
280 |
+
$settings = get_option( $option_name, []);
|
281 |
+
$settings['visual'] = isset( $_POST['visual']) ? sanitize_text_field( $_POST['visual']) : '';
|
282 |
+
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
283 |
+
$settings['play_on_mobile'] = isset( $_POST['play_on_mobile']) ? sanitize_text_field( $_POST['play_on_mobile']) : '';
|
284 |
+
$settings['color'] = isset( $_POST['color']) ? sanitize_text_field( $_POST['color']) : '#dd3333';
|
285 |
+
$settings['controls'] = isset( $_POST['controls']) ? sanitize_text_field( $_POST['controls']) : '';
|
286 |
+
$settings['video_info'] = isset( $_POST['video_info']) ? sanitize_text_field( $_POST['video_info']) : '';
|
287 |
+
$settings['mute'] = isset( $_POST['mute']) ? sanitize_text_field( $_POST['mute']) : '';
|
288 |
+
// Pro will handle g_loading_animation settings and other
|
289 |
+
$settings = apply_filters( 'ep_dailymotion_settings_before_save', $settings);
|
290 |
+
update_option( $option_name, $settings);
|
291 |
+
do_action( 'ep_dailymotion_settings_after_save', $settings);
|
292 |
+
}
|
293 |
+
|
294 |
+
public function save_soundcloud_settings() {
|
295 |
+
$option_name = EMBEDPRESS_PLG_NAME.':soundcloud';
|
296 |
+
$settings = get_option( $option_name, []);
|
297 |
+
$settings['visual'] = isset( $_POST['visual']) ? sanitize_text_field( $_POST['visual']) : '';
|
298 |
+
$settings['autoplay'] = isset( $_POST['autoplay']) ? sanitize_text_field( $_POST['autoplay']) : '';
|
299 |
+
$settings['play_on_mobile'] = isset( $_POST['play_on_mobile']) ? sanitize_text_field( $_POST['play_on_mobile']) : '';
|
300 |
+
$settings['share_button'] = isset( $_POST['share_button']) ? sanitize_text_field( $_POST['share_button']) : '';
|
301 |
+
$settings['comments'] = isset( $_POST['comments']) ? sanitize_text_field( $_POST['comments']) : '';
|
302 |
+
$settings['color'] = isset( $_POST['color']) ? sanitize_text_field( $_POST['color']) : '';
|
303 |
+
$settings['artwork'] = isset( $_POST['artwork']) ? sanitize_text_field( $_POST['artwork']) : '';
|
304 |
+
$settings['play_count'] = isset( $_POST['play_count']) ? sanitize_text_field( $_POST['play_count']) : '';
|
305 |
+
$settings['username'] = isset( $_POST['username']) ? sanitize_text_field( $_POST['username']) : '';
|
306 |
+
|
307 |
+
$settings['license_key'] = 1; // backward compatibility
|
308 |
+
// Pro will handle g_loading_animation settings and other
|
309 |
+
$settings = apply_filters( 'ep_soundcloud_settings_before_save', $settings);
|
310 |
+
update_option( $option_name, $settings);
|
311 |
+
do_action( 'ep_soundcloud_settings_after_save', $settings);
|
312 |
+
}
|
313 |
}
|
EmbedPress/Ends/Back/Settings/assets/img/dailymotion.svg
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
<svg height="512pt" viewBox="0 0 512 512" width="512pt" xmlns="http://www.w3.org/2000/svg"><path d="m512 256c0 141.386719-114.613281 256-256 256s-256-114.613281-256-256 114.613281-256 256-256 256 114.613281 256 256zm0 0" fill="#006ef5"/><path d="m512 256c0-5.152344-.171875-10.265625-.46875-15.339844l-158.53125-158.53125-66.453125 15.371094v107.957031c-.164063-.152343-.324219-.300781-.492187-.453125-5.714844-6.375-18.191407-18.09375-31.785157-25.527344-13.976562-7.621093-29.597656-11.445312-46.863281-11.445312-15.996094 0-30.679688 3.074219-44.019531 9.25-13.367188 6.171875-24.902344 14.609375-34.625 25.328125-9.726563 10.722656-17.265625 23.421875-22.597657 38.097656-5.355468 14.695313-8.011718 30.40625-8.011718 47.148438 0 17.308593 2.890625 33.238281 8.714844 47.78125 5.804687 14.546875 13.882812 27.242187 24.242187 38.097656 0 0 82.089844 82.074219 137.953125 137.9375 135.316406-6.800781 242.9375-118.667969 242.9375-255.671875zm0 0" fill="#004eb2"/><path d="m286.546875 97.5v108.050781c-5.480469-6.234375-18.300781-18.429687-32.277344-26.074219-13.976562-7.621093-29.597656-11.445312-46.863281-11.445312-15.996094 0-30.679688 3.078125-44.019531 9.25-13.367188 6.171875-24.902344 14.609375-34.625 25.332031-9.726563 10.71875-17.265625 23.417969-22.597657 38.09375-5.355468 14.699219-8.011718 30.40625-8.011718 47.148438 0 17.3125 2.890625 33.238281 8.714844 47.785156 5.804687 14.542969 13.882812 27.242187 24.242187 38.09375 10.359375 10.875 22.691406 19.3125 36.976563 25.332031 14.28125 6.019532 29.902343 9.027344 46.863281 9.027344 16.957031 0 32.886719-3.515625 47.804687-10.566406 9.066406-4.285156 17.003906-9.929688 23.792969-16.9375v27.503906h66.453125v-325.964844zm-117.359375 193.402344c0-32.355469 26.230469-58.585938 58.585938-58.585938 32.355468 0 58.585937 26.230469 58.585937 58.585938 0 32.355468-26.230469 58.585937-58.585937 58.585937-32.355469 0-58.585938-26.230469-58.585938-58.585937zm0 0" fill="#fff"/><path d="m286.550781 97.5v108.050781c-5.480469-6.230469-18.300781-18.429687-32.28125-26.070312-3.648437-1.992188-7.398437-3.71875-11.269531-5.191407v60.03125c24.980469 6.699219 43.359375 29.5 43.359375 56.578126 0 27.089843-18.378906 49.890624-43.359375 56.589843v57.152344c6.769531-1.710937 13.351562-4.082031 19.75-7.109375 9.070312-4.292969 17.011719-9.929688 23.800781-16.941406v27.5h66.449219v-325.960938zm0 0" fill="#fff5cb"/></svg>
|
EmbedPress/Ends/Back/Settings/assets/img/soundcloud.svg
ADDED
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
4 |
+
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
5 |
+
viewBox="0 0 112.196 112.196" style="enable-background:new 0 0 112.196 112.196;" xml:space="preserve">
|
6 |
+
<g>
|
7 |
+
<circle style="fill:#FF6A22;" cx="56.098" cy="56.098" r="56.098"/>
|
8 |
+
<g>
|
9 |
+
<path style="fill:#F1F2F2;" d="M16.707,68.833c-0.027,0.182-0.157,0.312-0.326,0.312c-0.169,0-0.299-0.13-0.325-0.316
|
10 |
+
l-0.593-4.438l0.593-4.512c0.025-0.188,0.155-0.318,0.325-0.318c0.168,0,0.298,0.13,0.326,0.318l0.706,4.517L16.707,68.833z
|
11 |
+
M19.728,71.529c-0.028,0.193-0.168,0.328-0.341,0.328c-0.168,0-0.315-0.135-0.338-0.328l-0.798-7.139l0.798-7.299
|
12 |
+
c0.024-0.188,0.17-0.328,0.338-0.328c0.173,0,0.313,0.137,0.341,0.328l0.908,7.299L19.728,71.529z M22.988,72.738
|
13 |
+
c-0.023,0.232-0.197,0.397-0.406,0.397c-0.216,0-0.387-0.165-0.408-0.397l-0.757-8.342l0.757-8.659
|
14 |
+
c0.019-0.235,0.192-0.403,0.408-0.403c0.209,0,0.382,0.168,0.406,0.403l0.859,8.659L22.988,72.738z M26.28,73.003
|
15 |
+
c-0.024,0.266-0.232,0.467-0.479,0.467c-0.253,0-0.46-0.201-0.481-0.467l-0.715-8.607l0.715-8.897
|
16 |
+
c0.021-0.268,0.228-0.469,0.481-0.469c0.247,0,0.455,0.201,0.479,0.469l0.811,8.897L26.28,73.003z M29.59,73.072
|
17 |
+
c-0.017,0.309-0.258,0.538-0.543,0.538c-0.294,0-0.527-0.229-0.547-0.538l-0.676-8.677l0.676-8.254
|
18 |
+
c0.021-0.307,0.253-0.536,0.547-0.536c0.29,0,0.526,0.229,0.543,0.532l0.766,8.258L29.59,73.072z M32.932,73.077v-0.005
|
19 |
+
c-0.02,0.342-0.291,0.612-0.617,0.612c-0.327,0-0.598-0.271-0.617-0.607l-0.631-8.677l0.631-13.429
|
20 |
+
c0.019-0.342,0.29-0.612,0.617-0.612c0.327,0,0.598,0.271,0.617,0.607l0.715,13.434L32.932,73.077z M36.249,73.072v-0.005
|
21 |
+
c-0.02,0.378-0.319,0.679-0.689,0.679c-0.363,0-0.663-0.301-0.681-0.679l-0.596-8.621l0.596-16.501
|
22 |
+
c0.018-0.378,0.318-0.677,0.681-0.677c0.37,0,0.669,0.299,0.689,0.677l0.671,16.501L36.249,73.072z M39.69,72.939v-0.005
|
23 |
+
c-0.015,0.421-0.346,0.748-0.753,0.748c-0.407,0-0.738-0.327-0.753-0.743l-0.553-8.533c0,0,0.553-17.876,0.553-17.881
|
24 |
+
c0.016-0.416,0.346-0.749,0.753-0.749c0.407,0,0.739,0.333,0.753,0.749l0.625,17.881L39.69,72.939z M43.111,72.882
|
25 |
+
c-0.016,0.458-0.375,0.817-0.822,0.817c-0.448,0-0.807-0.359-0.823-0.813l-0.516-8.482l0.516-18.478
|
26 |
+
c0.016-0.46,0.375-0.818,0.823-0.818c0.447,0,0.807,0.358,0.822,0.818l0.573,18.478L43.111,72.882z M46.554,72.807v-0.005
|
27 |
+
c-0.016,0.495-0.403,0.888-0.894,0.888c-0.484,0-0.879-0.393-0.888-0.883l-0.474-8.401L44.767,46.4
|
28 |
+
c0.014-0.502,0.408-0.89,0.893-0.89c0.491,0,0.878,0.388,0.894,0.89l0.532,18.006L46.554,72.807z M50.025,72.757V72.75
|
29 |
+
c-0.008,0.539-0.434,0.954-0.96,0.954c-0.53,0-0.95-0.415-0.966-0.947l-0.428-8.352L48.1,47.058
|
30 |
+
c0.016-0.538,0.436-0.959,0.966-0.959c0.526,0,0.952,0.421,0.96,0.959l0.485,17.352L50.025,72.757z M53.566,71.876l-0.043,0.818
|
31 |
+
c-0.005,0.285-0.125,0.543-0.308,0.729c-0.188,0.183-0.446,0.3-0.719,0.3c-0.318,0-0.598-0.146-0.79-0.376
|
32 |
+
c-0.142-0.167-0.23-0.383-0.24-0.61c-0.003-0.01-0.003-0.023-0.003-0.037c0,0-0.395-8.286-0.395-8.3l0.39-20.443l0.005-0.196
|
33 |
+
c0.003-0.358,0.193-0.677,0.477-0.86c0.159-0.106,0.347-0.168,0.557-0.168c0.206,0,0.401,0.064,0.564,0.177
|
34 |
+
c0.277,0.185,0.458,0.496,0.463,0.852l0.434,20.648L53.566,71.876z M57.007,72.587v-0.01c-0.007,0.604-0.502,1.096-1.1,1.096
|
35 |
+
c-0.6,0-1.094-0.492-1.1-1.091l-0.227-4.03l-0.223-4.138l0.45-22.406v-0.113c0.001-0.34,0.161-0.644,0.408-0.849
|
36 |
+
c0.189-0.155,0.432-0.249,0.692-0.249c0.207,0,0.399,0.057,0.563,0.153c0.313,0.196,0.532,0.543,0.542,0.94l0.487,22.523
|
37 |
+
L57.007,72.587z M86.74,73.695c0,0-27.683,0-27.712,0c-0.598-0.061-1.071-0.537-1.081-1.15V40.821
|
38 |
+
c0.01-0.584,0.211-0.885,0.963-1.174c1.941-0.752,4.139-1.196,6.398-1.196c9.215,0,16.766,7.069,17.567,16.074
|
39 |
+
c1.186-0.495,2.496-0.777,3.865-0.777c5.518,0,9.992,4.476,9.992,9.998C96.732,69.267,92.258,73.695,86.74,73.695L86.74,73.695z"
|
40 |
+
/>
|
41 |
+
</g>
|
42 |
+
</g>
|
43 |
+
<g>
|
44 |
+
</g>
|
45 |
+
<g>
|
46 |
+
</g>
|
47 |
+
<g>
|
48 |
+
</g>
|
49 |
+
<g>
|
50 |
+
</g>
|
51 |
+
<g>
|
52 |
+
</g>
|
53 |
+
<g>
|
54 |
+
</g>
|
55 |
+
<g>
|
56 |
+
</g>
|
57 |
+
<g>
|
58 |
+
</g>
|
59 |
+
<g>
|
60 |
+
</g>
|
61 |
+
<g>
|
62 |
+
</g>
|
63 |
+
<g>
|
64 |
+
</g>
|
65 |
+
<g>
|
66 |
+
</g>
|
67 |
+
<g>
|
68 |
+
</g>
|
69 |
+
<g>
|
70 |
+
</g>
|
71 |
+
<g>
|
72 |
+
</g>
|
73 |
+
</svg>
|
EmbedPress/Ends/Back/Settings/templates/custom-logo.php
CHANGED
@@ -21,7 +21,6 @@ $embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powe
|
|
21 |
|
22 |
// Vimeo branding
|
23 |
$vm_settings = get_option( EMBEDPRESS_PLG_NAME.':vimeo');
|
24 |
-
//error_log( print_r( $vm_settings, 1));
|
25 |
$vm_branding = isset( $vm_settings['branding']) ? sanitize_text_field( $vm_settings['branding']) : 'no';
|
26 |
$vm_logo_xpos = isset( $vm_settings['logo_xpos']) ? intval( $vm_settings['logo_xpos']) : 10;
|
27 |
$vm_logo_ypos = isset( $vm_settings['logo_ypos']) ? intval( $vm_settings['logo_ypos']) : 10;
|
21 |
|
22 |
// Vimeo branding
|
23 |
$vm_settings = get_option( EMBEDPRESS_PLG_NAME.':vimeo');
|
|
|
24 |
$vm_branding = isset( $vm_settings['branding']) ? sanitize_text_field( $vm_settings['branding']) : 'no';
|
25 |
$vm_logo_xpos = isset( $vm_settings['logo_xpos']) ? intval( $vm_settings['logo_xpos']) : 10;
|
26 |
$vm_logo_ypos = isset( $vm_settings['logo_ypos']) ? intval( $vm_settings['logo_ypos']) : 10;
|
EmbedPress/Ends/Back/Settings/templates/dailymotion.php
ADDED
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Dailymotion Settings page
|
4 |
+
* All undefined vars comes from 'render_settings_page' method
|
5 |
+
* */
|
6 |
+
$dm_settings = get_option( EMBEDPRESS_PLG_NAME.':dailymotion');
|
7 |
+
$autoplay = isset( $dm_settings['autoplay']) ? $dm_settings['autoplay'] : '';
|
8 |
+
$play_on_mobile = isset( $dm_settings['play_on_mobile']) ? $dm_settings['play_on_mobile'] : '';
|
9 |
+
$mute = isset( $dm_settings['mute']) ? $dm_settings['mute'] : '';
|
10 |
+
$controls = isset( $dm_settings['controls']) ? $dm_settings['controls'] : 1;
|
11 |
+
$video_info = isset( $dm_settings['video_info']) ? $dm_settings['video_info'] : 1;
|
12 |
+
$color = isset( $dm_settings['color']) ? $dm_settings['color'] : '#dd3333';
|
13 |
+
// pro
|
14 |
+
$start_time = isset( $dm_settings['start_time']) ? $dm_settings['start_time'] : 0;
|
15 |
+
$show_logo = isset( $dm_settings['show_logo']) ? $dm_settings['show_logo'] : 1;
|
16 |
+
|
17 |
+
?>
|
18 |
+
|
19 |
+
<div class="embedpress__settings background__white radius-25 p40">
|
20 |
+
<h3><?php esc_html_e( "Dailymotion Settings", "embedpress" ); ?></h3>
|
21 |
+
<div class="embedpress__settings__form">
|
22 |
+
<form action="" method="post" class="embedpress-settings-form" >
|
23 |
+
<?php
|
24 |
+
do_action( 'embedpress_before_dailymotion_settings_fields');
|
25 |
+
echo $nonce_field ; ?>
|
26 |
+
<div class="form__group">
|
27 |
+
<p class="form__label" ><?php esc_html_e( "Start Time (In Seconds)", "embedpress" ); echo $pro_active ? '': ' <span class="isPro">PRO</span>';?> </p>
|
28 |
+
<div class="form__control__wrap <?php echo $pro_active ? '': 'isPro'; ?>">
|
29 |
+
<input type="number" name="start_time" id="start_time" class="form__control" data-default="<?php echo esc_attr( $start_time); ?>" value="<?php echo esc_attr( $start_time); ?>" <?php echo $pro_active ? '': ' disabled'; ?>>
|
30 |
+
<p><?php esc_html_e( "You can put a custom time in seconds to start video. Example: 500", "embedpress" ); ?></p>
|
31 |
+
</div>
|
32 |
+
<?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
|
33 |
+
|
34 |
+
</div>
|
35 |
+
|
36 |
+
<div class="form__group">
|
37 |
+
<p class="form__label"><?php esc_html_e( "Auto Play", "embedpress" ); ?></p>
|
38 |
+
<div class="form__control__wrap">
|
39 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $autoplay ); ?>" data-value="<?php echo esc_attr( $autoplay ); ?>">
|
40 |
+
<label class="input__radio">
|
41 |
+
<input type="radio" name="autoplay" value="" <?php checked( '', $autoplay); ?>>
|
42 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
43 |
+
</label>
|
44 |
+
<label class="input__radio">
|
45 |
+
<input type="radio" name="autoplay" value="1" <?php checked( '1', $autoplay); ?>>
|
46 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
47 |
+
</label>
|
48 |
+
</div>
|
49 |
+
<p><?php esc_html_e( "Automatically start to play the videos when the player loads.", "embedpress" ); ?></p>
|
50 |
+
</div>
|
51 |
+
</div>
|
52 |
+
|
53 |
+
<div class="form__group">
|
54 |
+
<p class="form__label"><?php esc_html_e( "Autoplay On Mobile", "embedpress" ); ?></p>
|
55 |
+
<div class="form__control__wrap">
|
56 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $play_on_mobile ); ?>" data-value="<?php echo esc_attr( $play_on_mobile ); ?>">
|
57 |
+
<label class="input__radio">
|
58 |
+
<input type="radio" name="play_on_mobile" value="" <?php checked( '', $play_on_mobile); ?>>
|
59 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
60 |
+
</label>
|
61 |
+
<label class="input__radio">
|
62 |
+
<input type="radio" name="play_on_mobile" value="1" <?php checked( '1', $play_on_mobile); ?>>
|
63 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
64 |
+
</label>
|
65 |
+
</div>
|
66 |
+
<p><?php esc_html_e( "You can control autoplay on mobile. Only works if Autoplay option is enabled.", "embedpress" ); ?></p>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
<div class="form__group">
|
71 |
+
<p class="form__label"><?php esc_html_e( "Mute", "embedpress" ); ?></p>
|
72 |
+
<div class="form__control__wrap">
|
73 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $mute ); ?>" data-value="<?php echo esc_attr( $mute ); ?>">
|
74 |
+
<label class="input__radio">
|
75 |
+
<input type="radio" name="mute" value="" <?php checked( '', $mute); ?>>
|
76 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
77 |
+
</label>
|
78 |
+
<label class="input__radio">
|
79 |
+
<input type="radio" name="mute" value="1" <?php checked( '1', $mute); ?>>
|
80 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
81 |
+
</label>
|
82 |
+
</div>
|
83 |
+
<p><?php esc_html_e( "Mute the video that is auto played", "embedpress" ); ?></p>
|
84 |
+
</div>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
<div class="form__group">
|
90 |
+
<p class="form__label"><?php esc_html_e( "Display Player Controls", "embedpress" ); ?></p>
|
91 |
+
<div class="form__control__wrap">
|
92 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $controls ); ?>" data-value="<?php echo esc_attr( $controls ); ?>">
|
93 |
+
<label class="input__radio">
|
94 |
+
<input type="radio" name="controls" value="" <?php checked( '', $controls); ?>>
|
95 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
96 |
+
</label>
|
97 |
+
<label class="input__radio">
|
98 |
+
<input type="radio" name="controls" value="1" <?php checked( '1', $controls); ?>>
|
99 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
100 |
+
</label>
|
101 |
+
</div>
|
102 |
+
<p><?php esc_html_e( 'Indicates whether the video player controls are displayed.', 'embedpress'); ?> </p>
|
103 |
+
</div>
|
104 |
+
</div>
|
105 |
+
|
106 |
+
|
107 |
+
<div class="form__group">
|
108 |
+
<p class="form__label"><?php esc_html_e( "Display Video Info", "embedpress" ); ?></p>
|
109 |
+
<div class="form__control__wrap">
|
110 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $video_info ); ?>" data-value="<?php echo esc_attr( $video_info ); ?>">
|
111 |
+
<label class="input__radio">
|
112 |
+
<input type="radio" name="video_info" value="" <?php checked( '', $video_info); ?>>
|
113 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
114 |
+
</label>
|
115 |
+
<label class="input__radio">
|
116 |
+
<input type="radio" name="video_info" value="1" <?php checked( '1', $video_info); ?>>
|
117 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
118 |
+
</label>
|
119 |
+
</div>
|
120 |
+
<p><?php esc_html_e( 'Indicates whether the video information is displayed.', 'embedpress'); ?> </p>
|
121 |
+
</div>
|
122 |
+
</div>
|
123 |
+
|
124 |
+
|
125 |
+
<div class="form__group">
|
126 |
+
<p class="form__label"><?php esc_html_e( "Show Logo", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p>
|
127 |
+
<div class="form__control__wrap">
|
128 |
+
<div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $show_logo ); ?>" data-value="<?php echo esc_attr( $show_logo ); ?>">
|
129 |
+
<label class="input__radio">
|
130 |
+
<input type="radio" name="show_logo" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $show_logo); ?>>
|
131 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
132 |
+
</label>
|
133 |
+
<label class="input__radio">
|
134 |
+
<input type="radio" name="show_logo" value="1" <?php echo !$pro_active ? 'disabled ' : ''; checked( '1', $show_logo);?>>
|
135 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
136 |
+
</label>
|
137 |
+
</div>
|
138 |
+
<?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
|
142 |
+
|
143 |
+
|
144 |
+
<div class="form__group">
|
145 |
+
<p class="form__label"><?php esc_html_e( "Controls Color", "embedpress" ); ?></p>
|
146 |
+
<div class="form__control__wrap">
|
147 |
+
<input type="text" class="form__control ep-color-picker" name="color" value="<?php echo esc_attr( $color); ?>" data-default="<?php echo esc_attr( $color ); ?>">
|
148 |
+
|
149 |
+
<p><?php esc_html_e( "Specify the color of the video controls.", "embedpress" ); ?></p>
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
|
153 |
+
|
154 |
+
<?php do_action( 'embedpress_after_dailymotion_settings_fields'); ?>
|
155 |
+
<button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="dailymotion"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
|
156 |
+
</form>
|
157 |
+
</div>
|
158 |
+
</div>
|
EmbedPress/Ends/Back/Settings/templates/partials/sidebar.php
CHANGED
@@ -60,6 +60,18 @@
|
|
60 |
<?php esc_html_e( "Twitch", "embedpress" ); ?>
|
61 |
</a>
|
62 |
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
<li class="dropdown__item">
|
64 |
<a href="<?php echo esc_url( $ep_page.'&page_type=spotify'); ?>" class="dropdown__link <?php echo 'spotify' === $template ? 'active' : ''; ?>">
|
65 |
<img class="embedpress-settings-icon" src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/spotify.svg" alt="">
|
60 |
<?php esc_html_e( "Twitch", "embedpress" ); ?>
|
61 |
</a>
|
62 |
</li>
|
63 |
+
<li class="dropdown__item">
|
64 |
+
<a href="<?php echo esc_url( $ep_page.'&page_type=dailymotion'); ?>" class="dropdown__link <?php echo 'dailymotion' === $template ? 'active' : ''; ?>">
|
65 |
+
<img class="embedpress-settings-icon" src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/dailymotion.svg" alt="">
|
66 |
+
<?php esc_html_e( "Dailymotion", "embedpress" ); ?>
|
67 |
+
</a>
|
68 |
+
</li>
|
69 |
+
<li class="dropdown__item">
|
70 |
+
<a href="<?php echo esc_url( $ep_page.'&page_type=soundcloud'); ?>" class="dropdown__link <?php echo 'soundcloud' === $template ? 'active' : ''; ?>">
|
71 |
+
<img class="embedpress-settings-icon" src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/soundcloud.svg" alt="">
|
72 |
+
<?php esc_html_e( "SoundCloud", "embedpress" ); ?>
|
73 |
+
</a>
|
74 |
+
</li>
|
75 |
<li class="dropdown__item">
|
76 |
<a href="<?php echo esc_url( $ep_page.'&page_type=spotify'); ?>" class="dropdown__link <?php echo 'spotify' === $template ? 'active' : ''; ?>">
|
77 |
<img class="embedpress-settings-icon" src="<?php echo EMBEDPRESS_SETTINGS_ASSETS_URL; ?>img/spotify.svg" alt="">
|
EmbedPress/Ends/Back/Settings/templates/soundcloud.php
ADDED
@@ -0,0 +1,192 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* SoundCloud Settings page
|
4 |
+
* All undefined vars comes from 'render_settings_page' method
|
5 |
+
* */
|
6 |
+
$sc_settings = get_option( EMBEDPRESS_PLG_NAME.':soundcloud');
|
7 |
+
$visual = isset( $sc_settings['visual']) ? $sc_settings['visual'] : '';
|
8 |
+
$autoplay = isset( $sc_settings['autoplay']) ? $sc_settings['autoplay'] : '';
|
9 |
+
$share_button = isset( $sc_settings['share_button']) ? $sc_settings['share_button'] : '';
|
10 |
+
$comments = isset( $sc_settings['comments']) ? $sc_settings['comments'] : 1;
|
11 |
+
$color = isset( $sc_settings['color']) ? $sc_settings['color'] : '#dd3333';
|
12 |
+
$artwork = isset( $sc_settings['artwork']) ? $sc_settings['artwork'] : '';
|
13 |
+
$play_count = isset( $sc_settings['play_count']) ? $sc_settings['play_count'] : 1;
|
14 |
+
$username = isset( $sc_settings['username']) ? $sc_settings['username'] : 1;
|
15 |
+
// pro
|
16 |
+
$download_button = isset( $sc_settings['download_button']) ? $sc_settings['download_button'] : 1;
|
17 |
+
$buy_button = isset( $sc_settings['buy_button']) ? $sc_settings['buy_button'] : 1;
|
18 |
+
|
19 |
+
?>
|
20 |
+
|
21 |
+
<div class="embedpress__settings background__white radius-25 p40">
|
22 |
+
<h3><?php esc_html_e( "SoundCloud Settings", "embedpress" ); ?></h3>
|
23 |
+
<div class="embedpress__settings__form">
|
24 |
+
<form action="" method="post" class="embedpress-settings-form" >
|
25 |
+
<?php
|
26 |
+
do_action( 'embedpress_before_dailymotion_settings_fields');
|
27 |
+
echo $nonce_field ; ?>
|
28 |
+
<div class="form__group">
|
29 |
+
<p class="form__label"><?php esc_html_e( "Visual Player", "embedpress" ); ?></p>
|
30 |
+
<div class="form__control__wrap">
|
31 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $visual ); ?>" data-value="<?php echo esc_attr( $visual ); ?>">
|
32 |
+
<label class="input__radio">
|
33 |
+
<input type="radio" name="visual" value="" <?php checked( '', $visual); ?>>
|
34 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
35 |
+
</label>
|
36 |
+
<label class="input__radio">
|
37 |
+
<input type="radio" name="visual" value="1" <?php checked( '1', $visual); ?>>
|
38 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
39 |
+
</label>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
<div class="form__group">
|
44 |
+
<p class="form__label"><?php esc_html_e( "Scheme", "embedpress" ); ?></p>
|
45 |
+
<div class="form__control__wrap">
|
46 |
+
<input type="text" class="form__control ep-color-picker" name="color" value="<?php echo esc_attr( $color); ?>" data-default="<?php echo esc_attr( $color ); ?>">
|
47 |
+
</div>
|
48 |
+
</div>
|
49 |
+
|
50 |
+
<div class="form__group">
|
51 |
+
<p class="form__label"><?php esc_html_e( "Auto Play", "embedpress" ); ?></p>
|
52 |
+
<div class="form__control__wrap">
|
53 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $autoplay ); ?>" data-value="<?php echo esc_attr( $autoplay ); ?>">
|
54 |
+
<label class="input__radio">
|
55 |
+
<input type="radio" name="autoplay" value="" <?php checked( '', $autoplay); ?>>
|
56 |
+
<span><?php esc_html_e( "No", "embedpress" ); ?></span>
|
57 |
+
</label>
|
58 |
+
<label class="input__radio">
|
59 |
+
<input type="radio" name="autoplay" value="1" <?php checked( '1', $autoplay); ?>>
|
60 |
+
<span><?php esc_html_e( "Yes", "embedpress" ); ?></span>
|
61 |
+
</label>
|
62 |
+
</div>
|
63 |
+
<p><?php esc_html_e( "Automatically start to play the videos when the player loads.", "embedpress" ); ?></p>
|
64 |
+
</div>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
|
68 |
+
<div class="form__group">
|
69 |
+
<p class="form__label"><?php esc_html_e( "Buy Button", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p>
|
70 |
+
<div class="form__control__wrap">
|
71 |
+
<div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $buy_button ); ?>" data-value="<?php echo esc_attr( $buy_button ); ?>">
|
72 |
+
<label class="input__radio">
|
73 |
+
<input type="radio" name="buy_button" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $buy_button); ?>>
|
74 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
75 |
+
</label>
|
76 |
+
<label class="input__radio">
|
77 |
+
<input type="radio" name="buy_button" value="1" <?php echo !$pro_active ? 'disabled ' : ''; checked( '1', $buy_button);?>>
|
78 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
79 |
+
</label>
|
80 |
+
</div>
|
81 |
+
<?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
|
82 |
+
</div>
|
83 |
+
</div>
|
84 |
+
|
85 |
+
|
86 |
+
<div class="form__group">
|
87 |
+
<p class="form__label"><?php esc_html_e( "Download Button", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p>
|
88 |
+
<div class="form__control__wrap">
|
89 |
+
<div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $download_button ); ?>" data-value="<?php echo esc_attr( $download_button ); ?>">
|
90 |
+
<label class="input__radio">
|
91 |
+
<input type="radio" name="download_button" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $download_button); ?>>
|
92 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
93 |
+
</label>
|
94 |
+
<label class="input__radio">
|
95 |
+
<input type="radio" name="download_button" value="1" <?php echo !$pro_active ? 'disabled ' : ''; checked( '1', $download_button);?>>
|
96 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
97 |
+
</label>
|
98 |
+
</div>
|
99 |
+
<?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
|
100 |
+
</div>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div class="form__group">
|
104 |
+
<p class="form__label"><?php esc_html_e( "Share Button", "embedpress" ); ?></p>
|
105 |
+
<div class="form__control__wrap">
|
106 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $share_button ); ?>" data-value="<?php echo esc_attr( $share_button ); ?>">
|
107 |
+
<label class="input__radio">
|
108 |
+
<input type="radio" name="share_button" value="" <?php checked( '', $share_button); ?>>
|
109 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
110 |
+
</label>
|
111 |
+
<label class="input__radio">
|
112 |
+
<input type="radio" name="share_button" value="1" <?php checked( '1', $share_button); ?>>
|
113 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
114 |
+
</label>
|
115 |
+
</div>
|
116 |
+
</div>
|
117 |
+
</div>
|
118 |
+
<div class="form__group">
|
119 |
+
<p class="form__label"><?php esc_html_e( "Comments", "embedpress" ); ?></p>
|
120 |
+
<div class="form__control__wrap">
|
121 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $comments ); ?>" data-value="<?php echo esc_attr( $comments ); ?>">
|
122 |
+
<label class="input__radio">
|
123 |
+
<input type="radio" name="comments" value="" <?php checked( '', $comments); ?>>
|
124 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
125 |
+
</label>
|
126 |
+
<label class="input__radio">
|
127 |
+
<input type="radio" name="comments" value="1" <?php checked( '1', $comments); ?>>
|
128 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
129 |
+
</label>
|
130 |
+
</div>
|
131 |
+
</div>
|
132 |
+
</div>
|
133 |
+
|
134 |
+
<div class="form__group">
|
135 |
+
<p class="form__label"><?php esc_html_e( "Artwork", "embedpress" ); ?></p>
|
136 |
+
<div class="form__control__wrap">
|
137 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $artwork ); ?>" data-value="<?php echo esc_attr( $artwork ); ?>">
|
138 |
+
<label class="input__radio">
|
139 |
+
<input type="radio" name="artwork" value="" <?php checked( '', $artwork); ?>>
|
140 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
141 |
+
</label>
|
142 |
+
<label class="input__radio">
|
143 |
+
<input type="radio" name="artwork" value="1" <?php checked( '1', $artwork); ?>>
|
144 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
145 |
+
</label>
|
146 |
+
</div>
|
147 |
+
<p><?php esc_html_e( 'Artwork option works when Visual option is disabled', 'embedpress'); ?> </p>
|
148 |
+
|
149 |
+
</div>
|
150 |
+
</div>
|
151 |
+
|
152 |
+
|
153 |
+
<div class="form__group">
|
154 |
+
<p class="form__label"><?php esc_html_e( "Play Count", "embedpress" ); ?></p>
|
155 |
+
<div class="form__control__wrap">
|
156 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $play_count ); ?>" data-value="<?php echo esc_attr( $play_count ); ?>">
|
157 |
+
<label class="input__radio">
|
158 |
+
<input type="radio" name="play_count" value="" <?php checked( '', $play_count); ?>>
|
159 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
160 |
+
</label>
|
161 |
+
<label class="input__radio">
|
162 |
+
<input type="radio" name="play_count" value="1" <?php checked( '1', $play_count); ?>>
|
163 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
164 |
+
</label>
|
165 |
+
</div>
|
166 |
+
<p><?php esc_html_e( 'Play count option works when Visual option is disabled', 'embedpress'); ?> </p>
|
167 |
+
|
168 |
+
</div>
|
169 |
+
</div>
|
170 |
+
|
171 |
+
|
172 |
+
<div class="form__group">
|
173 |
+
<p class="form__label"><?php esc_html_e( "Username", "embedpress" ); ?></p>
|
174 |
+
<div class="form__control__wrap">
|
175 |
+
<div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $username ); ?>" data-value="<?php echo esc_attr( $username ); ?>">
|
176 |
+
<label class="input__radio">
|
177 |
+
<input type="radio" name="username" value="" <?php checked( '', $username); ?>>
|
178 |
+
<span><?php esc_html_e( "Hide", "embedpress" ); ?></span>
|
179 |
+
</label>
|
180 |
+
<label class="input__radio">
|
181 |
+
<input type="radio" name="username" value="1" <?php checked( '1', $username); ?>>
|
182 |
+
<span><?php esc_html_e( "Show", "embedpress" ); ?></span>
|
183 |
+
</label>
|
184 |
+
</div>
|
185 |
+
</div>
|
186 |
+
</div>
|
187 |
+
|
188 |
+
<?php do_action( 'embedpress_after_dailymotion_settings_fields'); ?>
|
189 |
+
<button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="soundcloud"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
|
190 |
+
</form>
|
191 |
+
</div>
|
192 |
+
</div>
|
EmbedPress/Includes/Classes/Elementor_Enhancer.php
ADDED
@@ -0,0 +1,528 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
namespace EmbedPress\Includes\Classes;
|
3 |
+
|
4 |
+
use Elementor\Group_Control_Image_Size;
|
5 |
+
use Elementor\Utils;
|
6 |
+
|
7 |
+
class Elementor_Enhancer {
|
8 |
+
public static function get_link_attributes($url_control) {
|
9 |
+
$attributes = [];
|
10 |
+
|
11 |
+
if ( ! empty( $url_control['url'] ) ) {
|
12 |
+
$allowed_protocols = array_merge( wp_allowed_protocols(), [ 'skype', 'viber' ] );
|
13 |
+
|
14 |
+
$attributes['href'] = esc_url( $url_control['url'], $allowed_protocols );
|
15 |
+
}
|
16 |
+
|
17 |
+
if ( ! empty( $url_control['is_external'] ) ) {
|
18 |
+
$attributes['target'] = '_blank';
|
19 |
+
}
|
20 |
+
|
21 |
+
if ( ! empty( $url_control['nofollow'] ) ) {
|
22 |
+
$attributes['rel'] = 'nofollow';
|
23 |
+
}
|
24 |
+
|
25 |
+
if ( ! empty( $url_control['custom_attributes'] ) ) {
|
26 |
+
// Custom URL attributes should come as a string of comma-delimited key|value pairs
|
27 |
+
$attributes = array_merge( $attributes, Utils::parse_custom_attributes( $url_control['custom_attributes'] ) );
|
28 |
+
}
|
29 |
+
return $attributes;
|
30 |
+
}
|
31 |
+
public static function apply_cta_markup( $embed, $settings, $provider_name='' ) {
|
32 |
+
if ( empty( $settings["embedpress_pro_{$provider_name}_logo"]) || empty( $settings["embedpress_pro_{$provider_name}_logo"]['url']) ) {
|
33 |
+
return $embed;
|
34 |
+
}
|
35 |
+
$img = Group_Control_Image_Size::get_attachment_image_html( $settings, "embedpress_pro_{$provider_name}_logo" );
|
36 |
+
if ( empty( $img) ) {
|
37 |
+
return $embed;
|
38 |
+
}
|
39 |
+
|
40 |
+
$cta = '';
|
41 |
+
$url = '';
|
42 |
+
$target = '';
|
43 |
+
$x = !empty( $settings["embedpress_pro_{$provider_name}_logo_xpos"]) && !empty( $settings["embedpress_pro_{$provider_name}_logo_xpos"]['unit']) ? $settings["embedpress_pro_{$provider_name}_logo_xpos"]['unit'].$settings["embedpress_pro_{$provider_name}_logo_xpos"]['size']: '10%';
|
44 |
+
|
45 |
+
$y = !empty( $settings["embedpress_pro_{$provider_name}_logo_ypos"]) && !empty( $settings["embedpress_pro_{$provider_name}_logo_ypos"]['unit']) ? $settings["embedpress_pro_{$provider_name}_logo_ypos"]['unit'].$settings["embedpress_pro_{$provider_name}_logo_ypos"]['size']: '10%';
|
46 |
+
$cssClass = isset( $embed->url ) ? '.ose-uid-'. md5($embed->url) : ".ose-{$provider_name}";
|
47 |
+
ob_start();
|
48 |
+
?>
|
49 |
+
<style type="text/css">
|
50 |
+
<?php echo esc_html($cssClass); ?>{
|
51 |
+
text-align: left;
|
52 |
+
position: relative;
|
53 |
+
}
|
54 |
+
<?php echo esc_html($cssClass); ?> .watermark {
|
55 |
+
border: 0;
|
56 |
+
position: absolute;
|
57 |
+
bottom: <?php echo esc_html($y); ?>;
|
58 |
+
right: <?php echo esc_html($x); ?>;
|
59 |
+
max-width: 150px;
|
60 |
+
max-height: 75px;
|
61 |
+
opacity: 0.25;
|
62 |
+
z-index: 5;
|
63 |
+
-o-transition: opacity 0.5s ease-in-out;
|
64 |
+
-moz-transition: opacity 0.5s ease-in-out;
|
65 |
+
-webkit-transition: opacity 0.5s ease-in-out;
|
66 |
+
transition: opacity 0.5s ease-in-out;
|
67 |
+
}
|
68 |
+
<?php echo esc_html($cssClass); ?> .watermark:hover {
|
69 |
+
opacity: 1;
|
70 |
+
}
|
71 |
+
</style>
|
72 |
+
<?php
|
73 |
+
$style = ob_get_clean();
|
74 |
+
|
75 |
+
if ( !class_exists( '\simple_html_dom') ) {
|
76 |
+
include_once EMBEDPRESS_PATH_CORE . 'simple_html_dom.php';
|
77 |
+
}
|
78 |
+
|
79 |
+
if ( !empty( $settings["embedpress_pro_{$provider_name}_cta"]) && !empty( $settings["embedpress_pro_{$provider_name}_cta"]['url']) ) {
|
80 |
+
$url = $settings["embedpress_pro_{$provider_name}_cta"]['url'];
|
81 |
+
}
|
82 |
+
|
83 |
+
if ($url){
|
84 |
+
$atts = self::get_link_attributes( $settings["embedpress_pro_{$provider_name}_cta"]);
|
85 |
+
$attributes = '';
|
86 |
+
foreach ( $atts as $att => $value ) {
|
87 |
+
$attributes .=$att.'="'.esc_attr($value).'" ';
|
88 |
+
}
|
89 |
+
$cta .= sprintf( '<a %s>', trim( $attributes));
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
$imgDom = str_get_html( $img);
|
94 |
+
$imgDom = $imgDom->find( 'img', 0);
|
95 |
+
$imgDom->setAttribute( 'class', 'watermark');
|
96 |
+
$imgDom->removeAttribute( 'style');
|
97 |
+
$imgDom->setAttribute( 'width', 'auto');
|
98 |
+
$imgDom->setAttribute( 'height', 'auto');
|
99 |
+
ob_start();
|
100 |
+
echo $imgDom;
|
101 |
+
$cta .= ob_get_clean();
|
102 |
+
$imgDom->clear();
|
103 |
+
unset( $img, $imgDom);
|
104 |
+
|
105 |
+
if ($url){
|
106 |
+
$cta .= '</a>';
|
107 |
+
}
|
108 |
+
$dom = str_get_html($embed->embed);
|
109 |
+
$wrapDiv = $dom->find( "div.ose-{$provider_name}", 0);
|
110 |
+
if (!empty( $wrapDiv) && is_object( $wrapDiv)){
|
111 |
+
$wrapDiv->innertext .= $cta ;
|
112 |
+
}
|
113 |
+
|
114 |
+
ob_start();
|
115 |
+
echo $wrapDiv;
|
116 |
+
$markup = ob_get_clean();
|
117 |
+
$dom->clear();
|
118 |
+
unset($dom, $wrapDiv);
|
119 |
+
|
120 |
+
$embed->embed = $style . $markup;
|
121 |
+
return $embed;
|
122 |
+
}
|
123 |
+
public static function youtube( $embed, $setting ) {
|
124 |
+
if ( isset( $setting['embedpress_pro_embeded_source']) && 'youtube' === $setting['embedpress_pro_embeded_source'] && isset( $embed->embed ) ) {
|
125 |
+
|
126 |
+
preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
|
127 |
+
$url_full = $match[ 1 ];
|
128 |
+
$query = parse_url( $url_full, PHP_URL_QUERY );
|
129 |
+
parse_str( $query, $params );
|
130 |
+
$params[ 'controls' ] = $setting[ 'embedpress_pro_youtube_display_controls' ];
|
131 |
+
$params[ 'iv_load_policy' ] = $setting[ 'embedpress_pro_youtube_display_video_annotations' ];
|
132 |
+
$params[ 'fs' ] = ( $setting[ 'embedpress_pro_youtube_enable_fullscreen_button' ] === 'yes' ) ? 1 : 0;
|
133 |
+
$params[ 'end' ] = $setting[ 'embedpress_pro_youtube_end_time' ];
|
134 |
+
if ( $setting[ 'embedpress_pro_youtube_auto_play' ] === 'yes' ) {
|
135 |
+
$params[ 'autoplay' ] = 1;
|
136 |
+
}
|
137 |
+
|
138 |
+
if ( is_embedpress_pro_active() ) {
|
139 |
+
$params[ 'color' ] = $setting[ 'embedpress_pro_youtube_progress_bar_color' ];
|
140 |
+
$params[ 'modestbranding' ] = $setting[ 'embedpress_pro_youtube_modest_branding' ];
|
141 |
+
$params[ 'start' ] = $setting[ 'embedpress_pro_video_start_time' ];
|
142 |
+
|
143 |
+
|
144 |
+
|
145 |
+
|
146 |
+
if ( $setting[ 'embedpress_pro_youtube_force_closed_captions' ] === 'yes' ) {
|
147 |
+
$params[ 'cc_load_policy' ] = 1;
|
148 |
+
}
|
149 |
+
|
150 |
+
if ( $setting[ 'embedpress_pro_youtube_display_related_videos' ] === 'yes' ) {
|
151 |
+
$params[ 'rel' ] = 1;
|
152 |
+
}
|
153 |
+
}
|
154 |
+
|
155 |
+
|
156 |
+
preg_match( '/(.+)?\?/', $url_full, $url );
|
157 |
+
$url = $url[ 1 ];
|
158 |
+
|
159 |
+
// Reassemble the url with the new variables.
|
160 |
+
$url_modified = $url . '?';
|
161 |
+
foreach ( $params as $paramName => $paramValue ) {
|
162 |
+
$url_modified .= $paramName . '=' . $paramValue . '&';
|
163 |
+
}
|
164 |
+
// Replaces the old url with the new one.
|
165 |
+
$embed->embed = str_replace( $url_full, rtrim( $url_modified, '&' ), $embed->embed );
|
166 |
+
if ( is_embedpress_pro_active() ) {
|
167 |
+
$embed = self::apply_cta_markup( $embed, $setting, 'youtube');
|
168 |
+
}
|
169 |
+
|
170 |
+
}
|
171 |
+
|
172 |
+
|
173 |
+
return $embed;
|
174 |
+
}
|
175 |
+
public static function vimeo( $embed, $setting )
|
176 |
+
{
|
177 |
+
|
178 |
+
if ( !isset( $embed->provider_name ) || strtoupper( $embed->provider_name ) !== 'VIMEO' || !isset( $embed->embed ) || $setting[ 'embedpress_pro_embeded_source' ] !== 'vimeo' ) {
|
179 |
+
return $embed;
|
180 |
+
}
|
181 |
+
preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
|
182 |
+
$url_full = $match[ 1 ];
|
183 |
+
//@todo; ask if we need to show author and avatar by default if pro is disabled
|
184 |
+
$params = [
|
185 |
+
'color' => str_replace( '#', '', $setting[ 'embedpress_pro_vimeo_color' ] ),
|
186 |
+
'title' => $setting[ 'embedpress_pro_vimeo_display_title' ] === 'yes' ? 1 : 0,
|
187 |
+
//'byline' => $setting[ 'embedpress_pro_vimeo_display_author' ] === 'yes' ? 1 : 0,
|
188 |
+
//'portrait' => $setting[ 'embedpress_pro_vimeo_avatar' ] === 'yes' ? 1 : 0,
|
189 |
+
//'dnt' => $setting[ 'embedpress_pro_vimeo_dnt' ] === 'yes' ? 1 : 0,
|
190 |
+
];
|
191 |
+
if ( $setting[ 'embedpress_pro_vimeo_auto_play' ] === 'yes' ) {
|
192 |
+
$params[ 'autoplay' ] = 1;
|
193 |
+
}
|
194 |
+
|
195 |
+
if ( is_embedpress_pro_active() ) {
|
196 |
+
if ( $setting[ 'embedpress_pro_vimeo_loop' ] === 'yes' ) {
|
197 |
+
$params[ 'loop' ] = 1;
|
198 |
+
}
|
199 |
+
if ( $setting[ 'embedpress_pro_vimeo_autopause' ] === 'yes' ) {
|
200 |
+
$params[ 'autopause' ] = 1;
|
201 |
+
}
|
202 |
+
$params ['byline'] = $setting[ 'embedpress_pro_vimeo_display_author' ] === 'yes' ? 1 : 0;
|
203 |
+
$params ['portrait'] = $setting[ 'embedpress_pro_vimeo_avatar' ] === 'yes' ? 1 : 0;
|
204 |
+
$params [ 'dnt'] = $setting[ 'embedpress_pro_vimeo_dnt' ] === 'yes' ? 1 : 0;
|
205 |
+
|
206 |
+
}
|
207 |
+
|
208 |
+
|
209 |
+
|
210 |
+
|
211 |
+
|
212 |
+
|
213 |
+
$url_modified = $url_full;
|
214 |
+
foreach ( $params as $param => $value ) {
|
215 |
+
$url_modified = add_query_arg( $param, $value, $url_modified );
|
216 |
+
}
|
217 |
+
|
218 |
+
if ( is_embedpress_pro_active() ) {
|
219 |
+
$url_modified .= '#t=' . $setting[ 'embedpress_pro_video_start_time' ];
|
220 |
+
}
|
221 |
+
// Replaces the old url with the new one.
|
222 |
+
$embed->embed = str_replace( $url_full, $url_modified, $embed->embed );
|
223 |
+
if ( is_embedpress_pro_active() ) {
|
224 |
+
return self::apply_cta_markup( $embed, $setting, 'vimeo');
|
225 |
+
}
|
226 |
+
return $embed;
|
227 |
+
}
|
228 |
+
public static function wistia( $embed, $setting )
|
229 |
+
{
|
230 |
+
if ( !isset( $embed->provider_name ) || strtoupper( $embed->provider_name ) !== 'WISTIA, INC.' || !isset( $embed->embed ) || $setting[ 'embedpress_pro_embeded_source' ] !== 'wistia' ) {
|
231 |
+
return $embed;
|
232 |
+
}
|
233 |
+
preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
|
234 |
+
|
235 |
+
$url_full = $match[ 1 ];
|
236 |
+
|
237 |
+
// Parse the url to retrieve all its info like variables etc.
|
238 |
+
$query = parse_url( $embed->url, PHP_URL_QUERY );
|
239 |
+
$url = str_replace( '?' . $query, '', $url_full );
|
240 |
+
|
241 |
+
parse_str( $query, $params );
|
242 |
+
|
243 |
+
// Set the class in the attributes
|
244 |
+
$embed->attributes->class = str_replace( '{provider_alias}', 'wistia', $embed->attributes->class );
|
245 |
+
$embed->embed = str_replace( 'ose-wistia, inc.', 'ose-wistia', $embed->embed );
|
246 |
+
|
247 |
+
// Embed Options
|
248 |
+
$embedOptions = new \stdClass;
|
249 |
+
$embedOptions->videoFoam = true;
|
250 |
+
$embedOptions->fullscreenButton = ( $setting[ 'embedpress_pro_wistia_fullscreen_button' ] === 'yes' );
|
251 |
+
$embedOptions->smallPlayButton = ( $setting[ 'embedpress_pro_wistia_small_play_button' ] === 'yes' );
|
252 |
+
$embedOptions->autoPlay = ( $setting[ 'embedpress_pro_wistia_auto_play' ] === 'yes' );
|
253 |
+
$embedOptions->playerColor = $setting[ 'embedpress_pro_wistia_color' ];
|
254 |
+
if ( is_embedpress_pro_active() ) {
|
255 |
+
$embedOptions->time = $setting[ 'embedpress_pro_video_start_time' ];
|
256 |
+
$embedOptions->playbar = ( $setting[ 'embedpress_pro_wistia_playbar' ] === 'yes' );
|
257 |
+
$embedOptions->volumeControl = ( $setting[ 'embedpress_pro_wistia_volume_control' ] === 'yes' );
|
258 |
+
|
259 |
+
$volume = (float)$setting[ 'embedpress_pro_wistia_volume' ];
|
260 |
+
if ( $volume > 1 ) {
|
261 |
+
$volume = $volume / 100;
|
262 |
+
}
|
263 |
+
$embedOptions->volume = $volume;
|
264 |
+
}
|
265 |
+
|
266 |
+
|
267 |
+
// Plugins
|
268 |
+
$pluginsBaseURL = plugins_url( '../assets/js/wistia/min', dirname( __DIR__ ) . '/embedpress-Wistia.php' );
|
269 |
+
|
270 |
+
$pluginList = [];
|
271 |
+
|
272 |
+
// Resumable
|
273 |
+
|
274 |
+
if ( $setting[ 'embedpress_pro_wistia_resumable' ] === 'yes' ) {
|
275 |
+
// Add the resumable plugin
|
276 |
+
$pluginList[ 'resumable' ] = [
|
277 |
+
'src' => $pluginsBaseURL . '/resumable.min.js',
|
278 |
+
'async' => false
|
279 |
+
];
|
280 |
+
}
|
281 |
+
|
282 |
+
|
283 |
+
// Add a fix for the autoplay and resumable work better together
|
284 |
+
if ( isset( $options->autoPlay ) ) {
|
285 |
+
if ( $setting[ 'embedpress_pro_wistia_resumable' ] === 'yes' ) {
|
286 |
+
$pluginList[ 'fixautoplayresumable' ] = [
|
287 |
+
'src' => $pluginsBaseURL . '/fixautoplayresumable.min.js'
|
288 |
+
];
|
289 |
+
}
|
290 |
+
}
|
291 |
+
|
292 |
+
// Closed Captions plugin
|
293 |
+
if ( is_embedpress_pro_active() ) {
|
294 |
+
if ( $setting[ 'embedpress_pro_wistia_captions' ] === 'yes' ) {
|
295 |
+
$isCaptionsEnabled = ( $setting[ 'embedpress_pro_wistia_captions' ] === 'yes' );
|
296 |
+
$isCaptionsEnabledByDefault = ( $setting[ 'embedpress_pro_wistia_captions_enabled_by_default' ] === 'yes' );
|
297 |
+
if ( $isCaptionsEnabled ) {
|
298 |
+
$pluginList[ 'captions-v1' ] = [
|
299 |
+
'onByDefault' => $isCaptionsEnabledByDefault
|
300 |
+
];
|
301 |
+
}
|
302 |
+
$embedOptions->captions = $isCaptionsEnabled;
|
303 |
+
$embedOptions->captionsDefault = $isCaptionsEnabledByDefault;
|
304 |
+
}
|
305 |
+
|
306 |
+
// Rewind plugin
|
307 |
+
if ( $setting[ 'embedpress_pro_wistia_rewind' ] === 'yes' ) {
|
308 |
+
|
309 |
+
$embedOptions->rewindTime = (int)$setting[ 'embedpress_pro_wistia_rewind_time' ];
|
310 |
+
$pluginList[ 'rewind' ] = [
|
311 |
+
'src' => $pluginsBaseURL . '/rewind.min.js'
|
312 |
+
];
|
313 |
+
|
314 |
+
}
|
315 |
+
}
|
316 |
+
|
317 |
+
|
318 |
+
// Focus plugin
|
319 |
+
if ( $setting[ 'embedpress_pro_wistia_focus' ] === 'yes' ) {
|
320 |
+
$isFocusEnabled = ( $setting[ 'embedpress_pro_wistia_focus' ] === 'yes' );
|
321 |
+
$pluginList[ 'dimthelights' ] = [
|
322 |
+
'src' => $pluginsBaseURL . '/dimthelights.min.js',
|
323 |
+
'autoDim' => $isFocusEnabled
|
324 |
+
];
|
325 |
+
|
326 |
+
$embedOptions->focus = $isFocusEnabled;
|
327 |
+
}
|
328 |
+
|
329 |
+
|
330 |
+
|
331 |
+
$embedOptions->plugin = $pluginList;
|
332 |
+
$embedOptions = json_encode( $embedOptions );
|
333 |
+
|
334 |
+
// Get the video ID
|
335 |
+
$videoId = self::get_wistia_video_from_url( $embed->url );
|
336 |
+
$shortVideoId = substr( $videoId, 0, 3 );
|
337 |
+
|
338 |
+
// Responsive?
|
339 |
+
|
340 |
+
$class = [
|
341 |
+
'wistia_embed',
|
342 |
+
'wistia_async_' . $videoId
|
343 |
+
];
|
344 |
+
|
345 |
+
$attribs = [
|
346 |
+
sprintf( 'id="wistia_%s"', $videoId ),
|
347 |
+
sprintf( 'class="%s"', join( ' ', $class ) ),
|
348 |
+
sprintf( 'style="width:%spx; height:%spx;"', $embed->width, $embed->height )
|
349 |
+
];
|
350 |
+
|
351 |
+
$labels = [
|
352 |
+
'watch_from_beginning' => __( 'Watch from the beginning', 'embedpress-pro' ),
|
353 |
+
'skip_to_where_you_left_off' => __( 'Skip to where you left off', 'embedpress-pro' ),
|
354 |
+
'you_have_watched_it_before' => __( 'It looks like you\'ve watched<br />part of this video before!',
|
355 |
+
'embedpress-pro' ),
|
356 |
+
];
|
357 |
+
$labels = json_encode( $labels );
|
358 |
+
|
359 |
+
preg_match( '/ose-uid-([a-z0-9]*)/', $embed->embed, $matches );
|
360 |
+
$uid = $matches[ 1 ];
|
361 |
+
|
362 |
+
$html = "<div class=\"embedpress-wrapper ose-wistia ose-uid-{$uid} responsive\">";
|
363 |
+
$html .= '<script src="https://fast.wistia.com/assets/external/E-v1.js" async></script>';
|
364 |
+
$html .= "<script>window.pp_embed_wistia_labels = {$labels};</script>\n";
|
365 |
+
$html .= "<script>window._wq = window._wq || []; _wq.push({\"{$shortVideoId}\": {$embedOptions}});</script>\n";
|
366 |
+
$html .= '<div ' . join( ' ', $attribs ) . "></div>\n";
|
367 |
+
$html .= '</div>';
|
368 |
+
$embed->embed = $html;
|
369 |
+
if ( is_embedpress_pro_active() ) {
|
370 |
+
return self::apply_cta_markup( $embed, $setting, 'wistia');
|
371 |
+
}
|
372 |
+
return $embed;
|
373 |
+
}
|
374 |
+
public static function soundcloud( $embed, $setting )
|
375 |
+
{
|
376 |
+
|
377 |
+
if ( !isset( $embed->provider_name ) || strtoupper( $embed->provider_name ) !== 'SOUNDCLOUD' || !isset( $embed->embed ) || $setting[ 'embedpress_pro_embeded_source' ] !== 'soundcloud' ) {
|
378 |
+
return $embed;
|
379 |
+
}
|
380 |
+
preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
|
381 |
+
$url_full = $match[ 1 ];
|
382 |
+
$params = [
|
383 |
+
'color' => str_replace( '#', '', $setting[ 'embedpress_pro_soundcloud_color' ] ),
|
384 |
+
'visual' => $setting[ 'embedpress_pro_soundcloud_visual' ] === 'yes' ? 'true' : 'false',
|
385 |
+
'auto_play' => $setting[ 'embedpress_pro_soundcloud_autoplay' ] === 'yes' ? 'true' : 'false',
|
386 |
+
'sharing' => $setting[ 'embedpress_pro_soundcloud_share_button' ] === 'yes' ? 'true' : 'false',
|
387 |
+
'show_comments' => $setting[ 'embedpress_pro_soundcloud_comments' ] === 'yes' ? 'true' : 'false',
|
388 |
+
'show_artwork' => $setting[ 'embedpress_pro_soundcloud_artwork' ] === 'yes' ? 'true' : 'false',
|
389 |
+
'show_playcount' => $setting[ 'embedpress_pro_soundcloud_play_count' ] === 'yes' ? 'true' : 'false',
|
390 |
+
'show_user' => $setting[ 'embedpress_pro_soundcloud_user_name' ] === 'yes' ? 'true' : 'false',
|
391 |
+
'buying' => 'false',
|
392 |
+
'download' => 'false',
|
393 |
+
];
|
394 |
+
if ( is_embedpress_pro_active() ) {
|
395 |
+
$params['buying'] = $setting[ 'embedpress_pro_soundcloud_buy_button' ] === 'yes' ? 'true' : 'false';
|
396 |
+
$params['download'] = $setting[ 'embedpress_pro_soundcloud_download_button' ] === 'yes' ? 'true' : 'false';
|
397 |
+
}
|
398 |
+
|
399 |
+
$url_modified = $url_full;
|
400 |
+
foreach ( $params as $param => $value ) {
|
401 |
+
$url_modified = add_query_arg( $param, $value, $url_modified );
|
402 |
+
}
|
403 |
+
|
404 |
+
// Replaces the old url with the new one.
|
405 |
+
$embed->embed = str_replace( $url_full, $url_modified, $embed->embed );
|
406 |
+
if ( 'false' === $params[ 'visual' ] ) {
|
407 |
+
$embed->embed = str_replace( 'height="400"', 'height="200 !important"', $embed->embed );
|
408 |
+
}
|
409 |
+
return $embed;
|
410 |
+
}
|
411 |
+
public static function dailymotion( $embed, $setting )
|
412 |
+
{
|
413 |
+
if ( !isset( $embed->provider_name ) || strtoupper( $embed->provider_name ) !== 'DAILYMOTION' || !isset( $embed->embed ) || $setting[ 'embedpress_pro_embeded_source' ] !== 'dailymotion' ) {
|
414 |
+
return $embed;
|
415 |
+
}
|
416 |
+
preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
|
417 |
+
$url_full = $match[ 1 ];
|
418 |
+
$params = [
|
419 |
+
'ui-highlight' => str_replace( '#', '', $setting[ 'embedpress_pro_dailymotion_control_color' ] ),
|
420 |
+
'mute' => $setting[ 'embedpress_pro_dailymotion_mute' ] === 'yes' ? 1 : 0,
|
421 |
+
'autoplay' => $setting[ 'embedpress_pro_dailymotion_autoplay' ] === 'yes' ? 1 : 0,
|
422 |
+
'controls' => $setting[ 'embedpress_pro_dailymotion_player_control' ] === 'yes' ? 1 : 0,
|
423 |
+
'ui-start-screen-info' => $setting[ 'embedpress_pro_dailymotion_video_info' ] === 'yes' ? 1 : 0,
|
424 |
+
'endscreen-enable' => 0,
|
425 |
+
];
|
426 |
+
|
427 |
+
if ( $setting[ 'embedpress_pro_dailymotion_play_on_mobile' ] === 'yes' ) {
|
428 |
+
$params[ 'playsinline' ] = 1;
|
429 |
+
}
|
430 |
+
if ( is_embedpress_pro_active() ) {
|
431 |
+
$params['start'] = (int) $setting[ 'embedpress_pro_video_start_time' ];
|
432 |
+
$params['ui-logo'] = $setting[ 'embedpress_pro_dailymotion_logo' ] === 'yes' ? 1 : 0;
|
433 |
+
|
434 |
+
}
|
435 |
+
$url_modified = $url_full;
|
436 |
+
foreach ( $params as $param => $value ) {
|
437 |
+
$url_modified = add_query_arg( $param, $value, $url_modified );
|
438 |
+
}
|
439 |
+
$embed->embed = str_replace( $url_full, $url_modified, $embed->embed );
|
440 |
+
return $embed;
|
441 |
+
}
|
442 |
+
public static function twitch( $embed_content, $settings ) {
|
443 |
+
if ( !isset( $embed_content->provider_name ) || strtoupper( $embed_content->provider_name ) !== 'TWITCH' || !isset( $embed_content->embed ) || $settings[ 'embedpress_pro_embeded_source' ] !== 'twitch' ) {
|
444 |
+
return $embed_content;
|
445 |
+
}
|
446 |
+
$e = current( $embed_content);
|
447 |
+
$time = '0h0m0s';
|
448 |
+
$type = isset( $e['type']) ? $e['type']: '';
|
449 |
+
$content_id = isset( $e['content_id']) ? $e['content_id'] : '';
|
450 |
+
$channel = 'channel' === $type ? $content_id : '';
|
451 |
+
$video = 'video' === $type ? $content_id : '';
|
452 |
+
$muted = 'false';
|
453 |
+
$full_screen = ('yes' === $settings['embedpress_pro_fs']) ? 'true': 'false';
|
454 |
+
$autoplay = ('yes' === $settings['embedpress_pro_twitch_autoplay']) ? 'true': 'false';
|
455 |
+
$theme = 'dark';
|
456 |
+
$layout = 'video';
|
457 |
+
$width = (int) $settings['width']['size'];
|
458 |
+
$height = (int) $settings['height']['size'];
|
459 |
+
|
460 |
+
if ( is_embedpress_pro_active() ) {
|
461 |
+
if ( !empty( $settings['embedpress_pro_video_start_time']) ) {
|
462 |
+
$ta = explode( ':', gmdate( "G:i:s", $settings['embedpress_pro_video_start_time']));
|
463 |
+
$h = $ta[0].'h';
|
464 |
+
$m = ($ta[1] * 1) .'m';
|
465 |
+
$s = ($ta[2] * 1) .'s';
|
466 |
+
$time = $h.$m.$s;
|
467 |
+
}
|
468 |
+
$layout = ('yes' === $settings['embedpress_pro_twitch_chat']) ? 'video-with-chat' : 'video';
|
469 |
+
$muted = ('yes' === $settings['embedpress_pro_twitch_mute']) ? 'true': 'false';
|
470 |
+
$theme = !empty( $settings['embedpress_pro_twitch_theme']) ? $settings['embedpress_pro_twitch_theme'] : 'dark';
|
471 |
+
}
|
472 |
+
|
473 |
+
|
474 |
+
$url = "https://embed.twitch.tv?autoplay={$autoplay}&channel={$channel}&height={$height}&layout={$layout}&migration=true&muted={$muted}&theme={$theme}&time={$time}&video={$video}&width={$width}&allowfullscreen={$full_screen}";
|
475 |
+
$pars_url = wp_parse_url(get_site_url());
|
476 |
+
$url = !empty($pars_url['host'])?$url.'&parent='.$pars_url['host']:$url;
|
477 |
+
|
478 |
+
preg_match( '/src=\"(.+?)\"/', $embed_content->embed, $match );
|
479 |
+
$url_full = $match[ 1 ];
|
480 |
+
$embed_content->embed = str_replace( $url_full, $url, $embed_content->embed );
|
481 |
+
if ( is_embedpress_pro_active() ) {
|
482 |
+
return self::apply_cta_markup( $embed_content, $settings, 'twitch');
|
483 |
+
}
|
484 |
+
|
485 |
+
return $embed_content;
|
486 |
+
}
|
487 |
+
public static function spotify( $embed, $setting ) {
|
488 |
+
if ( !isset( $embed->provider_name ) || strtolower( $embed->provider_name ) !== 'spotify' || !isset( $embed->embed ) ) {
|
489 |
+
return $embed;
|
490 |
+
}
|
491 |
+
preg_match( '/src=\"(.+?)\"/', $embed->embed, $match );
|
492 |
+
$url_full = $match[ 1 ];
|
493 |
+
$modified_url = str_replace( 'playlist-v2', 'playlist', $url_full);
|
494 |
+
if ( $setting[ 'embedpress_pro_embeded_source' ] == 'spotify' ) {
|
495 |
+
// apply elementor related mod
|
496 |
+
if(isset( $setting['spotify_theme'])){
|
497 |
+
if ( strpos( $modified_url, '?') !== false ) {
|
498 |
+
$modified_url .= '&theme='.sanitize_text_field( $setting['spotify_theme']);
|
499 |
+
}else{
|
500 |
+
$modified_url .= '?theme='.sanitize_text_field( $setting['spotify_theme']);
|
501 |
+
}
|
502 |
+
}
|
503 |
+
}
|
504 |
+
|
505 |
+
$embed->embed = str_replace( $url_full, $modified_url, $embed->embed );
|
506 |
+
return $embed;
|
507 |
+
}
|
508 |
+
|
509 |
+
/**
|
510 |
+
* Get the Video ID from the URL
|
511 |
+
*
|
512 |
+
* @param string $url
|
513 |
+
*
|
514 |
+
* @return string
|
515 |
+
*/
|
516 |
+
public static function get_wistia_video_from_url ($url) {
|
517 |
+
// https://fast.wistia.com/embed/medias/xf1edjzn92.jsonp
|
518 |
+
// https://ostraining-1.wistia.com/medias/xf1edjzn92
|
519 |
+
preg_match('#\/medias\\\?\/([a-z0-9]+)\.?#i', $url, $matches);
|
520 |
+
|
521 |
+
$id = false;
|
522 |
+
if (isset($matches[1])) {
|
523 |
+
$id = $matches[1];
|
524 |
+
}
|
525 |
+
|
526 |
+
return $id;
|
527 |
+
}
|
528 |
+
}
|
EmbedPress/Includes/Classes/Feature_Enhancer.php
CHANGED
@@ -5,26 +5,41 @@ class Feature_Enhancer {
|
|
5 |
|
6 |
public function __construct() {
|
7 |
|
8 |
-
if ( !is_embedpress_pro_active() ) {
|
9 |
-
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_youtube'] );
|
10 |
-
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_vimeo'] );
|
11 |
-
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_wistia'] );
|
12 |
-
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_twitch'] );
|
|
|
|
|
13 |
add_filter( 'embedpress_gutenberg_youtube_params',
|
14 |
[$this, 'embedpress_gutenberg_register_block_youtube'] );
|
15 |
add_action( 'init', array( $this, 'embedpress_gutenberg_register_block_vimeo' ) );
|
16 |
add_action('embedpress_gutenberg_wistia_block_after_embed', array($this,'embedpress_wistia_block_after_embed'));
|
17 |
add_action( 'elementor/widget/embedpres_elementor/skins_init', [ $this, 'elementor_setting_init' ] );
|
18 |
-
}
|
19 |
|
20 |
|
21 |
}
|
22 |
|
23 |
public function elementor_setting_init( ) {
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
}
|
29 |
|
30 |
public function getOptions($provider='', $schema=[])
|
@@ -117,7 +132,7 @@ class Feature_Enhancer {
|
|
117 |
return apply_filters( 'embedpress_vimeo_params', $params);
|
118 |
|
119 |
}
|
120 |
-
|
121 |
public function enhance_youtube( $embed )
|
122 |
{
|
123 |
$isYoutube = ( isset($embed->provider_name) && strtoupper( $embed->provider_name ) === 'YOUTUBE' ) || (isset( $embed->url) && isset( $embed->{$embed->url}) && isset( $embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name'] ) === 'YOUTUBE');
|
@@ -383,6 +398,85 @@ class Feature_Enhancer {
|
|
383 |
return $embed_content;
|
384 |
}
|
385 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
386 |
public function embedpress_gutenberg_register_block_youtube( $youtube_params ) {
|
387 |
$youtube_options = $this->getOptions('youtube', $this->get_youtube_settings_schema());
|
388 |
return $this->get_youtube_params( $youtube_options );
|
@@ -672,7 +766,7 @@ class Feature_Enhancer {
|
|
672 |
}
|
673 |
|
674 |
public function embedpress_wistia_block_after_embed( $attributes ){
|
675 |
-
$embedOptions= $this->
|
676 |
// Get the video ID
|
677 |
$videoId = $this->getVideoIDFromURL($attributes['url']);
|
678 |
$shortVideoId = $videoId;
|
@@ -690,7 +784,7 @@ class Feature_Enhancer {
|
|
690 |
$html .= "<script>wistiaEmbed = Wistia.embed( \"{$shortVideoId}\", {$embedOptions} );</script>\n";
|
691 |
echo $html;
|
692 |
}
|
693 |
-
public function
|
694 |
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
|
695 |
// Embed Options
|
696 |
$embedOptions = new \stdClass;
|
@@ -812,4 +906,91 @@ class Feature_Enhancer {
|
|
812 |
];
|
813 |
}
|
814 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
815 |
}
|
5 |
|
6 |
public function __construct() {
|
7 |
|
8 |
+
//if ( !is_embedpress_pro_active() ) {
|
9 |
+
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_youtube'], 90 );
|
10 |
+
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_vimeo'], 90 );
|
11 |
+
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_wistia'], 90 );
|
12 |
+
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_twitch'], 90 );
|
13 |
+
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_dailymotion'], 90 );
|
14 |
+
add_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_soundcloud'], 90 );
|
15 |
add_filter( 'embedpress_gutenberg_youtube_params',
|
16 |
[$this, 'embedpress_gutenberg_register_block_youtube'] );
|
17 |
add_action( 'init', array( $this, 'embedpress_gutenberg_register_block_vimeo' ) );
|
18 |
add_action('embedpress_gutenberg_wistia_block_after_embed', array($this,'embedpress_wistia_block_after_embed'));
|
19 |
add_action( 'elementor/widget/embedpres_elementor/skins_init', [ $this, 'elementor_setting_init' ] );
|
20 |
+
//}
|
21 |
|
22 |
|
23 |
}
|
24 |
|
25 |
public function elementor_setting_init( ) {
|
26 |
+
$this->remove_classic_filters();
|
27 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'youtube'], 10, 2 );
|
28 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'wistia'], 10, 2 );
|
29 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'twitch'], 10, 2 );
|
30 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'soundcloud'], 10, 2 );
|
31 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'dailymotion'], 10, 2 );
|
32 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'spotify'], 10, 2 );
|
33 |
+
add_filter( 'embedpress_elementor_embed', [Elementor_Enhancer::class, 'vimeo'], 10, 2 );
|
34 |
+
}
|
35 |
+
|
36 |
+
public function remove_classic_filters( ) {
|
37 |
+
remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_youtube'], 90 );
|
38 |
+
remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_vimeo'], 90 );
|
39 |
+
remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_wistia'], 90 );
|
40 |
+
remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_twitch'], 90 );
|
41 |
+
remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_dailymotion'], 90 );
|
42 |
+
remove_filter( 'embedpress:onAfterEmbed', [$this, 'enhance_soundcloud'], 90 );
|
43 |
}
|
44 |
|
45 |
public function getOptions($provider='', $schema=[])
|
132 |
return apply_filters( 'embedpress_vimeo_params', $params);
|
133 |
|
134 |
}
|
135 |
+
//--- For CLASSIC AND BLOCK EDITOR
|
136 |
public function enhance_youtube( $embed )
|
137 |
{
|
138 |
$isYoutube = ( isset($embed->provider_name) && strtoupper( $embed->provider_name ) === 'YOUTUBE' ) || (isset( $embed->url) && isset( $embed->{$embed->url}) && isset( $embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name'] ) === 'YOUTUBE');
|
398 |
return $embed_content;
|
399 |
}
|
400 |
|
401 |
+
public function enhance_dailymotion( $embed ) {
|
402 |
+
$options = $this->getOptions('dailymotion', $this->get_dailymotion_settings_schema());
|
403 |
+
$isDailymotion = ( isset($embed->provider_name) && strtoupper( $embed->provider_name ) === 'DAILYMOTION' ) || (isset( $embed->url) && isset( $embed->{$embed->url}) && isset( $embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name'] ) === 'DAILYMOTION');
|
404 |
+
|
405 |
+
if ( $isDailymotion && isset( $embed->embed )
|
406 |
+
&& preg_match( '/src=\"(.+?)\"/', $embed->embed, $match ) ) {
|
407 |
+
// Parse the url to retrieve all its info like variables etc.
|
408 |
+
$url_full = $match[ 1 ];
|
409 |
+
$params = [
|
410 |
+
'ui-highlight' => str_replace( '#', '', $options[ 'color' ] ),
|
411 |
+
'mute' => (int) $options[ 'mute' ],
|
412 |
+
'autoplay' => (int) $options[ 'autoplay' ],
|
413 |
+
'controls' => (int) $options[ 'controls' ],
|
414 |
+
'ui-start-screen-info' => (int) $options[ 'video_info' ],
|
415 |
+
'endscreen-enable' => 0,
|
416 |
+
];
|
417 |
+
|
418 |
+
if ( $options[ 'play_on_mobile' ] == '1' ) {
|
419 |
+
$params[ 'playsinline' ] = 1;
|
420 |
+
}
|
421 |
+
if ( is_embedpress_pro_active() ) {
|
422 |
+
$params['start'] = (int) $options[ 'start_time' ];
|
423 |
+
$params['ui-logo'] = (int) $options[ 'show_logo' ];
|
424 |
+
}
|
425 |
+
|
426 |
+
$url_modified = $url_full;
|
427 |
+
foreach ( $params as $param => $value ) {
|
428 |
+
$url_modified = add_query_arg( $param, $value, $url_modified );
|
429 |
+
}
|
430 |
+
$embed->embed = str_replace( $url_full, $url_modified, $embed->embed );
|
431 |
+
|
432 |
+
}
|
433 |
+
|
434 |
+
return $embed;
|
435 |
+
}
|
436 |
+
|
437 |
+
public function enhance_soundcloud( $embed ) {
|
438 |
+
|
439 |
+
$isSoundcloud = ( isset($embed->provider_name) && strtoupper( $embed->provider_name ) === 'SOUNDCLOUD' ) || (isset( $embed->url) && isset( $embed->{$embed->url}) && isset( $embed->{$embed->url}['provider_name']) && strtoupper($embed->{$embed->url}['provider_name'] ) === 'SOUNDCLOUD');
|
440 |
+
|
441 |
+
if ( $isSoundcloud && isset( $embed->embed )
|
442 |
+
&& preg_match( '/src=\"(.+?)\"/', $embed->embed, $match ) ) {
|
443 |
+
$options = $this->getOptions('soundcloud', $this->get_soundcloud_settings_schema());
|
444 |
+
// Parse the url to retrieve all its info like variables etc.
|
445 |
+
$url_full = $match[ 1 ];
|
446 |
+
$params = [
|
447 |
+
'color' => str_replace( '#', '', $options[ 'color' ] ),
|
448 |
+
'visual' => isset($options[ 'visual' ] ) && $options['visual']== '1' ? 'true' : 'false',
|
449 |
+
'auto_play' => isset($options[ 'autoplay' ] ) && $options['autoplay']== '1' ? 'true' : 'false',
|
450 |
+
'sharing' => isset($options[ 'share_button' ] ) && $options['share_button']== '1' ? 'true' : 'false',
|
451 |
+
'show_comments' => isset($options[ 'comments' ] ) && $options['comments']== '1' ? 'true' : 'false',
|
452 |
+
'buying' => 'false',
|
453 |
+
'download' => 'false',
|
454 |
+
'show_artwork' => isset($options[ 'artwork' ] ) && $options['artwork']== '1' ? 'true' : 'false',
|
455 |
+
'show_playcount' => isset($options[ 'play_count' ] ) && $options['play_count']== '1' ? 'true' : 'false',
|
456 |
+
'show_user' => isset($options[ 'username' ] ) && $options['username']== '1' ? 'true' : 'false',
|
457 |
+
];
|
458 |
+
|
459 |
+
if ( is_embedpress_pro_active() ) {
|
460 |
+
$params['buying'] = isset($options[ 'buy_button' ] ) && $options['buy_button']== '1' ? 'true' : 'false';
|
461 |
+
$params['download'] = isset($options[ 'download_button' ] ) && $options['download_button']== '1' ? 'true' : 'false';
|
462 |
+
}
|
463 |
+
|
464 |
+
$url_modified = $url_full;
|
465 |
+
foreach ( $params as $param => $value ) {
|
466 |
+
$url_modified = add_query_arg( $param, $value, $url_modified );
|
467 |
+
}
|
468 |
+
|
469 |
+
// Replaces the old url with the new one.
|
470 |
+
$embed->embed = str_replace( $url_full, $url_modified, $embed->embed );
|
471 |
+
if ( 'false' === $params[ 'visual' ] ) {
|
472 |
+
$embed->embed = str_replace( 'height="400"', 'height="200 !important"', $embed->embed );
|
473 |
+
}
|
474 |
+
|
475 |
+
}
|
476 |
+
|
477 |
+
return $embed;
|
478 |
+
}
|
479 |
+
|
480 |
public function embedpress_gutenberg_register_block_youtube( $youtube_params ) {
|
481 |
$youtube_options = $this->getOptions('youtube', $this->get_youtube_settings_schema());
|
482 |
return $this->get_youtube_params( $youtube_options );
|
766 |
}
|
767 |
|
768 |
public function embedpress_wistia_block_after_embed( $attributes ){
|
769 |
+
$embedOptions= $this->embedpress_wistia_pro_get_options();
|
770 |
// Get the video ID
|
771 |
$videoId = $this->getVideoIDFromURL($attributes['url']);
|
772 |
$shortVideoId = $videoId;
|
784 |
$html .= "<script>wistiaEmbed = Wistia.embed( \"{$shortVideoId}\", {$embedOptions} );</script>\n";
|
785 |
echo $html;
|
786 |
}
|
787 |
+
public function embedpress_wistia_pro_get_options() {
|
788 |
$options = $this->getOptions('wistia', $this->get_wistia_settings_schema());
|
789 |
// Embed Options
|
790 |
$embedOptions = new \stdClass;
|
906 |
];
|
907 |
}
|
908 |
|
909 |
+
public function get_dailymotion_settings_schema() {
|
910 |
+
return [
|
911 |
+
'autoplay' => [
|
912 |
+
'type' => 'string',
|
913 |
+
'default' => ''
|
914 |
+
],
|
915 |
+
'play_on_mobile' => [
|
916 |
+
'type' => 'string',
|
917 |
+
'default' => ''
|
918 |
+
],
|
919 |
+
'color' => [
|
920 |
+
'type' => 'string',
|
921 |
+
'default' => '#dd3333'
|
922 |
+
],
|
923 |
+
'mute' => [
|
924 |
+
'type' => 'string',
|
925 |
+
'default' => ''
|
926 |
+
],
|
927 |
+
'controls' => [
|
928 |
+
'type' => 'string',
|
929 |
+
'default' => '1'
|
930 |
+
],
|
931 |
+
'video_info' => [
|
932 |
+
'type' => 'string',
|
933 |
+
'default' => '1'
|
934 |
+
],
|
935 |
+
'show_logo' => [
|
936 |
+
'type' => 'string',
|
937 |
+
'default' => '1'
|
938 |
+
],
|
939 |
+
'start_time' => [
|
940 |
+
'type' => 'string',
|
941 |
+
'default' => '0'
|
942 |
+
],
|
943 |
+
];
|
944 |
+
}
|
945 |
+
|
946 |
+
public function get_soundcloud_settings_schema() {
|
947 |
+
return [
|
948 |
+
'visual' => [
|
949 |
+
'type' => 'string',
|
950 |
+
'default' => ''
|
951 |
+
],
|
952 |
+
'autoplay' => [
|
953 |
+
'type' => 'string',
|
954 |
+
'default' => ''
|
955 |
+
],
|
956 |
+
'play_on_mobile' => [
|
957 |
+
'type' => 'string',
|
958 |
+
'default' => ''
|
959 |
+
],
|
960 |
+
'color' => [
|
961 |
+
'type' => 'string',
|
962 |
+
'default' => '#dd3333'
|
963 |
+
],
|
964 |
+
|
965 |
+
'share_button' => [
|
966 |
+
'type' => 'string',
|
967 |
+
'default' => ''
|
968 |
+
],
|
969 |
+
'comments' => [
|
970 |
+
'type' => 'string',
|
971 |
+
'default' => '1'
|
972 |
+
],
|
973 |
+
'artwork' => [
|
974 |
+
'type' => 'string',
|
975 |
+
'default' => ''
|
976 |
+
],
|
977 |
+
'play_count' => [
|
978 |
+
'type' => 'string',
|
979 |
+
'default' => '1'
|
980 |
+
],
|
981 |
+
'username' => [
|
982 |
+
'type' => 'string',
|
983 |
+
'default' => '1'
|
984 |
+
],
|
985 |
+
'download_button' => [
|
986 |
+
'type' => 'string',
|
987 |
+
'default' => '1'
|
988 |
+
],
|
989 |
+
'buy_button' => [
|
990 |
+
'type' => 'string',
|
991 |
+
'default' => '1'
|
992 |
+
],
|
993 |
+
];
|
994 |
+
}
|
995 |
+
|
996 |
}
|
EmbedPress/Plugins/Html/Field.php
DELETED
@@ -1,182 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
namespace EmbedPress\Plugins\Html;
|
4 |
-
|
5 |
-
(defined('ABSPATH') && defined('EMBEDPRESS_IS_LOADED')) or die("No direct script access allowed.");
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Entity responsible to generating and rendering html fields to the settings page.
|
9 |
-
*
|
10 |
-
* @package EmbedPress
|
11 |
-
* @author EmbedPress <help@embedpress.com>
|
12 |
-
* @copyright Copyright (C) 2020 WPDeveloper. All rights reserved.
|
13 |
-
* @license GPLv3 or later
|
14 |
-
* @since 1.4.0
|
15 |
-
*/
|
16 |
-
class Field
|
17 |
-
{
|
18 |
-
/**
|
19 |
-
* Generates a number type input.
|
20 |
-
*
|
21 |
-
* @param $value
|
22 |
-
*
|
23 |
-
* @return string
|
24 |
-
* @since 2.7.5
|
25 |
-
* @access protected
|
26 |
-
* @static
|
27 |
-
*/
|
28 |
-
protected static function number($value)
|
29 |
-
{
|
30 |
-
return '<input type="number" name="embedpress:{{slug}}[{{name}}]" class="{{classes}}" placeholder="{{placeholder}}" value="' . (int)$value . '">';
|
31 |
-
|
32 |
-
}
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Generates a url type input.
|
36 |
-
*
|
37 |
-
* @param $value
|
38 |
-
*
|
39 |
-
* @return string
|
40 |
-
* @since 2.7.5
|
41 |
-
* @access protected
|
42 |
-
* @static
|
43 |
-
*/
|
44 |
-
protected static function url($value)
|
45 |
-
{
|
46 |
-
return '<input type="url" name="embedpress:{{slug}}[{{name}}]" class="{{classes}}" placeholder="{{placeholder}}" value="' . (string)$value . '">';
|
47 |
-
|
48 |
-
}
|
49 |
-
/**
|
50 |
-
* Generates a text type input.
|
51 |
-
*
|
52 |
-
* @since 1.4.0
|
53 |
-
* @access protected
|
54 |
-
* @static
|
55 |
-
*
|
56 |
-
* @return string
|
57 |
-
*/
|
58 |
-
protected static function text($value)
|
59 |
-
{
|
60 |
-
return '<input type="text" name="embedpress:{{slug}}[{{name}}]" class="{{classes}}" placeholder="{{placeholder}}" value="' . (string)$value . '">';
|
61 |
-
}
|
62 |
-
|
63 |
-
/**
|
64 |
-
* Generates a textarea input.
|
65 |
-
*
|
66 |
-
* @since 1.4.0
|
67 |
-
* @access protected
|
68 |
-
* @static
|
69 |
-
*
|
70 |
-
* @return string
|
71 |
-
*/
|
72 |
-
protected static function textarea($value)
|
73 |
-
{
|
74 |
-
return '<textarea name="embedpress:{{slug}}[{{name}}]" class="{{classes}}" placeholder="{{placeholder}}">' . (string)$value . '</textarea>';
|
75 |
-
}
|
76 |
-
|
77 |
-
/**
|
78 |
-
* Generates a radio type input.
|
79 |
-
*
|
80 |
-
* @since 1.4.0
|
81 |
-
* @access protected
|
82 |
-
* @static
|
83 |
-
*
|
84 |
-
* @return string
|
85 |
-
*/
|
86 |
-
protected static function radio($options, $value = null)
|
87 |
-
{
|
88 |
-
$html = [];
|
89 |
-
|
90 |
-
foreach ((array)$options as $optionValue => $optionLabel) {
|
91 |
-
$html[] = '<label>';
|
92 |
-
$html[] = '<input type="radio" name="embedpress:{{slug}}[{{name}}]" class="{{classes}}" value="' . $optionValue . '"' . ($value === $optionValue ? ' checked' : '') . '>';
|
93 |
-
$html[] = ' ' . $optionLabel;
|
94 |
-
$html[] = '</label> ';
|
95 |
-
}
|
96 |
-
|
97 |
-
return implode('', $html);
|
98 |
-
}
|
99 |
-
|
100 |
-
/**
|
101 |
-
* Generates a select input.
|
102 |
-
*
|
103 |
-
* @since 1.4.0
|
104 |
-
* @access protected
|
105 |
-
* @static
|
106 |
-
*
|
107 |
-
* @return string
|
108 |
-
*/
|
109 |
-
protected static function select($options, $value = null)
|
110 |
-
{
|
111 |
-
$html = ['<select name="embedpress:{{slug}}[{{name}}]" class="{{classes}}">'];
|
112 |
-
|
113 |
-
foreach ((array)$options as $optionValue => $optionLabel) {
|
114 |
-
$html[] = '<option value="' . $optionValue . '"' . ($value === (string)$optionValue ? ' selected' : '') . '>' . $optionLabel . '</option>';
|
115 |
-
}
|
116 |
-
|
117 |
-
$html[] = '</select>';
|
118 |
-
|
119 |
-
return implode('', $html);
|
120 |
-
}
|
121 |
-
|
122 |
-
/**
|
123 |
-
* Render a field based on a field schema.
|
124 |
-
*
|
125 |
-
* @since 1.4.0
|
126 |
-
* @static
|
127 |
-
*
|
128 |
-
* @param array $params There's two available keys: 'field' which holds the field schema; and 'pluginSlug' which
|
129 |
-
* represents the slug of the plugin where the field belongs to.
|
130 |
-
*
|
131 |
-
* @return void
|
132 |
-
*/
|
133 |
-
public static function render($params)
|
134 |
-
{
|
135 |
-
$field = json_decode(json_encode($params['field']));
|
136 |
-
|
137 |
-
$pluginSlug = "embedpress:{$params['pluginSlug']}";
|
138 |
-
|
139 |
-
$options = (array)get_option($pluginSlug);
|
140 |
-
|
141 |
-
$field->type = strtolower($field->type);
|
142 |
-
|
143 |
-
if ($field->slug === "license_key") {
|
144 |
-
$value = isset($options['license']['key']) ? (string)$options['license']['key'] : "";
|
145 |
-
} else {
|
146 |
-
$value = isset($options[$field->slug]) ? $options[$field->slug] : (isset($field->default) ? $field->default : '');
|
147 |
-
}
|
148 |
-
|
149 |
-
if (in_array($field->type, ['bool', 'boolean'])) {
|
150 |
-
$html = self::radio([
|
151 |
-
0 => 'No',
|
152 |
-
1 => 'Yes',
|
153 |
-
], (int)$value);
|
154 |
-
} elseif (isset($field->options)) {
|
155 |
-
$html = self::select((array)$field->options, (string)$value);
|
156 |
-
} elseif (in_array($field->type, ['textarea'])) {
|
157 |
-
$html = self::textarea((string)$value);
|
158 |
-
} elseif (in_array($field->type, ['number', 'NUMBER'])) {
|
159 |
-
$html = self::number((int)$value);
|
160 |
-
} elseif (in_array($field->type, ['url', 'link'])) {
|
161 |
-
$html = self::url($value);
|
162 |
-
} else {
|
163 |
-
$html = self::text((string)$value);
|
164 |
-
}
|
165 |
-
|
166 |
-
$html = str_replace('{{slug}}', $params['pluginSlug'], $html);
|
167 |
-
$html = str_replace('{{name}}', $field->slug, $html);
|
168 |
-
$html = str_replace('{{classes}}', implode(' ', (! empty($field->classes) ? (array)$field->classes : [])),
|
169 |
-
$html);
|
170 |
-
$html = str_replace('{{placeholder}}', (! empty($field->placeholder) ? (string)$field->placeholder : ""),
|
171 |
-
$html);
|
172 |
-
|
173 |
-
$html .= wp_nonce_field("{$pluginSlug}:nonce", "{$pluginSlug}:nonce");
|
174 |
-
|
175 |
-
if ( ! empty($field->description)) {
|
176 |
-
$html .= '<br/>';
|
177 |
-
$html .= '<p class="description">' . $field->description . '</p>';
|
178 |
-
}
|
179 |
-
|
180 |
-
echo $html;
|
181 |
-
}
|
182 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmbedPress/Plugins/Html/index.html
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
<head>
|
4 |
-
<title>403 Forbidden</title>
|
5 |
-
</head>
|
6 |
-
<body>
|
7 |
-
<p>Directory access is forbidden.</p>
|
8 |
-
</body>
|
9 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EmbedPress/Plugins/Plugin.php
CHANGED
@@ -78,20 +78,16 @@ abstract class Plugin
|
|
78 |
$pluginSignature = EMBEDPRESS_PLG_NAME . '-' . static::SLUG . '/' . EMBEDPRESS_PLG_NAME . '-' . static::SLUG . '.php';
|
79 |
if (is_admin() && ! self::isEmbedPressActive() && is_plugin_active($pluginSignature)) {
|
80 |
deactivate_plugins($pluginSignature);
|
81 |
-
} else {
|
82 |
-
static::registerSettings();
|
83 |
}
|
84 |
}
|
85 |
|
86 |
/**
|
87 |
* Callback triggered by WordPress' 'register_activation_hook' function.
|
88 |
-
*
|
89 |
-
|
90 |
* @static
|
91 |
-
*
|
92 |
-
* @return void
|
93 |
*/
|
94 |
-
|
95 |
{
|
96 |
return true;
|
97 |
}
|
@@ -109,135 +105,6 @@ abstract class Plugin
|
|
109 |
delete_option(EMBEDPRESS_PLG_NAME . ':' . static::SLUG);
|
110 |
}
|
111 |
|
112 |
-
/**
|
113 |
-
* Method that validates the EmbedPress plugin's settings form.
|
114 |
-
*
|
115 |
-
* @since 1.4.0
|
116 |
-
* @static
|
117 |
-
*
|
118 |
-
* @param array $postData The data coming from the form via POST.
|
119 |
-
*
|
120 |
-
* @return array
|
121 |
-
*/
|
122 |
-
public static function validateForm($postData)
|
123 |
-
{
|
124 |
-
$pluginSlugNonce = EMBEDPRESS_PLG_NAME . ':' . static::SLUG . ':nonce';
|
125 |
-
if ( ! check_admin_referer($pluginSlugNonce, $pluginSlugNonce)) {
|
126 |
-
return;
|
127 |
-
}
|
128 |
-
|
129 |
-
$data = [];
|
130 |
-
|
131 |
-
$schema = static::getOptionsSchema();
|
132 |
-
foreach ($schema as $fieldSlug => $field) {
|
133 |
-
if (isset($postData[$fieldSlug])) {
|
134 |
-
$value = $postData[$fieldSlug];
|
135 |
-
} else {
|
136 |
-
$value = isset($field['default']) ? $field['default'] : null;
|
137 |
-
}
|
138 |
-
|
139 |
-
settype($value, isset($field['type']) && in_array(strtolower($field['type']),
|
140 |
-
['bool', 'boolean', 'int', 'integer', 'float', 'string']) ? $field['type'] : 'string');
|
141 |
-
|
142 |
-
$data[$fieldSlug] = $value;
|
143 |
-
}
|
144 |
-
$data['license_key'] = true;
|
145 |
-
static::onAfterFormValidation($data);
|
146 |
-
|
147 |
-
return $data;
|
148 |
-
}
|
149 |
-
|
150 |
-
/**
|
151 |
-
* Method called right after the settings form being validated but before saving the data into DB.
|
152 |
-
*
|
153 |
-
* @since 1.4.0
|
154 |
-
* @static
|
155 |
-
*
|
156 |
-
* @param array Data after validation.
|
157 |
-
*
|
158 |
-
* @return void
|
159 |
-
*/
|
160 |
-
public static function onAfterFormValidation(&$data)
|
161 |
-
{
|
162 |
-
// do nothing
|
163 |
-
}
|
164 |
-
|
165 |
-
/**
|
166 |
-
* Method that appends a tab in EmbedPress' Settings page to the plugin.
|
167 |
-
*
|
168 |
-
* @since 1.4.0
|
169 |
-
* @static
|
170 |
-
*
|
171 |
-
* @param $activeTab
|
172 |
-
*
|
173 |
-
* @return void
|
174 |
-
*/
|
175 |
-
public static function renderTab($activeTab)
|
176 |
-
{
|
177 |
-
?>
|
178 |
-
|
179 |
-
<a href="?page=<?php echo EMBEDPRESS_PLG_NAME; ?>&tab=<?php echo static::SLUG; ?>"
|
180 |
-
class="nav-tab<?php echo $activeTab === static::SLUG ? ' nav-tab-active' : ''; ?> "><?php echo static::NAME; ?></a>
|
181 |
-
|
182 |
-
<?php
|
183 |
-
}
|
184 |
-
|
185 |
-
/**
|
186 |
-
* Method that return the absolute path to the plugin.
|
187 |
-
*
|
188 |
-
* @since 1.4.0
|
189 |
-
* @static
|
190 |
-
*
|
191 |
-
* @return void
|
192 |
-
*/
|
193 |
-
public static function registerSettings()
|
194 |
-
{
|
195 |
-
$identifier = EMBEDPRESS_PLG_NAME . ':' . static::SLUG;
|
196 |
-
register_setting($identifier, $identifier, [static::NAMESPACE_STRING, 'validateForm']);
|
197 |
-
add_settings_section($identifier, EMBEDPRESS . ' > ' . static::NAME . ' Settings',
|
198 |
-
[static::NAMESPACE_STRING, 'onAfterRegisterSettings'], $identifier);
|
199 |
-
|
200 |
-
self::registerSettingsFields();
|
201 |
-
}
|
202 |
-
|
203 |
-
/**
|
204 |
-
* Register all plugin fields to the settings page.
|
205 |
-
*
|
206 |
-
* @since 1.4.0
|
207 |
-
* @static
|
208 |
-
*
|
209 |
-
* @return void
|
210 |
-
*/
|
211 |
-
public static function registerSettingsFields()
|
212 |
-
{
|
213 |
-
$identifier = EMBEDPRESS_PLG_NAME . ':' . static::SLUG;
|
214 |
-
|
215 |
-
$schema = static::getOptionsSchema();
|
216 |
-
foreach ($schema as $fieldSlug => $field) {
|
217 |
-
$field['slug'] = $fieldSlug;
|
218 |
-
if('license_key'===$fieldSlug){
|
219 |
-
continue;
|
220 |
-
}
|
221 |
-
add_settings_field($fieldSlug, $field['label'], [__NAMESPACE__ . '\Html\Field', 'render'], $identifier,
|
222 |
-
$identifier, [
|
223 |
-
'pluginSlug' => static::SLUG,
|
224 |
-
'field' => $field,
|
225 |
-
]);
|
226 |
-
}
|
227 |
-
}
|
228 |
-
|
229 |
-
/**
|
230 |
-
* Callback called after the plugin's settings page has been registered and rendered.
|
231 |
-
*
|
232 |
-
* @since 1.4.0
|
233 |
-
* @static
|
234 |
-
*
|
235 |
-
* @return void
|
236 |
-
*/
|
237 |
-
public static function onAfterRegisterSettings()
|
238 |
-
{
|
239 |
-
// do nothing
|
240 |
-
}
|
241 |
|
242 |
/**
|
243 |
* Retrieve user defined options.
|
78 |
$pluginSignature = EMBEDPRESS_PLG_NAME . '-' . static::SLUG . '/' . EMBEDPRESS_PLG_NAME . '-' . static::SLUG . '.php';
|
79 |
if (is_admin() && ! self::isEmbedPressActive() && is_plugin_active($pluginSignature)) {
|
80 |
deactivate_plugins($pluginSignature);
|
|
|
|
|
81 |
}
|
82 |
}
|
83 |
|
84 |
/**
|
85 |
* Callback triggered by WordPress' 'register_activation_hook' function.
|
86 |
+
* @return bool
|
87 |
+
*@since 1.4.0
|
88 |
* @static
|
|
|
|
|
89 |
*/
|
90 |
+
public static function onActivationCallback()
|
91 |
{
|
92 |
return true;
|
93 |
}
|
105 |
delete_option(EMBEDPRESS_PLG_NAME . ':' . static::SLUG);
|
106 |
}
|
107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
108 |
|
109 |
/**
|
110 |
* Retrieve user defined options.
|
EmbedPress/Shortcode.php
CHANGED
@@ -129,8 +129,15 @@ class Shortcode {
|
|
129 |
self::set_embera_settings(self::$ombed_attributes);
|
130 |
|
131 |
// Identify what service provider the shortcode's link belongs to
|
132 |
-
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
$urlData = self::get_url_data( $url, self::$ombed_attributes, $serviceProvider);
|
135 |
|
136 |
// Sanitize the data
|
@@ -606,7 +613,11 @@ KAMAL;
|
|
606 |
}
|
607 |
|
608 |
protected static function get_content_from_template( $url, $template ) {
|
609 |
-
|
|
|
|
|
|
|
|
|
610 |
|
611 |
if ( !$html ) {
|
612 |
$html = str_replace( '{html}', self::get_embera_instance()->autoEmbed($url), $template );
|
129 |
self::set_embera_settings(self::$ombed_attributes);
|
130 |
|
131 |
// Identify what service provider the shortcode's link belongs to
|
132 |
+
if ( strpos( $url, 'meetup.com') !== false ) {
|
133 |
+
$serviceProvider = '';
|
134 |
+
}else{
|
135 |
+
$serviceProvider = self::get_oembed()->get_provider( $url );
|
136 |
+
}
|
137 |
+
// FIX FOR MEETUP as MEETUP API is OFF, use OUR custom embed
|
138 |
+
if ( 'https://api.meetup.com/oembed' === $serviceProvider ) {
|
139 |
+
$serviceProvider = '';
|
140 |
+
}
|
141 |
$urlData = self::get_url_data( $url, self::$ombed_attributes, $serviceProvider);
|
142 |
|
143 |
// Sanitize the data
|
613 |
}
|
614 |
|
615 |
protected static function get_content_from_template( $url, $template ) {
|
616 |
+
if ( strpos( $url, 'meetup.com') !== false ) {
|
617 |
+
$html = '';
|
618 |
+
}else{
|
619 |
+
$html = self::get_oembed()->get_html( $url, self::get_oembed_attributes() );
|
620 |
+
}
|
621 |
|
622 |
if ( !$html ) {
|
623 |
$html = str_replace( '{html}', self::get_embera_instance()->autoEmbed($url), $template );
|
EmbedPress/simple_html_dom.php
CHANGED
@@ -44,7 +44,27 @@ defined('DEFAULT_BR_TEXT') || define('DEFAULT_BR_TEXT', "\r\n");
|
|
44 |
defined('DEFAULT_SPAN_TEXT') || define('DEFAULT_SPAN_TEXT', ' ');
|
45 |
defined('MAX_FILE_SIZE') || define('MAX_FILE_SIZE', 600000);
|
46 |
define('HDOM_SMARTY_AS_TEXT', 1);
|
47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
/**
|
49 |
* @param $url
|
50 |
* @param false $use_include_path
|
@@ -58,7 +78,7 @@ define('HDOM_SMARTY_AS_TEXT', 1);
|
|
58 |
* @param string $defaultBRText
|
59 |
* @param string $defaultSpanText
|
60 |
*
|
61 |
-
* @return
|
62 |
*/
|
63 |
function file_get_html(
|
64 |
$url,
|
@@ -74,7 +94,7 @@ function file_get_html(
|
|
74 |
$defaultSpanText = DEFAULT_SPAN_TEXT)
|
75 |
{
|
76 |
if($maxLen <= 0) { $maxLen = MAX_FILE_SIZE; }
|
77 |
-
|
78 |
$dom = new simple_html_dom(
|
79 |
null,
|
80 |
$lowercase,
|
44 |
defined('DEFAULT_SPAN_TEXT') || define('DEFAULT_SPAN_TEXT', ' ');
|
45 |
defined('MAX_FILE_SIZE') || define('MAX_FILE_SIZE', 600000);
|
46 |
define('HDOM_SMARTY_AS_TEXT', 1);
|
47 |
+
/**
|
48 |
+
* It checks for data in the node before returning.
|
49 |
+
*
|
50 |
+
* @param simple_html_dom_node $node
|
51 |
+
* @param string $method
|
52 |
+
* @param string $attr_name
|
53 |
+
*
|
54 |
+
* @return string it returns data from the node if found or empty strings otherwise.
|
55 |
+
*/
|
56 |
+
function embedpress_get_markup_from_node( $node, $method='innertext', $attr_name=''){
|
57 |
+
if ( !empty( $node) && is_object( $node) ) {
|
58 |
+
if ( !empty( $attr_name) ) {
|
59 |
+
return $node->getAttribute( $attr_name );
|
60 |
+
}
|
61 |
+
if ( !empty( $method) && method_exists( $node, $method) ) {
|
62 |
+
return $node->{$method}();
|
63 |
+
}
|
64 |
+
return '';
|
65 |
+
}
|
66 |
+
return '';
|
67 |
+
}
|
68 |
/**
|
69 |
* @param $url
|
70 |
* @param false $use_include_path
|
78 |
* @param string $defaultBRText
|
79 |
* @param string $defaultSpanText
|
80 |
*
|
81 |
+
* @return simple_html_dom|false
|
82 |
*/
|
83 |
function file_get_html(
|
84 |
$url,
|
94 |
$defaultSpanText = DEFAULT_SPAN_TEXT)
|
95 |
{
|
96 |
if($maxLen <= 0) { $maxLen = MAX_FILE_SIZE; }
|
97 |
+
/**@var simple_html_dom $dom */
|
98 |
$dom = new simple_html_dom(
|
99 |
null,
|
100 |
$lowercase,
|
Gutenberg/dist/blocks.editor.build.css
CHANGED
@@ -1,2 +1,2 @@
|
|
1 |
.embedpress-document-editmode .components-placeholder__instructions:after{content:"\ASupported File Type: PDF, DOC, PPT, XLS etc ";white-space:pre}
|
2 |
-
.wp-block-embedpress-embedpress iframe{max-width:100%}.ose-the-new-york-times iframe{min-height:500px;max-height:100%}.block-editor-block-list__layout .wp-block figure,.block-editor-block-list__layout .wp-block iframe{margin:0}@media screen and (max-width: 782px){.block-editor-block-list__layout .wp-block figure,.block-editor-block-list__layout .wp-block iframe{height:250px}}
|
1 |
.embedpress-document-editmode .components-placeholder__instructions:after{content:"\ASupported File Type: PDF, DOC, PPT, XLS etc ";white-space:pre}
|
2 |
+
.wp-block-embedpress-embedpress iframe{max-width:100%}.ose-the-new-york-times iframe{min-height:500px;max-height:100%}.block-editor-block-list__layout .wp-block figure,.block-editor-block-list__layout .wp-block iframe{margin:0}@media screen and (max-width: 782px){.block-editor-block-list__layout .wp-block figure,.block-editor-block-list__layout .wp-block iframe{height:250px}}.embedpress-event .link{color:#0098ab}.embedpress-event .visibility--a11yHide{border:0;clip:rect(0 0 0 0);position:absolute;overflow:hidden;margin:-1px;padding:0;width:1px;height:1px}.embedpress-event .text--small{font-size:14px;margin:0}.embedpress-event .flex{display:-ms-flexbox;display:flex;-webkit-box-sizing:border-box;box-sizing:border-box}.embedpress-event .flex--wrap{-ms-flex-wrap:wrap;flex-wrap:wrap}.embedpress-event .flex--row{-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:nowrap;flex-wrap:nowrap}.embedpress-event .flex-item{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;width:auto;min-width:0;-webkit-box-sizing:border-box;box-sizing:border-box}.embedpress-event .flex-item--shrink{-ms-flex-preferred-size:auto;flex-basis:auto;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:0;flex-shrink:0;width:auto}.embedpress-event .flex--row>.flex-item:first-child{padding-left:0}.embedpress-event .text--bold{font-weight:700}.embedpress-event h1,h2,h3,h4,h5,h6{font-size:inherit}.embedpress-event .ep-event--title{font-size:32px;font-weight:700}.embedpress-event .ep-event--date{color:#757575;font-weight:400;font-size:16px}.embedpress-event .ep-event--host{margin-top:20px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:20px}.ep-event--host .avatar-print{border-radius:50%;height:50px;width:50px}.embedpress-event img.avatar--person{background-image:none !important;background-repeat:no-repeat;background-position:50%;background-size:cover;border-radius:50%;-webkit-box-sizing:border-box;box-sizing:border-box;vertical-align:middle}.event-info-hosts-text{padding-left:20px;font-size:16px;font-weight:400}.embedpress-event .event-description{margin-top:20px}.text--sectionTitle{font-size:20px;line-height:28px}.ep-event--attendees{margin-top:50px}.ep-event--attendees>.flex{margin-bottom:20px}.ep-event--attendees .gridList{list-style:none;margin:0 -16px 0 0;padding:0}.ep-event--attendees .gridList-item{width:auto}.ep-event--attendees .gridList--autoHeight--has4>.gridList-item{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.ep-event--attendees .groupMember-name{line-height:1.2 !important}.ep-event--attendees .avatar--person{margin-bottom:15px;display:inline-block;border-radius:50%}.ep-event--attendees img.avatar-print{border-radius:50%}.ep-event--attendees .groupMember-role{font-size:12px;color:#757575;padding-top:2px;margin:0}.ep-event--attendees .groupMember{min-height:100%;min-width:128px;padding-left:8px;padding-right:8px}.embedpress-event .align--center{text-align:center}.embedpress-event .card{background:#fff;background-clip:padding-box;background-size:cover;border:1px solid rgba(46,62,72,0.12);border-radius:8px;-webkit-box-sizing:border-box;box-sizing:border-box;display:block;min-height:100%;padding:16px 16px 18px;position:relative;white-space:normal}.embedpress-event .card--hasHoverShadow{-webkit-transition:-webkit-box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:-webkit-box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);-o-transition:box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);transition:box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),-webkit-box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),-webkit-transform 0.25s cubic-bezier(0.4, 0, 0.2, 1)}.embedpress-event .ep-event-group-link{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;background:#ffffff;border-radius:8px;padding:20px;margin-bottom:20px;border:1px solid rgba(46,62,72,0.12)}.embedpress-event .ep-event-group--name{padding-left:20px;font-size:14px;line-height:1.45;margin:0;width:70%;word-break:break-word}.embedpress-event .ep-event-group--image{-o-object-fit:cover;object-fit:cover;width:56px;height:56px;border-radius:4px}.embedpress-event .ep-event-time-location{background:#ffffff;border-radius:8px;padding:16px 20px 0 20px;border:1px solid rgba(46,62,72,0.12)}.embedpress-event .ep-event-time-location .ep-event-datetime,.embedpress-event .ep-event-time-location .ep-event-location{padding-bottom:20px}.embedpress-event .ep-event-location .wrap--singleLine--truncate,.embedpress-event .ep-event-time-location .ep-event-datetime{font-size:15px;line-height:1.5;color:#2e3e48;font-style:normal;margin:0}.embedpress-event .ep-event-location address{font-style:normal;margin:0}.embedpress-event .ep-event-location .venueDisplay-venue-address{font-style:normal;color:#757575;margin:0}.embedpress-event .ep-event-location p{line-height:20px}.ep-event--attendees .gridList-item{-webkit-box-sizing:border-box;box-sizing:border-box;display:inline-block;font-size:1rem;margin:0;vertical-align:top;width:50%}.gridList-itemInner{-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;padding:0 16px 16px 0}@media only screen and (min-width: 530px){.ep-event--attendees .gridList--autoHeight--has4>.gridList-item{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}}@media only screen and (min-width: 640px){.embedpress-event .card{padding:18px 18px 20px}.ep-event--attendees .gridList--autoHeight--has4>.gridList-item{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}}
|
PROVIDERS.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
In addition to the [default WordPress sources](https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F),
|
2 |
|
3 |
- 23h (Images)
|
4 |
- AmCharts (Charts)
|
1 |
+
In addition to the [default WordPress sources](https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F), EmbedPress Embeds supports these providers:
|
2 |
|
3 |
- 23h (Images)
|
4 |
- AmCharts (Charts)
|
assets/css/el-icon.css
CHANGED
@@ -32,3 +32,27 @@
|
|
32 |
.icon-pdf:before {
|
33 |
content: "\e926";
|
34 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
.icon-pdf:before {
|
33 |
content: "\e926";
|
34 |
}
|
35 |
+
/*EmbedPress Pro Controls Style Starts*/
|
36 |
+
.elementor-control.embedpress-pro-control{
|
37 |
+
position: relative;
|
38 |
+
opacity: .9;
|
39 |
+
}
|
40 |
+
|
41 |
+
.elementor-control.embedpress-pro-control::before{
|
42 |
+
content: '';
|
43 |
+
position: absolute;
|
44 |
+
width: 100%;
|
45 |
+
height: 100%;
|
46 |
+
display: block;
|
47 |
+
top: 0;
|
48 |
+
left: 0;
|
49 |
+
bottom: 0;
|
50 |
+
right: 0;
|
51 |
+
z-index: 99;
|
52 |
+
background: transparent;
|
53 |
+
}
|
54 |
+
|
55 |
+
.elementor-control.elementor-control-embedpress_pro_section.elementor-control-type-section.elementor-label-inline.elementor-control-separator-none .elementor-panel-heading-title {
|
56 |
+
color: #ff5544;
|
57 |
+
}
|
58 |
+
/*EmbedPress Pro Controls Style Ends*/
|
assets/css/embedpress-elementor.css
CHANGED
@@ -57,4 +57,261 @@
|
|
57 |
margin: 0 auto;
|
58 |
font-size: 16px;
|
59 |
font-weight: 700;
|
60 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
margin: 0 auto;
|
58 |
font-size: 16px;
|
59 |
font-weight: 700;
|
60 |
+
}
|
61 |
+
|
62 |
+
|
63 |
+
/*Meetup Event styling starts */
|
64 |
+
.embedpress-event .link {
|
65 |
+
color: #0098ab ;
|
66 |
+
}
|
67 |
+
.embedpress-event .visibility--a11yHide {
|
68 |
+
border: 0;
|
69 |
+
clip: rect(0 0 0 0);
|
70 |
+
position: absolute;
|
71 |
+
overflow: hidden;
|
72 |
+
margin: -1px;
|
73 |
+
padding: 0;
|
74 |
+
width: 1px;
|
75 |
+
height: 1px;
|
76 |
+
}
|
77 |
+
.embedpress-event .text--small {
|
78 |
+
font-size: 14px;
|
79 |
+
margin: 0;
|
80 |
+
}
|
81 |
+
.embedpress-event .flex {
|
82 |
+
display: flex;
|
83 |
+
box-sizing: border-box;
|
84 |
+
}
|
85 |
+
.embedpress-event .flex--wrap {
|
86 |
+
flex-wrap: wrap;
|
87 |
+
}
|
88 |
+
.embedpress-event .flex--row {
|
89 |
+
align-items: center;
|
90 |
+
box-sizing: border-box;
|
91 |
+
display: flex;
|
92 |
+
justify-content: flex-start;
|
93 |
+
flex-direction: row;
|
94 |
+
flex-wrap: nowrap;
|
95 |
+
}
|
96 |
+
.embedpress-event .flex-item {
|
97 |
+
flex-basis: 0;
|
98 |
+
flex-grow: 1;
|
99 |
+
width: auto;
|
100 |
+
min-width: 0;
|
101 |
+
/*padding-left: 16px;*/
|
102 |
+
box-sizing: border-box;
|
103 |
+
}
|
104 |
+
.embedpress-event .flex-item--shrink {
|
105 |
+
flex-basis: auto;
|
106 |
+
-webkit-box-flex: 0;
|
107 |
+
flex-grow: 0;
|
108 |
+
flex-shrink: 0;
|
109 |
+
width: auto;
|
110 |
+
}
|
111 |
+
.embedpress-event .flex--row > .flex-item:first-child {
|
112 |
+
padding-left: 0;
|
113 |
+
}
|
114 |
+
.embedpress-event .text--bold {
|
115 |
+
font-weight: 700;
|
116 |
+
}
|
117 |
+
|
118 |
+
.embedpress-event h1, h2, h3, h4, h5, h6{
|
119 |
+
font-size: inherit;
|
120 |
+
}
|
121 |
+
|
122 |
+
.embedpress-event .ep-event--title {
|
123 |
+
font-size: 32px;
|
124 |
+
font-weight: 700;
|
125 |
+
}
|
126 |
+
|
127 |
+
.embedpress-event .ep-event--date {
|
128 |
+
color: #757575 ;
|
129 |
+
font-weight: 400;
|
130 |
+
font-size: 16px;
|
131 |
+
}
|
132 |
+
|
133 |
+
/*Host*/
|
134 |
+
.embedpress-event .ep-event--host {
|
135 |
+
margin-top: 20px ;
|
136 |
+
display: flex;
|
137 |
+
align-items: center;
|
138 |
+
margin-bottom: 20px;
|
139 |
+
}
|
140 |
+
|
141 |
+
.ep-event--host .avatar-print {
|
142 |
+
border-radius: 50%;
|
143 |
+
height: 50px;
|
144 |
+
width: 50px;
|
145 |
+
}
|
146 |
+
|
147 |
+
.embedpress-event img.avatar--person {
|
148 |
+
background-image: none !important;
|
149 |
+
background-repeat: no-repeat;
|
150 |
+
background-position: 50%;
|
151 |
+
background-size: cover;
|
152 |
+
border-radius: 50%;
|
153 |
+
box-sizing: border-box;
|
154 |
+
vertical-align: middle;
|
155 |
+
}
|
156 |
+
|
157 |
+
.event-info-hosts-text {
|
158 |
+
padding-left: 20px;
|
159 |
+
font-size: 16px;
|
160 |
+
font-weight: 400;
|
161 |
+
}
|
162 |
+
.embedpress-event .event-description {
|
163 |
+
margin-top: 20px;
|
164 |
+
}
|
165 |
+
.text--sectionTitle {
|
166 |
+
font-size: 20px;
|
167 |
+
line-height: 28px;
|
168 |
+
}
|
169 |
+
|
170 |
+
.ep-event--attendees {
|
171 |
+
margin-top: 50px;
|
172 |
+
}
|
173 |
+
.ep-event--attendees > .flex {
|
174 |
+
margin-bottom: 20px;
|
175 |
+
}
|
176 |
+
.ep-event--attendees .gridList {
|
177 |
+
list-style: none;
|
178 |
+
margin: 0 -16px 0 0;
|
179 |
+
padding: 0;
|
180 |
+
}
|
181 |
+
.ep-event--attendees .gridList-item {
|
182 |
+
width: auto;
|
183 |
+
}
|
184 |
+
.ep-event--attendees .gridList--autoHeight--has4>.gridList-item {
|
185 |
+
flex: 0 0 50%;
|
186 |
+
max-width: 50%;
|
187 |
+
}
|
188 |
+
.ep-event--attendees .groupMember-name {
|
189 |
+
line-height: 1.2 !important;
|
190 |
+
}
|
191 |
+
.ep-event--attendees .avatar--person {
|
192 |
+
margin-bottom: 15px;
|
193 |
+
display: inline-block;
|
194 |
+
border-radius: 50%;
|
195 |
+
}
|
196 |
+
.ep-event--attendees img.avatar-print {
|
197 |
+
border-radius: 50%;
|
198 |
+
}
|
199 |
+
.ep-event--attendees .groupMember-role {
|
200 |
+
font-size: 12px;
|
201 |
+
color: #757575;
|
202 |
+
padding-top: 2px;
|
203 |
+
margin: 0;
|
204 |
+
}
|
205 |
+
.ep-event--attendees .groupMember {
|
206 |
+
min-height: 100%;
|
207 |
+
min-width: 128px;
|
208 |
+
padding-left: 8px;
|
209 |
+
padding-right: 8px;
|
210 |
+
}
|
211 |
+
.embedpress-event .align--center{
|
212 |
+
text-align: center;
|
213 |
+
}
|
214 |
+
.embedpress-event .card {
|
215 |
+
background: #fff;
|
216 |
+
background-clip: padding-box;
|
217 |
+
background-size: cover;
|
218 |
+
border: 1px solid rgba(46,62,72,.12);
|
219 |
+
border-radius: 8px;
|
220 |
+
-webkit-box-sizing: border-box;
|
221 |
+
box-sizing: border-box;
|
222 |
+
display: block;
|
223 |
+
min-height: 100%;
|
224 |
+
padding: 16px 16px 18px;
|
225 |
+
position: relative;
|
226 |
+
white-space: normal;
|
227 |
+
}
|
228 |
+
.embedpress-event .card--hasHoverShadow {
|
229 |
+
transition: box-shadow .25s cubic-bezier(.4,0,.2,1),transform .25s cubic-bezier(.4,0,.2,1);
|
230 |
+
}
|
231 |
+
.embedpress-event .ep-event-group-link {
|
232 |
+
display: flex;
|
233 |
+
flex-wrap: wrap;
|
234 |
+
align-items: center;
|
235 |
+
background: #ffffff;
|
236 |
+
border-radius: 8px;
|
237 |
+
padding: 20px;
|
238 |
+
margin-bottom: 20px;
|
239 |
+
border: 1px solid rgba(46,62,72,.12);
|
240 |
+
}
|
241 |
+
.embedpress-event .ep-event-group--name {
|
242 |
+
padding-left: 20px;
|
243 |
+
font-size: 14px;
|
244 |
+
line-height: 1.45;
|
245 |
+
margin: 0;
|
246 |
+
width: 70%;
|
247 |
+
word-break: break-word;
|
248 |
+
}
|
249 |
+
.embedpress-event .ep-event-group--image {
|
250 |
+
-o-object-fit: cover;
|
251 |
+
object-fit: cover;
|
252 |
+
width: 56px;
|
253 |
+
height: 56px;
|
254 |
+
border-radius: 4px;
|
255 |
+
}
|
256 |
+
.embedpress-event .ep-event-time-location {
|
257 |
+
background: #ffffff;
|
258 |
+
border-radius: 8px;
|
259 |
+
padding: 16px 20px 0 20px;
|
260 |
+
border: 1px solid rgba(46,62,72,.12);
|
261 |
+
}
|
262 |
+
.embedpress-event .ep-event-time-location .ep-event-datetime,
|
263 |
+
.embedpress-event .ep-event-time-location .ep-event-location {
|
264 |
+
padding-bottom: 20px;
|
265 |
+
}
|
266 |
+
.embedpress-event .ep-event-location .wrap--singleLine--truncate,
|
267 |
+
.embedpress-event .ep-event-time-location .ep-event-datetime {
|
268 |
+
font-size: 15px;
|
269 |
+
line-height: 1.5;
|
270 |
+
color: #2e3e48;
|
271 |
+
font-style: normal;
|
272 |
+
margin: 0;
|
273 |
+
}
|
274 |
+
.embedpress-event .ep-event-location address {
|
275 |
+
font-style: normal;
|
276 |
+
margin: 0;
|
277 |
+
}
|
278 |
+
.embedpress-event .ep-event-location .venueDisplay-venue-address {
|
279 |
+
font-style: normal;
|
280 |
+
color: #757575;
|
281 |
+
margin: 0;
|
282 |
+
}
|
283 |
+
.embedpress-event .ep-event-location p {
|
284 |
+
line-height: 20px;
|
285 |
+
}
|
286 |
+
.ep-event--attendees .gridList-item {
|
287 |
+
-webkit-box-sizing: border-box;
|
288 |
+
box-sizing: border-box;
|
289 |
+
display: inline-block;
|
290 |
+
font-size: 1rem;
|
291 |
+
margin: 0;
|
292 |
+
vertical-align: top;
|
293 |
+
width: 50%;
|
294 |
+
}
|
295 |
+
.gridList-itemInner {
|
296 |
+
-webkit-box-sizing: border-box;
|
297 |
+
box-sizing: border-box;
|
298 |
+
height: 100%;
|
299 |
+
padding: 0 16px 16px 0;
|
300 |
+
}
|
301 |
+
|
302 |
+
@media only screen and (min-width: 530px) {
|
303 |
+
.ep-event--attendees .gridList--autoHeight--has4>.gridList-item {
|
304 |
+
flex: 0 0 33.333333%;
|
305 |
+
max-width: 33.333333%;
|
306 |
+
}
|
307 |
+
}
|
308 |
+
@media only screen and (min-width: 640px){
|
309 |
+
.embedpress-event .card {
|
310 |
+
padding: 18px 18px 20px;
|
311 |
+
}
|
312 |
+
.ep-event--attendees .gridList--autoHeight--has4>.gridList-item {
|
313 |
+
flex: 0 0 25%;
|
314 |
+
max-width: 25%;
|
315 |
+
}
|
316 |
+
}
|
317 |
+
/*End meetup*/
|
assets/css/embedpress.css
CHANGED
@@ -133,4 +133,259 @@
|
|
133 |
.elementor-widget-container iframe {
|
134 |
max-height: 100% !important;
|
135 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
}
|
133 |
.elementor-widget-container iframe {
|
134 |
max-height: 100% !important;
|
135 |
}
|
136 |
+
}
|
137 |
+
|
138 |
+
/*Meetup Event styling starts */
|
139 |
+
.embedpress-event .link {
|
140 |
+
color: #0098ab ;
|
141 |
+
}
|
142 |
+
.embedpress-event .visibility--a11yHide {
|
143 |
+
border: 0;
|
144 |
+
clip: rect(0 0 0 0);
|
145 |
+
position: absolute;
|
146 |
+
overflow: hidden;
|
147 |
+
margin: -1px;
|
148 |
+
padding: 0;
|
149 |
+
width: 1px;
|
150 |
+
height: 1px;
|
151 |
+
}
|
152 |
+
.embedpress-event .text--small {
|
153 |
+
font-size: 14px;
|
154 |
+
margin: 0;
|
155 |
+
}
|
156 |
+
.embedpress-event .flex {
|
157 |
+
display: flex;
|
158 |
+
box-sizing: border-box;
|
159 |
+
}
|
160 |
+
.embedpress-event .flex--wrap {
|
161 |
+
flex-wrap: wrap;
|
162 |
+
}
|
163 |
+
.embedpress-event .flex--row {
|
164 |
+
align-items: center;
|
165 |
+
box-sizing: border-box;
|
166 |
+
display: flex;
|
167 |
+
justify-content: flex-start;
|
168 |
+
flex-direction: row;
|
169 |
+
flex-wrap: nowrap;
|
170 |
+
}
|
171 |
+
.embedpress-event .flex-item {
|
172 |
+
flex-basis: 0;
|
173 |
+
flex-grow: 1;
|
174 |
+
width: auto;
|
175 |
+
min-width: 0;
|
176 |
+
/*padding-left: 16px;*/
|
177 |
+
box-sizing: border-box;
|
178 |
+
}
|
179 |
+
.embedpress-event .flex-item--shrink {
|
180 |
+
flex-basis: auto;
|
181 |
+
-webkit-box-flex: 0;
|
182 |
+
flex-grow: 0;
|
183 |
+
flex-shrink: 0;
|
184 |
+
width: auto;
|
185 |
+
}
|
186 |
+
.embedpress-event .flex--row > .flex-item:first-child {
|
187 |
+
padding-left: 0;
|
188 |
+
}
|
189 |
+
.embedpress-event .text--bold {
|
190 |
+
font-weight: 700;
|
191 |
+
}
|
192 |
+
|
193 |
+
.embedpress-event h1, h2, h3, h4, h5, h6{
|
194 |
+
font-size: inherit;
|
195 |
+
}
|
196 |
+
|
197 |
+
.embedpress-event .ep-event--title {
|
198 |
+
font-size: 32px;
|
199 |
+
font-weight: 700;
|
200 |
+
}
|
201 |
+
|
202 |
+
.embedpress-event .ep-event--date {
|
203 |
+
color: #757575 ;
|
204 |
+
font-weight: 400;
|
205 |
+
font-size: 16px;
|
206 |
+
}
|
207 |
+
|
208 |
+
/*Host*/
|
209 |
+
.embedpress-event .ep-event--host {
|
210 |
+
margin-top: 20px ;
|
211 |
+
display: flex;
|
212 |
+
align-items: center;
|
213 |
+
margin-bottom: 20px;
|
214 |
+
}
|
215 |
+
|
216 |
+
.ep-event--host .avatar-print {
|
217 |
+
border-radius: 50%;
|
218 |
+
height: 50px;
|
219 |
+
width: 50px;
|
220 |
+
}
|
221 |
+
|
222 |
+
.embedpress-event img.avatar--person {
|
223 |
+
background-image: none !important;
|
224 |
+
background-repeat: no-repeat;
|
225 |
+
background-position: 50%;
|
226 |
+
background-size: cover;
|
227 |
+
border-radius: 50%;
|
228 |
+
box-sizing: border-box;
|
229 |
+
vertical-align: middle;
|
230 |
+
}
|
231 |
+
|
232 |
+
.event-info-hosts-text {
|
233 |
+
padding-left: 20px;
|
234 |
+
font-size: 16px;
|
235 |
+
font-weight: 400;
|
236 |
+
}
|
237 |
+
.embedpress-event .event-description {
|
238 |
+
margin-top: 20px;
|
239 |
+
}
|
240 |
+
.text--sectionTitle {
|
241 |
+
font-size: 20px;
|
242 |
+
line-height: 28px;
|
243 |
+
}
|
244 |
+
|
245 |
+
.ep-event--attendees {
|
246 |
+
margin-top: 50px;
|
247 |
+
}
|
248 |
+
.ep-event--attendees > .flex {
|
249 |
+
margin-bottom: 20px;
|
250 |
+
}
|
251 |
+
.ep-event--attendees .gridList {
|
252 |
+
list-style: none;
|
253 |
+
margin: 0 -16px 0 0;
|
254 |
+
padding: 0;
|
255 |
+
}
|
256 |
+
.ep-event--attendees .gridList-item {
|
257 |
+
width: auto;
|
258 |
+
}
|
259 |
+
.ep-event--attendees .gridList--autoHeight--has4>.gridList-item {
|
260 |
+
flex: 0 0 50%;
|
261 |
+
max-width: 50%;
|
262 |
+
}
|
263 |
+
.ep-event--attendees .groupMember-name {
|
264 |
+
line-height: 1.2 !important;
|
265 |
+
}
|
266 |
+
.ep-event--attendees .avatar--person {
|
267 |
+
margin-bottom: 15px;
|
268 |
+
display: inline-block;
|
269 |
+
border-radius: 50%;
|
270 |
+
}
|
271 |
+
.ep-event--attendees img.avatar-print {
|
272 |
+
border-radius: 50%;
|
273 |
+
}
|
274 |
+
.ep-event--attendees .groupMember-role {
|
275 |
+
font-size: 12px;
|
276 |
+
color: #757575;
|
277 |
+
padding-top: 2px;
|
278 |
+
margin: 0;
|
279 |
+
}
|
280 |
+
.ep-event--attendees .groupMember {
|
281 |
+
min-height: 100%;
|
282 |
+
min-width: 128px;
|
283 |
+
padding-left: 8px;
|
284 |
+
padding-right: 8px;
|
285 |
+
}
|
286 |
+
.embedpress-event .align--center{
|
287 |
+
text-align: center;
|
288 |
+
}
|
289 |
+
.embedpress-event .card {
|
290 |
+
background: #fff;
|
291 |
+
background-clip: padding-box;
|
292 |
+
background-size: cover;
|
293 |
+
border: 1px solid rgba(46,62,72,.12);
|
294 |
+
border-radius: 8px;
|
295 |
+
-webkit-box-sizing: border-box;
|
296 |
+
box-sizing: border-box;
|
297 |
+
display: block;
|
298 |
+
min-height: 100%;
|
299 |
+
padding: 16px 16px 18px;
|
300 |
+
position: relative;
|
301 |
+
white-space: normal;
|
302 |
+
}
|
303 |
+
.embedpress-event .card--hasHoverShadow {
|
304 |
+
transition: box-shadow .25s cubic-bezier(.4,0,.2,1),transform .25s cubic-bezier(.4,0,.2,1);
|
305 |
+
}
|
306 |
+
.embedpress-event .ep-event-group-link {
|
307 |
+
display: flex;
|
308 |
+
flex-wrap: wrap;
|
309 |
+
align-items: center;
|
310 |
+
background: #ffffff;
|
311 |
+
border-radius: 8px;
|
312 |
+
padding: 20px;
|
313 |
+
margin-bottom: 20px;
|
314 |
+
border: 1px solid rgba(46,62,72,.12);
|
315 |
+
}
|
316 |
+
.embedpress-event .ep-event-group--name {
|
317 |
+
padding-left: 20px;
|
318 |
+
font-size: 14px;
|
319 |
+
line-height: 1.45;
|
320 |
+
margin: 0;
|
321 |
+
width: 70%;
|
322 |
+
word-break: break-word;
|
323 |
+
}
|
324 |
+
.embedpress-event .ep-event-group--image {
|
325 |
+
-o-object-fit: cover;
|
326 |
+
object-fit: cover;
|
327 |
+
width: 56px;
|
328 |
+
height: 56px;
|
329 |
+
border-radius: 4px;
|
330 |
+
}
|
331 |
+
.embedpress-event .ep-event-time-location {
|
332 |
+
background: #ffffff;
|
333 |
+
border-radius: 8px;
|
334 |
+
padding: 16px 20px 0 20px;
|
335 |
+
border: 1px solid rgba(46,62,72,.12);
|
336 |
+
}
|
337 |
+
.embedpress-event .ep-event-time-location .ep-event-datetime,
|
338 |
+
.embedpress-event .ep-event-time-location .ep-event-location {
|
339 |
+
padding-bottom: 20px;
|
340 |
+
}
|
341 |
+
.embedpress-event .ep-event-location .wrap--singleLine--truncate,
|
342 |
+
.embedpress-event .ep-event-time-location .ep-event-datetime {
|
343 |
+
font-size: 15px;
|
344 |
+
line-height: 1.5;
|
345 |
+
color: #2e3e48;
|
346 |
+
font-style: normal;
|
347 |
+
margin: 0;
|
348 |
+
}
|
349 |
+
.embedpress-event .ep-event-location address {
|
350 |
+
font-style: normal;
|
351 |
+
margin: 0;
|
352 |
+
}
|
353 |
+
.embedpress-event .ep-event-location .venueDisplay-venue-address {
|
354 |
+
font-style: normal;
|
355 |
+
color: #757575;
|
356 |
+
margin: 0;
|
357 |
+
}
|
358 |
+
.embedpress-event .ep-event-location p {
|
359 |
+
line-height: 20px;
|
360 |
+
}
|
361 |
+
.ep-event--attendees .gridList-item {
|
362 |
+
-webkit-box-sizing: border-box;
|
363 |
+
box-sizing: border-box;
|
364 |
+
display: inline-block;
|
365 |
+
font-size: 1rem;
|
366 |
+
margin: 0;
|
367 |
+
vertical-align: top;
|
368 |
+
width: 50%;
|
369 |
+
}
|
370 |
+
.gridList-itemInner {
|
371 |
+
-webkit-box-sizing: border-box;
|
372 |
+
box-sizing: border-box;
|
373 |
+
height: 100%;
|
374 |
+
padding: 0 16px 16px 0;
|
375 |
+
}
|
376 |
+
|
377 |
+
@media only screen and (min-width: 530px) {
|
378 |
+
.ep-event--attendees .gridList--autoHeight--has4>.gridList-item {
|
379 |
+
flex: 0 0 33.333333%;
|
380 |
+
max-width: 33.333333%;
|
381 |
+
}
|
382 |
+
}
|
383 |
+
@media only screen and (min-width: 640px){
|
384 |
+
.embedpress-event .card {
|
385 |
+
padding: 18px 18px 20px;
|
386 |
+
}
|
387 |
+
.ep-event--attendees .gridList--autoHeight--has4>.gridList-item {
|
388 |
+
flex: 0 0 25%;
|
389 |
+
max-width: 25%;
|
390 |
+
}
|
391 |
}
|
assets/js/preview.js
CHANGED
@@ -48,8 +48,8 @@
|
|
48 |
|
49 |
if (!!Object.keys(attributes).length) {
|
50 |
var parsedAttributes = [];
|
51 |
-
for (var
|
52 |
-
parsedAttributes.push(
|
53 |
}
|
54 |
|
55 |
subject = '[' + shortcode + ' ' + parsedAttributes.join(' ') + ']' + subject.stripShortcode(shortcode) + '[/' + shortcode + ']';
|
48 |
|
49 |
if (!!Object.keys(attributes).length) {
|
50 |
var parsedAttributes = [];
|
51 |
+
for (var ats in attributes) {
|
52 |
+
parsedAttributes.push(ats + '="' + attributes[ats] + '"');
|
53 |
}
|
54 |
|
55 |
subject = '[' + shortcode + ' ' + parsedAttributes.join(' ') + ']' + subject.stripShortcode(shortcode) + '[/' + shortcode + ']';
|
embedpress.php
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
* Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad 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.net
|
8 |
-
* Version: 3.0
|
9 |
* Text Domain: embedpress
|
10 |
* Domain Path: /languages
|
11 |
*
|
@@ -47,37 +47,11 @@ include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
|
47 |
if ( ! defined('EMBEDPRESS_IS_LOADED')) {
|
48 |
return;
|
49 |
}
|
50 |
-
function is_embedpress_pro_active() {
|
51 |
-
if ( ! function_exists( 'is_plugin_active') ) {
|
52 |
-
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
53 |
-
}
|
54 |
|
55 |
-
return is_plugin_active('embedpress-pro/embedpress-pro.php');
|
56 |
-
}
|
57 |
|
58 |
-
|
59 |
-
|
60 |
-
* @return false|mixed
|
61 |
-
*/
|
62 |
-
function get_embedpress_pro_version() {
|
63 |
-
if ( is_embedpress_pro_active() ) {
|
64 |
-
$p = wp_get_active_and_valid_plugins();
|
65 |
-
$p = array_filter( $p, function ( $plugin){
|
66 |
-
return !empty( strpos( $plugin, 'embedpress-pro'));
|
67 |
-
});
|
68 |
-
$p = array_values( $p);
|
69 |
-
if ( !empty( $p[0]) ) {
|
70 |
-
$d = get_plugin_data($p[0]);
|
71 |
-
if ( isset( $d['Version']) ) {
|
72 |
-
return $d['Version'];
|
73 |
-
}
|
74 |
-
return false;
|
75 |
-
}
|
76 |
-
return false;
|
77 |
-
}
|
78 |
-
return false;
|
79 |
|
80 |
-
}
|
81 |
|
82 |
function onPluginActivationCallback()
|
83 |
{
|
@@ -93,18 +67,18 @@ register_activation_hook(__FILE__, 'onPluginActivationCallback');
|
|
93 |
register_deactivation_hook(__FILE__, 'onPluginDeactivationCallback');
|
94 |
|
95 |
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
|
106 |
-
|
107 |
-
|
108 |
|
109 |
|
110 |
if ( is_plugin_active('elementor/elementor.php')) {
|
@@ -113,3 +87,25 @@ if ( is_plugin_active('elementor/elementor.php')) {
|
|
113 |
}
|
114 |
|
115 |
Shortcode::register();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
* Description: EmbedPress lets you embed videos, images, posts, audio, maps and uplaoad 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.net
|
8 |
+
* Version: 3.1.0
|
9 |
* Text Domain: embedpress
|
10 |
* Domain Path: /languages
|
11 |
*
|
47 |
if ( ! defined('EMBEDPRESS_IS_LOADED')) {
|
48 |
return;
|
49 |
}
|
|
|
|
|
|
|
|
|
50 |
|
|
|
|
|
51 |
|
52 |
+
add_action( 'embedpress_cache_cleanup_action', 'embedpress_cache_cleanup' );
|
53 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
|
|
|
55 |
|
56 |
function onPluginActivationCallback()
|
57 |
{
|
67 |
register_deactivation_hook(__FILE__, 'onPluginDeactivationCallback');
|
68 |
|
69 |
|
70 |
+
add_action( 'plugins_loaded', function() {
|
71 |
+
do_action( 'embedpress_before_init' );
|
72 |
+
} );
|
73 |
+
$editor_check = get_option('classic-editor-replace');
|
74 |
+
if ((Compatibility::isWordPress5() && ! Compatibility::isClassicalEditorActive()) || (Compatibility::isClassicalEditorActive() && 'block'=== $editor_check )) {
|
75 |
+
$embedPressPlugin = new Core();
|
76 |
+
} else {
|
77 |
+
$embedPressPlugin = new CoreLegacy();
|
78 |
+
}
|
79 |
|
80 |
+
$embedPressPlugin->initialize();
|
81 |
+
new Feature_Enhancer();
|
82 |
|
83 |
|
84 |
if ( is_plugin_active('elementor/elementor.php')) {
|
87 |
}
|
88 |
|
89 |
Shortcode::register();
|
90 |
+
|
91 |
+
|
92 |
+
if ( !class_exists( '\simple_html_dom') ) {
|
93 |
+
include_once EMBEDPRESS_PATH_CORE . 'simple_html_dom.php';
|
94 |
+
}
|
95 |
+
|
96 |
+
//@todo; cleanup after testing
|
97 |
+
//add_action( 'after_setup_theme', function (){
|
98 |
+
//
|
99 |
+
// add_filter( 'editor_stylesheets', function ( $stylesheets ) {
|
100 |
+
// $stylesheets[] = plugins_url( 'embedpress/assets/css/addons.css' );
|
101 |
+
// error_log( print_r( $stylesheets, 1));
|
102 |
+
//
|
103 |
+
// return $stylesheets;
|
104 |
+
// });
|
105 |
+
//});
|
106 |
+
//add_action( 'init', function () {
|
107 |
+
// add_theme_support( 'editor-style' );
|
108 |
+
//
|
109 |
+
// $url = plugins_url( 'embedpress/assets/css/addons.css' );
|
110 |
+
// add_editor_style($url );
|
111 |
+
//});
|
includes.php
CHANGED
@@ -22,7 +22,7 @@ if ( ! defined('EMBEDPRESS_PLG_NAME')) {
|
|
22 |
}
|
23 |
|
24 |
if ( ! defined('EMBEDPRESS_VERSION')) {
|
25 |
-
define('EMBEDPRESS_VERSION', "3.0
|
26 |
/**
|
27 |
* @deprecated 2.2.0
|
28 |
*/
|
@@ -69,10 +69,57 @@ if ( ! defined('EMBEDPRESS_LICENSES_API_URL')) {
|
|
69 |
if ( ! defined('EMBEDPRESS_LICENSES_MORE_INFO_URL')) {
|
70 |
define('EMBEDPRESS_LICENSES_MORE_INFO_URL', "https://embedpress.com/docs/activate-license");
|
71 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
|
|
|
|
|
|
|
|
|
|
73 |
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
74 |
require_once __DIR__ . '/vendor/autoload.php';
|
75 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
76 |
// Run the plugin autoload script
|
77 |
if ( ! defined('EMBEDPRESS_IS_LOADED')) {
|
78 |
require_once EMBEDPRESS_PATH_BASE . "autoloader.php";
|
@@ -80,3 +127,4 @@ if ( ! defined('EMBEDPRESS_IS_LOADED')) {
|
|
80 |
|
81 |
// Includes the Gutenberg blocks for EmbedPress
|
82 |
require_once __DIR__ . '/Gutenberg/plugin.php';
|
|
22 |
}
|
23 |
|
24 |
if ( ! defined('EMBEDPRESS_VERSION')) {
|
25 |
+
define('EMBEDPRESS_VERSION', "3.1.0");
|
26 |
/**
|
27 |
* @deprecated 2.2.0
|
28 |
*/
|
69 |
if ( ! defined('EMBEDPRESS_LICENSES_MORE_INFO_URL')) {
|
70 |
define('EMBEDPRESS_LICENSES_MORE_INFO_URL', "https://embedpress.com/docs/activate-license");
|
71 |
}
|
72 |
+
function embedpress_cache_cleanup( ){
|
73 |
+
$dirname = wp_get_upload_dir()['basedir'].'/embedpress';
|
74 |
+
if ( file_exists( $dirname) ) {
|
75 |
+
$files = glob($dirname.'/*');
|
76 |
+
//@TODO; delete files only those start with 'mu_'
|
77 |
+
foreach($files as $file) {
|
78 |
+
if(is_file($file))
|
79 |
+
unlink($file);
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
|
84 |
+
function embedpress_schedule_cache_cleanup( ){
|
85 |
+
if ( ! wp_next_scheduled( 'embedpress_cache_cleanup_action' ) ) {
|
86 |
+
wp_schedule_event( time(), 'daily', 'embedpress_cache_cleanup_action' );
|
87 |
+
}
|
88 |
+
}
|
89 |
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
|
90 |
require_once __DIR__ . '/vendor/autoload.php';
|
91 |
}
|
92 |
+
function is_embedpress_pro_active() {
|
93 |
+
if ( ! function_exists( 'is_plugin_active') ) {
|
94 |
+
include_once ABSPATH . 'wp-admin/includes/plugin.php';
|
95 |
+
}
|
96 |
+
|
97 |
+
return is_plugin_active('embedpress-pro/embedpress-pro.php');
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Get the version of the currently activated embedpress pro plugin dynamically
|
102 |
+
* @return false|mixed
|
103 |
+
*/
|
104 |
+
function get_embedpress_pro_version() {
|
105 |
+
if ( is_embedpress_pro_active() ) {
|
106 |
+
$p = wp_get_active_and_valid_plugins();
|
107 |
+
$p = array_filter( $p, function ( $plugin){
|
108 |
+
return !empty( strpos( $plugin, 'embedpress-pro'));
|
109 |
+
});
|
110 |
+
$p = array_values( $p);
|
111 |
+
if ( !empty( $p[0]) ) {
|
112 |
+
$d = get_plugin_data($p[0]);
|
113 |
+
if ( isset( $d['Version']) ) {
|
114 |
+
return $d['Version'];
|
115 |
+
}
|
116 |
+
return false;
|
117 |
+
}
|
118 |
+
return false;
|
119 |
+
}
|
120 |
+
return false;
|
121 |
+
|
122 |
+
}
|
123 |
// Run the plugin autoload script
|
124 |
if ( ! defined('EMBEDPRESS_IS_LOADED')) {
|
125 |
require_once EMBEDPRESS_PATH_BASE . "autoloader.php";
|
127 |
|
128 |
// Includes the Gutenberg blocks for EmbedPress
|
129 |
require_once __DIR__ . '/Gutenberg/plugin.php';
|
130 |
+
|
readme.txt
CHANGED
@@ -4,9 +4,9 @@ Author: WPDeveloper
|
|
4 |
Author URI: https://wpdeveloper.net
|
5 |
Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, block editor, embed wordpress, elementor
|
6 |
Requires at least: 4.6
|
7 |
-
Tested up to: 5.
|
8 |
Requires PHP: 5.6
|
9 |
-
Stable tag: 3.0
|
10 |
License: GPLv3 or later
|
11 |
License URI: https://opensource.org/licenses/GPL-3.0
|
12 |
|
@@ -301,6 +301,13 @@ Not at all. You can set up everything your team needs without any coding knowled
|
|
301 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
302 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
= [3.0.4] - 2021-06-23 =
|
305 |
* Added: Shortcode feature for all editor
|
306 |
* Added: Boomplay Single track support
|
4 |
Author URI: https://wpdeveloper.net
|
5 |
Tags: embed, embed youtube, gutenberg embed, pdf, doc, docs, ppt, elementor embed, video embed, Google Doc, map embed, youTube Embed, content embed, iframes, vimeo embed, wistia, google sheet, youtube player, block editor, embed wordpress, elementor
|
6 |
Requires at least: 4.6
|
7 |
+
Tested up to: 5.8
|
8 |
Requires PHP: 5.6
|
9 |
+
Stable tag: 3.1.0
|
10 |
License: GPLv3 or later
|
11 |
License URI: https://opensource.org/licenses/GPL-3.0
|
12 |
|
301 |
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
302 |
and this project adheres to [Semantic Versioning](http://semver.org/).
|
303 |
|
304 |
+
= [3.1.0] - 2021-07-19 =
|
305 |
+
* Added: SoundCloud and DailyMotion in option menu.
|
306 |
+
* Fixed: Meetup Embed.
|
307 |
+
* Fixed: EP undefined,copy paste error in Elementor visual Editor.
|
308 |
+
* Separated: Free and Pro features in Elementor Editor.
|
309 |
+
* Few minor bug fix and improvements.
|
310 |
+
|
311 |
= [3.0.4] - 2021-06-23 =
|
312 |
* Added: Shortcode feature for all editor
|
313 |
* Added: Boomplay Single track support
|