PluginProbe ʕ •ᴥ•ʔ
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more / 3.9.0
EmbedPress – PDF Embedder, Embed PDF viewer, YouTube Videos, 3D FlipBook, Social feeds & more v3.9.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 2 years ago calendly.php 2 years ago custom-logo.php 2 years ago dailymotion.php 4 years ago elements.php 2 years ago general.php 2 years ago go-premium.php 2 years ago google-calendar.php 2 years ago license.php 5 years ago main-template.php 5 years ago opensea.php 3 years ago premium.php 2 years ago shortcode.php 2 years ago soundcloud.php 4 years ago sources.php 2 years ago spotify.php 4 years ago twitch.php 4 years ago vimeo.php 3 years ago wistia.php 4 years ago youtube.php 3 years ago
custom-logo.php
210 lines
1 <?php
2 /*
3 * Custom Logo Settings page
4 * All undefined vars comes from 'render_settings_page' method
5 *
6 * */
7
8 use EmbedPress\Includes\Classes\Helper;
9
10 $option_name = EMBEDPRESS_PLG_NAME . ':youtube';
11 $yt_settings = get_option( $option_name);
12 $gen_settings = get_option( EMBEDPRESS_PLG_NAME);
13 $yt_logo_xpos = isset( $yt_settings['logo_xpos']) ? intval( $yt_settings['logo_xpos']) : 10;
14 $yt_logo_ypos = isset( $yt_settings['logo_ypos']) ? intval( $yt_settings['logo_ypos']) : 10;
15 $yt_logo_opacity = isset( $yt_settings['logo_opacity']) ? intval( $yt_settings['logo_opacity']) : 50;
16 $yt_logo_id = isset( $yt_settings['logo_id']) ? intval( $yt_settings['logo_id']) : 0;
17 $yt_logo_url = isset( $yt_settings['logo_url']) ? esc_url( $yt_settings['logo_url']) : '';
18 $yt_cta_url = isset( $yt_settings['cta_url']) ? esc_url( $yt_settings['cta_url']) : '';
19 $yt_branding = isset( $yt_settings['branding']) ? sanitize_text_field( $yt_settings['branding']) : (!empty( $yt_logo_url) ? 'yes': 'no');
20
21
22 $embedpress_document_powered_by = isset( $gen_settings['embedpress_document_powered_by']) ? sanitize_text_field( $gen_settings['embedpress_document_powered_by']) : 'yes';
23
24 // Vimeo branding
25 $vm_settings = get_option( EMBEDPRESS_PLG_NAME.':vimeo');
26 $vm_branding = isset( $vm_settings['branding']) ? sanitize_text_field( $vm_settings['branding']) : 'no';
27 $vm_logo_xpos = isset( $vm_settings['logo_xpos']) ? intval( $vm_settings['logo_xpos']) : 10;
28 $vm_logo_ypos = isset( $vm_settings['logo_ypos']) ? intval( $vm_settings['logo_ypos']) : 10;
29 $vm_logo_opacity = isset( $vm_settings['logo_opacity']) ? intval( $vm_settings['logo_opacity']) : 50;
30 $vm_logo_id = isset( $vm_settings['logo_id']) ? intval( $vm_settings['logo_id']) : 0;
31 $vm_logo_url = isset( $vm_settings['logo_url']) ? esc_url( $vm_settings['logo_url']) : '';
32 $vm_cta_url = isset( $vm_settings['cta_url']) ? esc_url( $vm_settings['cta_url']) : 'no';
33
34
35 ?>
36
37 <div class="embedpress__settings background__white radius-16 p-24">
38 <h3><?php esc_html_e( "Global Branding Settings", "embedpress" ); ?></h3>
39 <div class="embedpress__settings__form">
40 <form action="" method="post" enctype="multipart/form-data" class="embedpress-settings-form">
41 <?php
42 do_action( 'embedpress_before_custom_branding_settings_fields');
43 echo $nonce_field ; ?>
44 <div class="form__group">
45 <p class="form__label">Powered by EmbedPress</p>
46 <div class="form__control__wrap">
47 <label class="input__switch switch__text">
48 <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 );?>>
49 <span></span>
50 </label>
51 </div>
52 </div>
53 <h3><?php esc_html_e( "Custom Logo", "embedpress" ); ?></h3>
54 <?php
55 embedpress_print_branding_controls('youtube', 'yt');
56 embedpress_print_branding_controls('vimeo', 'vm');
57 embedpress_print_branding_controls('wistia', 'wis');
58 embedpress_print_branding_controls('twitch', 'tw');
59 embedpress_print_branding_controls('dailymotion', 'dm');
60 embedpress_print_branding_controls('document', 'doc');
61 do_action( 'embedpress_after_custom_branding_settings_fields');
62 ?>
63 <button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="custom_logo"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button>
64 </form>
65 </div>
66 </div>
67
68
69 <?php
70 /**
71 * @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.
72 * @param string $prefix It is a prefix for field name eg. yt or vm etc.
73 */
74 function embedpress_print_branding_controls($provider='', $prefix='') {
75 global $pro_active;
76 $settings = get_option( EMBEDPRESS_PLG_NAME.':'.$provider, []);
77 $branding = isset( $settings['branding']) ? $settings['branding'] : 'no';
78 $logo_xpos = isset( $settings['logo_xpos']) ? intval( $settings['logo_xpos']) : 10;
79 $logo_ypos = isset( $settings['logo_ypos']) ? intval( $settings['logo_ypos']) : 10;
80 $logo_opacity = isset( $settings['logo_opacity']) ? intval( $settings['logo_opacity']) : 50;
81 $logo_id = isset( $settings['logo_id']) ? intval( $settings['logo_id']) : 0;
82 $logo_url = isset( $settings['logo_url']) ? esc_url( $settings['logo_url']) : '';
83 $cta_url = isset( $settings['cta_url']) ? esc_url( $settings['cta_url']) : '';
84
85 // prepare prefixed field name
86 $px_branding = "{$prefix}_branding";
87 $px_logo_xpos = "{$prefix}_logo_xpos";
88 $px_logo_ypos = "{$prefix}_logo_ypos";
89 $px_logo_opacity = "{$prefix}_logo_opacity";
90 $px_logo_id = "{$prefix}_logo_id";
91 $px_logo_url = "{$prefix}_logo_url";
92 $px_cta_url = "{$prefix}_cta_url";
93 switch ($provider){
94 case 'vimeo':
95 $preview_video = '<iframe title="" loading="lazy" src="https://player.vimeo.com/video/463346733" frameborder="0"></iframe>';
96 break;
97 case 'wistia':
98
99 $preview_video=<<<KAMAL
100 <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>
101 KAMAL;
102
103 break;
104 case 'twitch':
105 $parent = wp_parse_url( site_url(), 1);
106 $preview_video = <<<KAMAL
107 <div class="embedpress_wrapper" data-url="https://www.twitch.tv/wpdeveloperdotnet" style="width:90%; height:360px;">
108 <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>
109 </div>
110 KAMAL;
111
112 break;
113 case 'dailymotion':
114 $parent = wp_parse_url( site_url(), 1);
115 $preview_video = <<<KAMAL
116 <div class="embedpress_wrapper" style="width:90%; height:360px;">
117 <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>
118 </div>
119 KAMAL;
120
121 break;
122 case 'document':
123 $pdf_url = EMBEDPRESS_SETTINGS_ASSETS_URL . 'embedpress.pdf';
124 $renderer = Helper::get_pdf_renderer();
125 $src = $renderer . ((strpos($renderer, '?') == false) ? '?' : '&') . 'file=' . urlencode($pdf_url);
126 ob_start(); ?>
127 <iframe class="embedpress-embed-document-pdf ep-pdf-sample" style="width:500px; max-width:100%; height: 300px; display: inline-block" src="<?php echo esc_attr( $src); ?>" ></iframe>
128 <?php
129 $preview_video = ob_get_clean();
130 break;
131 default:
132 $preview_video = '<iframe height="300px" src="https://www.youtube.com/embed/2u0HRUdLHxo" frameborder="0"></iframe>';
133 break;
134 }
135 ?>
136 <div class="form__group">
137 <p class="form__label"><?php
138 $provider_name = $provider === 'youtube' ? 'YouTube' : ucfirst( $provider);
139 printf( esc_html__( '%s Custom Branding', 'embedpress'), $provider_name);
140 echo $pro_active ? '': ' <span class="isPro">Pro</span>'; ?>
141 </p>
142 <div class="form__control__wrap">
143 <label class="input__switch switch__text <?php echo $pro_active ? '': 'isPro'; ?>">
144 <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'; ?>>
145 <span></span>
146 <a href="#" class="logo__adjust__toggler"><?php esc_html_e( "Settings", "embedpress" ); ?><i class="ep-icon ep-caret-down"></i></a>
147 </label>
148 <div class="logo__adjust__wrap <?php echo $pro_active ? '': 'proOverlay'; ?>" style="<?php if ( ('yes' !== $branding) || !$pro_active ) { echo 'display:none;'; } ?>">
149 <label class="logo__upload" id="yt_logo_upload_wrap" style="<?php if (!empty( $logo_url)) { echo 'display:none;'; } ?>">
150 <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; ?>">
151 <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; ?>">
152 <span class="icon"><i class="ep-icon ep-upload"></i></span>
153 <span class="text"><?php esc_html_e( "Click To Upload", "embedpress" ); ?></span>
154 </label>
155 <div class="logo__upload__preview" id="yt_logo__upload__preview" style="<?php if ( empty( $logo_url) ) { echo 'display:none'; } ?> ">
156 <div class="instant__preview">
157 <a href="#" id="yt_preview__remove" class="preview__remove"><i class="ep-icon ep-cross"></i></a>
158 <img class="instant__preview__img" id="yt_logo_preview" src="<?php echo $logo_url; ?>" alt="">
159 </div>
160 </div>
161
162 <div class="logo__adjust">
163 <div class="logo__adjust__controller">
164 <div class="logo__adjust__controller__item">
165 <span class="controller__label"><?php esc_html_e( "Logo Opacity (%)", "embedpress" ); ?></span>
166 <div class="logo__adjust__controller__inputs">
167 <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 )?>">
168 <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_opacity ); ?>" value="<?php echo esc_attr( $logo_opacity ); ?>">
169 </div>
170 </div>
171 <div class="logo__adjust__controller__item">
172 <span class="controller__label"><?php esc_html_e( "Logo X Position (%)", "embedpress" ); ?></span>
173 <div class="logo__adjust__controller__inputs">
174 <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 );?>">
175 <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_xpos ); ?>" value="<?php echo $logo_xpos; ?>">
176 </div>
177 </div>
178 <div class="logo__adjust__controller__item">
179 <span class="controller__label"><?php esc_html_e( "Logo Y Position (%)", "embedpress" ); ?></span>
180 <div class="logo__adjust__controller__inputs">
181 <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 ); ?>" >
182 <input readonly type="number" class="form__control range__value" data-default="<?php echo esc_attr( $logo_ypos ); ?>" value="<?php echo esc_attr( $logo_ypos ); ?>">
183 </div>
184 </div>
185 <div class="logo__adjust__controller__item">
186 <label class="controller__label" for="yt_cta_url" ><?php esc_html_e( "Call to Action Link", "embedpress" );?> </label>
187 <div>
188 <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); ?>">
189
190 <p><?php esc_html_e( "You may link the logo to any CTA link.", "embedpress" ); ?></p>
191 </div>
192 </div>
193 </div>
194 <div class="logo__adjust__preview">
195 <span class="title"><?php esc_html_e( "Live Preview", "embedpress" ); ?></span>
196 <div class="preview__box">
197 <?php echo $preview_video ;?>
198 <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="">
199 </div>
200 </div>
201 </div>
202 </div>
203 <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?>
204
205 </div>
206 </div>
207
208 <?php
209 }
210 ?>