partials
3 years ago
custom-logo.php
3 years ago
dailymotion.php
4 years ago
elements.php
3 years ago
general.php
3 years ago
go-premium.php
4 years ago
google-calendar.php
3 years ago
license.php
5 years ago
main-template.php
5 years ago
opensea.php
3 years ago
shortcode.php
5 years ago
soundcloud.php
4 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
youtube.php
293 lines
| 1 | <?php |
| 2 | /* |
| 3 | * YouTube Settings page |
| 4 | * All undefined vars comes from 'render_settings_page' method |
| 5 | * */ |
| 6 | $yt_settings = get_option( EMBEDPRESS_PLG_NAME.':youtube'); |
| 7 | $api_key = isset( $yt_settings['api_key']) ? $yt_settings['api_key'] : ''; |
| 8 | $pagesize = isset( $yt_settings['pagesize']) ? $yt_settings['pagesize'] : ''; |
| 9 | $start_time = isset( $yt_settings['start_time']) ? $yt_settings['start_time'] : 0; |
| 10 | $end_time = isset( $yt_settings['end_time']) ? $yt_settings['end_time'] : 0; |
| 11 | $autoplay = isset( $yt_settings['autoplay']) ? $yt_settings['autoplay'] : ''; |
| 12 | $controls = isset( $yt_settings['controls']) ? $yt_settings['controls'] : 1; |
| 13 | $fs = isset( $yt_settings['fs']) ? $yt_settings['fs'] : 1; |
| 14 | $iv_load_policy = isset( $yt_settings['iv_load_policy']) ? $yt_settings['iv_load_policy'] : 1; |
| 15 | $color = isset( $yt_settings['color']) ? $yt_settings['color'] : 'red'; |
| 16 | $rel = isset( $yt_settings['rel']) ? $yt_settings['rel'] : 1; |
| 17 | // pro |
| 18 | |
| 19 | $cc_load_policy = isset( $yt_settings['cc_load_policy']) ? $yt_settings['cc_load_policy'] : ''; |
| 20 | $modestbranding = isset( $yt_settings['modestbranding']) ? $yt_settings['modestbranding'] : 0; |
| 21 | $yt_lc_show = isset( $yt_settings['yt_lc_show']) ? $yt_settings['yt_lc_show'] : ''; |
| 22 | // Subscription - Pro |
| 23 | $yt_sub_channel = isset( $yt_settings['yt_sub_channel']) ? $yt_settings['yt_sub_channel'] : ''; |
| 24 | $yt_sub_text = isset( $yt_settings['yt_sub_text']) ? $yt_settings['yt_sub_text'] : ''; |
| 25 | $yt_sub_layout = isset( $yt_settings['yt_sub_layout']) ? $yt_settings['yt_sub_layout'] : ''; |
| 26 | $yt_sub_theme = isset( $yt_settings['yt_sub_theme']) ? $yt_settings['yt_sub_theme'] : ''; |
| 27 | $yt_sub_count = isset( $yt_settings['yt_sub_count']) ? $yt_settings['yt_sub_count'] : ''; |
| 28 | |
| 29 | ?> |
| 30 | |
| 31 | <div class="embedpress__settings background__white radius-25 p40"> |
| 32 | <h3><?php esc_html_e( "YouTube Settings", "embedpress" ); ?></h3> |
| 33 | <div class="embedpress__settings__form"> |
| 34 | <form action="" method="post" class="embedpress-settings-form" > |
| 35 | <?php |
| 36 | do_action( 'embedpress_before_youtube_settings_fields'); |
| 37 | echo $nonce_field ; ?> |
| 38 | <div class="form__group"> |
| 39 | <p class="form__label" ><?php esc_html_e( "YouTube API Key", "embedpress" ); ?> </p> |
| 40 | <div class="form__control__wrap"> |
| 41 | <input type="text" name="api_key" id="api_key" class="form__control" data-default="<?php echo esc_attr( $api_key); ?>" value="<?php echo esc_attr( $api_key); ?>" placeholder="<?php esc_html_e( "Enter API key", "embedpress" ); ?>" > |
| 42 | <p><?php echo sprintf(__( "Insert your YouTube API key. To obtain your API key, refer to this <a class='ep-link' href='%s' target='_blank'>documentation</a>.", "embedpress" ), 'https://embedpress.com/docs/retrieve-youtube-api-key/'); ?></p> |
| 43 | </div> |
| 44 | |
| 45 | </div> |
| 46 | <div class="form__group"> |
| 47 | <p class="form__label" ><?php esc_html_e( "Video Per Page", "embedpress" ); ?> </p> |
| 48 | <div class="form__control__wrap"> |
| 49 | <input type="number" min="1" max="50" name="pagesize" id="pagesize" class="form__control" data-default="<?php echo esc_attr( $pagesize); ?>" value="<?php echo esc_attr( $pagesize); ?>"> |
| 50 | <p><?php esc_html_e( "Specify the number of videos you wish to show on each page.", "embedpress" ); ?></p> |
| 51 | <p class="ep-note"><?php esc_html_e( "Note: This option takes effect only when a YouTube channel is embedded.", "embedpress" ); ?></p> |
| 52 | </div> |
| 53 | |
| 54 | </div> |
| 55 | <div class="form__group"> |
| 56 | <p class="form__label" ><?php esc_html_e( "Start Time (In Seconds)", "embedpress" ); ?> </p> |
| 57 | <div class="form__control__wrap"> |
| 58 | <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); ?>" > |
| 59 | <p><?php esc_html_e( "You can put a custom time in seconds to start the video. Example: 500", "embedpress" ); ?></p> |
| 60 | </div> |
| 61 | |
| 62 | </div> |
| 63 | <div class="form__group"> |
| 64 | <p class="form__label" ><?php esc_html_e( "End Time (In Seconds)", "embedpress" ); ?> </p> |
| 65 | <div class="form__control__wrap"> |
| 66 | <input type="number" name="end_time" id="end_time" class="form__control" data-default="<?php echo esc_attr( $end_time); ?>" value="<?php echo esc_attr( $end_time); ?>" > |
| 67 | <p><?php esc_html_e( "You can put a custom time in seconds to end the video.", "embedpress" ); ?></p> |
| 68 | </div> |
| 69 | |
| 70 | </div> |
| 71 | <div class="form__group"> |
| 72 | <p class="form__label"><?php esc_html_e( "Auto Play", "embedpress" ); ?></p> |
| 73 | <div class="form__control__wrap"> |
| 74 | <div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $autoplay ); ?>" data-value="<?php echo esc_attr( $autoplay ); ?>"> |
| 75 | <label class="input__radio"> |
| 76 | <input type="radio" name="autoplay" value="" <?php checked( '', $autoplay); ?>> |
| 77 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 78 | </label> |
| 79 | <label class="input__radio"> |
| 80 | <input type="radio" name="autoplay" value="1" <?php checked( '1', $autoplay); ?>> |
| 81 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 82 | </label> |
| 83 | </div> |
| 84 | <p><?php esc_html_e( "Automatically start to play the videos when the player loads.", "embedpress" ); ?></p> |
| 85 | </div> |
| 86 | </div> |
| 87 | <div class="form__group"> |
| 88 | <label class="form__label" for="color"><?php esc_html_e( "Progress Bar Color", "embedpress" ); ?></label> |
| 89 | <div class="form__control__wrap"> |
| 90 | <div class="embedpress__select "> |
| 91 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 92 | <select name="color" id="color" data-default="<?php echo esc_attr( $color ); ?>"> |
| 93 | <option value="red" <?php selected( 'red', $color); ?> ><?php esc_html_e( "Red", "embedpress" ); ?></option> |
| 94 | <option value="white" <?php selected( 'white', $color); ?> ><?php esc_html_e( "White", "embedpress" ); ?></option> |
| 95 | </select> |
| 96 | </div> |
| 97 | <p><?php printf( esc_html__( "Specifies the color that will be used in the player's video progress bar to highlight the amount of the video that the viewer has already seen. %s", 'embedpress'), '<br>'); ?></p> |
| 98 | <p class="ep-note"><?php esc_html_e( "Note: Setting the color to white will disable the Modest Branding option (causing a YouTube logo to be displayed in the control bar)." ); ?></p> |
| 99 | </div> |
| 100 | </div> |
| 101 | <div class="form__group"> |
| 102 | <p class="form__label"><?php esc_html_e( "Force Closed Captions", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p> |
| 103 | <div class="form__control__wrap"> |
| 104 | <div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $cc_load_policy ); ?>" data-value="<?php echo esc_attr( $cc_load_policy ); ?>"> |
| 105 | <label class="input__radio"> |
| 106 | <input type="radio" name="cc_load_policy" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $cc_load_policy); ?>> |
| 107 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 108 | </label> |
| 109 | <label class="input__radio"> |
| 110 | <input type="radio" name="cc_load_policy" value="1" <?php echo !$pro_active ? 'disabled ' : ''; checked( '1', $cc_load_policy);?>> |
| 111 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 112 | </label> |
| 113 | </div> |
| 114 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 115 | |
| 116 | <p><?php printf( esc_html__( "Setting this option to %s causes closed captions to be shown by default, even if the user has turned captions off. This will be based on user preference otherwise.", "embedpress" ), '<strong>Yes</strong>'); ?></p> |
| 117 | </div> |
| 118 | </div> |
| 119 | <div class="form__group"> |
| 120 | <p class="form__label"><?php esc_html_e( "Display Controls", "embedpress" ); ?></p> |
| 121 | <div class="form__control__wrap"> |
| 122 | <div class="embedpress__select"> |
| 123 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 124 | <select name="controls" data-default="<?php echo esc_attr( $controls); ?>"> |
| 125 | <option value="1" <?php selected( '1', $controls); ?>><?php esc_html_e( 'Display immediately', 'embedpress'); ?></option> |
| 126 | <option value="2" <?php selected( '2', $controls); ?>><?php esc_html_e( 'Display after user initiation', 'embedpress'); ?></option> |
| 127 | <option value="0" <?php selected( '0', $controls); ?>><?php esc_html_e( 'Hide controls', 'embedpress'); ?></option> |
| 128 | </select> |
| 129 | </div> |
| 130 | <p><?php esc_html_e( 'Indicates whether the video player controls are displayed.', 'embedpress'); ?> </p> |
| 131 | </div> |
| 132 | </div> |
| 133 | <div class="form__group"> |
| 134 | <p class="form__label"><?php esc_html_e( "Enable Fullscreen Button", "embedpress" ); ?></p> |
| 135 | <div class="form__control__wrap"> |
| 136 | <div class="input__flex input__radio_wrap" data-default="<?php echo esc_attr( $fs ); ?>" data-value="<?php echo esc_attr( $fs ); ?>"> |
| 137 | <label class="input__radio"> |
| 138 | <input type="radio" name="fs" value="" <?php checked( '', $fs); ?> > |
| 139 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 140 | </label> |
| 141 | <label class="input__radio"> |
| 142 | <input type="radio" name="fs" value="1" <?php checked( '1', $fs); ?>> |
| 143 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 144 | </label> |
| 145 | </div> |
| 146 | <p><?php esc_html_e( "Indicates whether the fullscreen button is enabled.", "embedpress" ); ?></p> |
| 147 | </div> |
| 148 | </div> |
| 149 | <div class="form__group"> |
| 150 | <p class="form__label"><?php esc_html_e( "Display Video Annotations", "embedpress" ); ?></p> |
| 151 | <div class="form__control__wrap"> |
| 152 | <div class="embedpress__select"> |
| 153 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 154 | <select name="iv_load_policy" data-default="<?php echo esc_attr( $iv_load_policy ); ?>"> |
| 155 | <option value="1" <?php selected( '1', $iv_load_policy); ?>><?php esc_html_e( "Show", "embedpress" ); ?></option> |
| 156 | <option value="3" <?php selected( '3', $iv_load_policy); ?>><?php esc_html_e( "Hide", "embedpress" ); ?></option> |
| 157 | </select> |
| 158 | </div> |
| 159 | <p><?php esc_html_e( "Indicates whether video annotations are displayed.", "embedpress" ); ?></p> |
| 160 | </div> |
| 161 | </div> |
| 162 | <div class="form__group"> |
| 163 | <p class="form__label"><?php esc_html_e( "Display Related Videos", "embedpress" ); ?></p> |
| 164 | <div class="form__control__wrap"> |
| 165 | <div class="embedpress__select"> |
| 166 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 167 | <select name="rel" data-default="<?php echo esc_attr( $rel); ?>"> |
| 168 | <option value="" <?php selected( '', $rel); ?>><?php esc_html_e( "From the same channel of the video", "embedpress" ); ?></option> |
| 169 | <option value="1" <?php selected( '1', $rel); ?>><?php esc_html_e( "Based on User's watch history", "embedpress" ); ?></option> |
| 170 | </select> |
| 171 | </div> |
| 172 | <p><?php esc_html_e( "Indicates how the player should show related videos when playback of the video pauses or ends.", "embedpress" ); ?></p> |
| 173 | </div> |
| 174 | </div> |
| 175 | |
| 176 | |
| 177 | <div class="form__group"> |
| 178 | <p class="form__label"><?php esc_html_e( "Modest Branding", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>' : ''; ?></p> |
| 179 | <div class="form__control__wrap"> |
| 180 | <div class="embedpress__select <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 181 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 182 | <select name="modestbranding" data-default="<?php echo esc_attr( $modestbranding); ?>" <?php echo !$pro_active ? 'disabled' : ''; ?>> |
| 183 | <option value="1" <?php selected( '1', $modestbranding); ?>><?php esc_html_e( "Hide", "embedpress" ); ?></option> |
| 184 | <option value="0" <?php selected( '0', $modestbranding); ?>><?php esc_html_e( "Show", "embedpress" ); ?></option> |
| 185 | </select> |
| 186 | </div> |
| 187 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 188 | |
| 189 | <p><?php esc_html_e( "Indicates whether the player should display a YouTube logo in the control bar.", "embedpress" ); ?></p> |
| 190 | </div> |
| 191 | </div> |
| 192 | |
| 193 | <!-- Live Chat--> |
| 194 | <div class="form__group"> |
| 195 | <p class="form__label"><?php esc_html_e( " Live Chat", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p> |
| 196 | <div class="form__control__wrap"> |
| 197 | <div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $yt_lc_show ); ?>" data-value="<?php echo esc_attr( $yt_lc_show ); ?>"> |
| 198 | <label class="input__radio"> |
| 199 | <input type="radio" name="yt_lc_show" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $yt_lc_show); ?>> |
| 200 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 201 | </label> |
| 202 | <label class="input__radio"> |
| 203 | <input type="radio" name="yt_lc_show" value="yes" <?php echo !$pro_active ? 'disabled ' : ''; checked( 'yes', $yt_lc_show);?>> |
| 204 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 205 | </label> |
| 206 | </div> |
| 207 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 208 | |
| 209 | <p><?php printf( esc_html__( "Enabling this option will show chat on all YouTube videos. However, YouTube Live Chat feature only works with Live Streaming videos.", "embedpress" ), '<strong>Yes</strong>'); ?></p> |
| 210 | </div> |
| 211 | </div> |
| 212 | |
| 213 | <!-- SUBSCRIPTION--> |
| 214 | <h3><?php esc_html_e( "Subscription Button", "embedpress" ); ?></h3> |
| 215 | |
| 216 | <div class="form__group"> |
| 217 | <p class="form__label"><?php esc_html_e( "Channel ID", "embedpress" ); echo $pro_active ? '': ' <span class="isPro">PRO</span>'; ?> </p> |
| 218 | <div class="form__control__wrap <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 219 | <input type="text" class="form__control" data-default="<?php echo esc_attr( $yt_sub_channel ); ?>" value="<?php echo esc_attr( $yt_sub_channel ); ?>" name="yt_sub_channel" <?php echo $pro_active ? '' : 'disabled'; ?> placeholder="Enter Channel ID"> |
| 220 | |
| 221 | <p><?php esc_html_e( "You can use either your channel link or channel ID to show the subscription button.", "embedpress" ); ?></p> |
| 222 | </div> |
| 223 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 224 | |
| 225 | </div> |
| 226 | |
| 227 | <div class="form__group"> |
| 228 | <p class="form__label"><?php esc_html_e( "Subscription Text", "embedpress" ); echo $pro_active ? '': ' <span class="isPro">PRO</span>'; ?> </p> |
| 229 | <div class="form__control__wrap <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 230 | <input type="text" class="form__control" data-default="<?php echo esc_attr( $yt_sub_text ); ?>" value="<?php echo esc_attr( $yt_sub_text ); ?>" name="yt_sub_text" <?php echo $pro_active ? '' : 'disabled'; ?> placeholder="<?php esc_attr_e( 'Eg. Don\'t miss out! Subscribe', 'embedpress' ) ?>"> |
| 231 | |
| 232 | <p><?php esc_html_e( "Optionally you can output some CTA text before the subscriber button.", "embedpress" ); ?></p> |
| 233 | </div> |
| 234 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 235 | |
| 236 | </div> |
| 237 | |
| 238 | <div class="form__group"> |
| 239 | <p class="form__label"><?php esc_html_e( "Layout", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>' : ''; ?></p> |
| 240 | <div class="form__control__wrap"> |
| 241 | <div class="embedpress__select <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 242 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 243 | <select name="yt_sub_layout" data-default="<?php echo esc_attr( $yt_sub_layout); ?>" <?php echo !$pro_active ? 'disabled' : ''; ?>> |
| 244 | <option value="" <?php selected( 'default', $yt_sub_layout); ?>><?php esc_html_e( "Default", "embedpress" ); ?></option> |
| 245 | <option value="full" <?php selected( 'full', $yt_sub_layout); ?>><?php esc_html_e( "Full", "embedpress" ); ?></option> |
| 246 | </select> |
| 247 | </div> |
| 248 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 249 | |
| 250 | <p><?php esc_html_e( "Full layout shows channel image. Default layout shows only channel name and subscription button.", "embedpress" ); ?></p> |
| 251 | </div> |
| 252 | </div> |
| 253 | |
| 254 | <div class="form__group"> |
| 255 | <p class="form__label"><?php esc_html_e( "Theme", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>' : ''; ?></p> |
| 256 | <div class="form__control__wrap"> |
| 257 | <div class="embedpress__select <?php echo $pro_active ? '': 'isPro'; ?>"> |
| 258 | <span><i class="ep-icon ep-caret-down"></i></span> |
| 259 | <select name="yt_sub_theme" data-default="<?php echo esc_attr( $yt_sub_theme); ?>" <?php echo !$pro_active ? 'disabled' : ''; ?>> |
| 260 | <option value="" <?php selected( 'default', $yt_sub_theme); ?>><?php esc_html_e( "Default", "embedpress" ); ?></option> |
| 261 | <option value="dark" <?php selected( 'dark', $yt_sub_theme); ?>><?php esc_html_e( "Dark", "embedpress" ); ?></option> |
| 262 | </select> |
| 263 | </div> |
| 264 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 265 | |
| 266 | <p><?php esc_html_e( "Default theme is good for white background. Dark theme is good for black background.", "embedpress" ); ?></p> |
| 267 | </div> |
| 268 | </div> |
| 269 | |
| 270 | <div class="form__group"> |
| 271 | <p class="form__label"><?php esc_html_e( "Show Subscriber Count", "embedpress" ); echo !$pro_active ? ' <span class="isPro">PRO</span>': ''; ?></p> |
| 272 | <div class="form__control__wrap"> |
| 273 | <div class="input__flex input__radio_wrap <?php echo $pro_active ? '': 'isPro'; ?>" data-default="<?php echo esc_attr( $yt_sub_count ); ?>" data-value="<?php echo esc_attr( $yt_sub_count ); ?>"> |
| 274 | <label class="input__radio"> |
| 275 | <input type="radio" name="yt_sub_count" value="" <?php echo !$pro_active ? 'disabled ' : ''; checked( '', $yt_sub_count); ?>> |
| 276 | <span><?php esc_html_e( "No", "embedpress" ); ?></span> |
| 277 | </label> |
| 278 | <label class="input__radio"> |
| 279 | <input type="radio" name="yt_sub_count" value="1" <?php echo !$pro_active ? 'disabled ' : ''; checked( '1', $yt_sub_count);?>> |
| 280 | <span><?php esc_html_e( "Yes", "embedpress" ); ?></span> |
| 281 | </label> |
| 282 | </div> |
| 283 | <?php if ( !$pro_active ) { include EMBEDPRESS_SETTINGS_PATH . 'templates/partials/alert-pro.php'; } ?> |
| 284 | </div> |
| 285 | </div> |
| 286 | |
| 287 | |
| 288 | <?php do_action( 'embedpress_after_youtube_settings_fields'); ?> |
| 289 | <button class="button button__themeColor radius-10 embedpress-submit-btn" name="submit" value="youtube"><?php esc_html_e( 'Save Changes', 'embedpress'); ?></button> |
| 290 | </form> |
| 291 | </div> |
| 292 | </div> |
| 293 |