PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents / 3.1.3
EmbedPress – PDF Embedder, 3D PDF FlipBook, Google Reviews, YouTube Videos, Upload & Embed PDF documents v3.1.3
4.6.5 4.6.4 4.6.3 4.6.2 4.6.1 4.6.0 4.5.6 4.5.5 4.5.4 4.5.3 4.5.2 trunk 1.0.0 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.7.0 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.2.0 2.2.1 2.2.2 2.3.0 2.3.1 2.3.2 2.3.3 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.6.0 2.6.1 2.6.2 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.2.0 3.2.1 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.0 3.4.1 3.4.2 3.4.3 3.5.0 3.5.1 3.5.2 3.5.3 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.7.0 3.7.1 3.7.2 3.7.3 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.10 3.9.11 3.9.12 3.9.13 3.9.14 3.9.15 3.9.16 3.9.17 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9 4.0.0 4.0.1 4.0.10 4.0.11 4.0.12 4.0.13 4.0.14 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.0.9 4.1.0 4.1.1 4.1.10 4.1.2 4.1.3 4.1.4 4.1.5 4.1.6 4.1.7 4.1.8 4.1.9 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.4.0 4.4.1 4.4.10 4.4.11 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5.0 4.5.1
embedpress / EmbedPress / Ends / Back / Settings / templates / custom-logo.php
embedpress / EmbedPress / Ends / Back / Settings / templates Last commit date
partials 5 years ago custom-logo.php 4 years ago dailymotion.php 5 years ago elements.php 5 years ago general.php 5 years ago go-premium.php 5 years ago license.php 5 years ago main-template.php 5 years ago shortcode.php 5 years ago soundcloud.php 5 years ago spotify.php 5 years ago twitch.php 5 years ago vimeo.php 5 years ago wistia.php 5 years ago youtube.php 5 years ago
custom-logo.php
220 lines
1 <?php
2 /*
3 * Custom Logo Settings page
4 * All undefined vars comes from 'render_settings_page' method
5 *
6 * */
7
8 $option_name = EMBEDPRESS_PLG_NAME.':youtube';
9 $yt_settings = get_option( $option_name);
10 $gen_settings = get_option( EMBEDPRESS_PLG_NAME);
11 $yt_logo_xpos = isset( $yt_settings['logo_xpos']) ? intval( $yt_settings['logo_xpos']) : 10;
12 $yt_logo_ypos = isset( $yt_settings['logo_ypos']) ? intval( $yt_settings['logo_ypos']) : 10;
13 $yt_logo_opacity = isset( $yt_settings['logo_opacity']) ? intval( $yt_settings['logo_opacity']) : 50;
14 $yt_logo_id = isset( $yt_settings['logo_id']) ? intval( $yt_settings['logo_id']) : 0;
15 $yt_logo_url = isset( $yt_settings['logo_url']) ? esc_url( $yt_settings['logo_url']) : '';
16 $yt_cta_url = isset( $yt_settings['cta_url']) ? esc_url( $yt_settings['cta_url']) : '';
17 $yt_branding = isset( $yt_settings['branding']) ? sanitize_text_field( $yt_settings['branding']) : (!empty( $yt_logo_url) ? 'yes': 'no');
18
19
20 $embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powered_by']) ? sanitize_text_field( $gen_settings['embedpress_document_powered_by']) : 'yes';
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;
27 $vm_logo_opacity = isset( $vm_settings['logo_opacity']) ? intval( $vm_settings['logo_opacity']) : 50;
28 $vm_logo_id = isset( $vm_settings['logo_id']) ? intval( $vm_settings['logo_id']) : 0;
29 $vm_logo_url = isset( $vm_settings['logo_url']) ? esc_url( $vm_settings['logo_url']) : '';
30 $vm_cta_url = isset( $vm_settings['cta_url']) ? esc_url( $vm_settings['cta_url']) : 'no';
31
32
33 ?>
34
35 <div class="embedpress__settings background__white radius-25 p40">
36 <h3><?php esc_html_e( "Global Branding Settings", "embedpress" ); ?></h3>
37 <div class="embedpress__settings__form">
38 <form action="" method="post" enctype="multipart/form-data" class="embedpress-settings-form">
39 <?php
40 do_action( 'embedpress_before_custom_branding_settings_fields');
41 echo $nonce_field ; ?>
42 <div class="form__group">
43 <p class="form__label">Powered by EmbedPress</p>
44 <div class="form__control__wrap">
45 <label class="input__switch switch__text">
46 <input type="checkbox" data-default="<?php echo esc_attr( $embedpress_document_powered_by ); ?>" data-value="<?php echo esc_attr( $embedpress_document_powered_by ); ?>" value="yes" name="embedpress_document_powered_by" <?php checked( 'yes', $embedpress_document_powered_by );?>>
47 <span></span>
48 </label>
49 </div>
50 </div>
51 <h3><?php esc_html_e( "Custom Logo", "embedpress" ); ?></h3>
52 <?php
53 embedpress_print_branding_controls('youtube', 'yt');
54 embedpress_print_branding_controls('vimeo', 'vm');
55 embedpress_print_branding_controls('wistia', 'wis');
56 embedpress_print_branding_controls('twitch', 'tw');
57 embedpress_print_branding_controls('dailymotion', 'dm');
58 embedpress_print_branding_controls('document', 'doc');
59 do_action( 'embedpress_after_custom_branding_settings_fields'); ?>
60 <button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="custom_logo"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
61 </form>
62 </div>
63 </div>
64
65
66 <?php
67 /**
68 * @param string $provider this is the provider name eg. youtube and vimeo etc. It should be lowercase generally or the same as the key we use to save data in the database. We save data like eg. EMBEDPRESS_PLG_NAME.':youtube'. Here youtube is the provider.
69 * @param string $prefix It is a prefix for field name eg. yt or vm etc.
70 */
71 function embedpress_print_branding_controls($provider='', $prefix='') {
72 global $pro_active;
73 $settings = get_option( EMBEDPRESS_PLG_NAME.':'.$provider, []);
74 $branding = isset( $settings['branding']) ? $settings['branding'] : 'no';
75 $logo_xpos = isset( $settings['logo_xpos']) ? intval( $settings['logo_xpos']) : 10;
76 $logo_ypos = isset( $settings['logo_ypos']) ? intval( $settings['logo_ypos']) : 10;
77 $logo_opacity = isset( $settings['logo_opacity']) ? intval( $settings['logo_opacity']) : 50;
78 $logo_id = isset( $settings['logo_id']) ? intval( $settings['logo_id']) : 0;
79 $logo_url = isset( $settings['logo_url']) ? esc_url( $settings['logo_url']) : '';
80 $cta_url = isset( $settings['cta_url']) ? esc_url( $settings['cta_url']) : '';
81
82 // prepare prefixed field name
83 $px_branding = "{$prefix}_branding";
84 $px_logo_xpos = "{$prefix}_logo_xpos";
85 $px_logo_ypos = "{$prefix}_logo_ypos";
86 $px_logo_opacity = "{$prefix}_logo_opacity";
87 $px_logo_id = "{$prefix}_logo_id";
88 $px_logo_url = "{$prefix}_logo_url";
89 $px_cta_url = "{$prefix}_cta_url";
90 switch ($provider){
91 case 'vimeo':
92 $preview_video = '<iframe loading="lazy" src="https://player.vimeo.com/video/463346733" frameborder="0"></iframe>';
93 break;
94 case 'wistia':
95
96 $preview_video=<<<KAMAL
97 <div class="ose-wistia--inc. ose-uid-0869333898f94a99ed20457fc4b79d88 ose-embedpress-responsive" style="width:500px; max-width:100%; height: 300px"><iframe loading="lazy" title="Best Embedding Solution For Elementor, Gutenberg &amp; Classic Editor - EmbedPress Video" src="https://fast.wistia.net/embed/iframe/u7eq83w1cg?dnt=1" allow="autoplay; fullscreen" allowtransparency="true" frameborder="0" scrolling="no" class="wistia_embed" name="wistia_embed" allowfullscreen msallowfullscreen width="500" height="300"></iframe><script src="https://fast.wistia.net/assets/external/E-v1.js" async></script></div>
98 KAMAL;
99
100 break;
101 case 'twitch':
102 $parent = wp_parse_url( site_url(), 1);
103 $preview_video = <<<KAMAL
104 <div class="embedpress_wrapper" data-url="https://www.twitch.tv/wpdeveloperdotnet" style="width:90%; height:360px;">
105 <iframe loading="lazy" src="https://embed.twitch.tv?autoplay=true&#038;channel=wpdeveloperdotnet&#038;height=360&#038;layout=video&#038;migration=true&#038;muted=false&#038;theme=dark&#038;time=0h0m0s&#038;video=&#038;width=600&#038;allowfullscreen=true&#038;parent={$parent}" allowfullscreen="" scrolling="no" frameborder="0" allow="autoplay; fullscreen" title="Twitch" sandbox="allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" ></iframe>
106 </div>
107 KAMAL;
108
109 break;
110 case 'dailymotion':
111 $parent = wp_parse_url( site_url(), 1);
112 $preview_video = <<<KAMAL
113 <div class="embedpress_wrapper" style="width:90%; height:360px;">
114 <iframe title="Sample video" frameborder="0" width="640" height="400" src="https://www.dailymotion.com/embed/video/x7qvzya?ui-highlight=dd3333&amp;start=0&amp;mute=0&amp;autoplay=0&amp;controls=1&amp;ui-start-screen-info=1&amp;endscreen-enable=0&amp;ui-logo=1" allowfullscreen="" allow="autoplay" loading="lazy" style="max-width: 100%; max-height: 400px;"></iframe>
115 </div>
116 KAMAL;
117
118 break;
119 case 'document':
120 $pdf_url = EMBEDPRESS_SETTINGS_ASSETS_URL . 'embedpress.pdf';
121 ob_start(); ?>
122
123 <div class="embedpress-embed-document-pdf ep-pdf-sample" style="width:500px; max-width:100%; height: 300px" data-emsrc="<?php echo esc_url( $pdf_url );?> "></div>';
124 <script src="<?php echo EMBEDPRESS_URL_ASSETS.'js/pdfobject.min.js'?>"></script>
125 <script>
126 (function ($) {
127 'use strict';
128 $(document).ready(function () {
129 var selector = $('.embedpress-embed-document-pdf');
130 let option = {
131 forceObject: false,
132 };
133 if (selector.length) {
134 PDFObject.embed("<?php echo $pdf_url; ?>", ".ep-pdf-sample", option);
135 }
136 });
137 })(jQuery);
138 </script>
139 <?php
140 $preview_video = ob_get_clean();
141 break;
142 default:
143 $preview_video = '<iframe height="300px" src="https://www.youtube.com/embed/2u0HRUdLHxo" frameborder="0"></iframe>';
144 break;
145 }
146 ?>
147 <div class="form__group">
148 <p class="form__label"><?php
149 printf( esc_html__( '%s Custom Branding', 'embedpress'), ucfirst( $provider));
150 echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?>
151 </p>
152 <div class="form__control__wrap">
153 <label class="input__switch switch__text <?php echo $pro_active ? '': 'isPro'; ?>">
154 <input type="checkbox" name="<?php echo esc_attr( $px_branding ); ?>" data-default="<?php echo esc_attr( $branding ); ?>" data-value="<?php echo esc_attr( $branding ); ?>" value="yes" <?php checked( 'yes', $branding);?> <?php echo $pro_active ? '': ' disabled'; ?>>
155 <span></span>
156 <a href="#" class="logo__adjust__toggler"><?php esc_html_e( "Settings", "embedpress" ); ?><i class="ep-icon ep-caret-down"></i></a>
157 </label>
158 <div class="logo__adjust__wrap <?php echo $pro_active ? '': 'proOverlay'; ?>" style="<?php if ( ('yes' !== $branding) || !$pro_active ) { echo 'display:none;'; } ?>">
159 <label class="logo__upload" id="yt_logo_upload_wrap" style="<?php if (!empty( $logo_url)) { echo 'display:none;'; } ?>">
160 <input type="hidden" class="preview__logo__input" name="<?php echo esc_attr( $px_logo_url ); ?>" id="<?php echo esc_attr( $px_logo_url ); ?>" data-default="<?php echo esc_attr( $logo_url ); ?>" value="<?php echo $logo_url; ?>">
161 <input type="hidden" class="preview__logo__input_id" name="<?php echo esc_attr( $px_logo_id ); ?>" id="<?php echo esc_attr( $px_logo_id ); ?>" data-default="<?php echo esc_attr( $logo_id ); ?>" value="<?php echo $logo_id; ?>">
162 <span class="icon"><i class="ep-icon ep-upload"></i></span>
163 <span class="text"><?php esc_html_e( "Click To Upload", "embedpress" ); ?></span>
164 </label>
165 <div class="logo__upload__preview" id="yt_logo__upload__preview" style="<?php if ( empty( $logo_url) ) { echo 'display:none'; } ?> ">
166 <div class="instant__preview">
167 <a href="#" id="yt_preview__remove" class="preview__remove"><i class="ep-icon ep-cross"></i></a>
168 <img class="instant__preview__img" id="yt_logo_preview" src="<?php echo $logo_url; ?>" alt="">
169 </div>
170 </div>
171
172 <div class="logo__adjust">
173 <div class="logo__adjust__controller">
174 <div class="logo__adjust__controller__item">
175 <span class="controller__label"><?php esc_html_e( "Logo Opacity (%)", "embedpress" ); ?></span>
176 <div class="logo__adjust__controller__inputs">
177 <input type="range" max="100" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>" class="opacity__range" name="<?php echo esc_attr( $px_logo_opacity )?>">
178 <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>">
179 </div>
180 </div>
181 <div class="logo__adjust__controller__item">
182 <span class="controller__label"><?php esc_html_e( "Logo X Position (%)", "embedpress" ); ?></span>
183 <div class="logo__adjust__controller__inputs">
184 <input type="range" max="100" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>" class="x__range" name="<?php echo esc_attr( $px_logo_xpos );?>">
185 <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>">
186 </div>
187 </div>
188 <div class="logo__adjust__controller__item">
189 <span class="controller__label"><?php esc_html_e( "Logo Y Position (%)", "embedpress" ); ?></span>
190 <div class="logo__adjust__controller__inputs">
191 <input type="range" max="100" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>" class="y__range" name="<?php echo esc_attr( $px_logo_ypos ); ?>" >
192 <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>">
193 </div>
194 </div>
195 <div class="logo__adjust__controller__item">
196 <label class="controller__label" for="yt_cta_url" ><?php esc_html_e( "Call to Action Link", "embedpress" );?> </label>
197 <div>
198 <input type="url" name="<?php echo esc_attr( $px_cta_url ); ?>" id="<?php echo esc_attr( $px_cta_url ); ?>" class="form__control" data-default="<?php echo esc_attr( $cta_url ); ?>" value="<?php echo esc_attr( $cta_url); ?>">
199
200 <p><?php esc_html_e( "You may link the logo to any CTA link.", "embedpress" ); ?></p>
201 </div>
202 </div>
203 </div>
204 <div class="logo__adjust__preview">
205 <span class="title"><?php esc_html_e( "Live Preview", "embedpress" ); ?></span>
206 <div class="preview__box">
207 <?php echo $preview_video ;?>
208 <img src="<?php echo $logo_url; ?>" class="preview__logo" style="bottom:<?php echo esc_attr( $logo_ypos); ?>%; right:<?php echo esc_attr( $logo_xpos); ?>%; opacity:<?php echo ($logo_opacity/100); ?>;" alt="">
209 </div>
210 </div>
211 </div>
212 </div>
213 <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
214
215 </div>
216 </div>
217
218 <?php
219 }
220 ?>