function mce_translation() { $option = new Simple_Video_Embed_Option(); $main_option = $option->getMain(); $youtubeOption = $option->getYoutube(); $strings = array('googlePublicKeyV3' => $youtubeOption['google-public-key-v3'], 'defaultVideoSliderHeight' => $main_option['video-carousel-height'], 'defaultColumnsNumber' => $main_option['thumb-columns-number'], 'defaultThumbTitle' => $main_option['thumb_title'], 'typeLabel' => __('Type', 'simple-video-embed'), 'videoLabel' => __('Video', 'simple-video-embed'), 'playlistLabel' => __('Playlist', 'simple-video-embed'), 'urloridLabel' => __('Url or ID', 'simple-video-embed'), 'autoplayLabel' => __('Autoplay', 'simple-video-embed'), 'loopLabel' => __('Loop', 'simple-video-embed'), 'templateLabel' => __('Playlist template', 'simple-video-embed'), 'videoControlsDisplayLabel' => __('Video player controls', 'simple-video-embed'), 'videoControlsDisplay0Label' => __('Hide', 'simple-video-embed'), 'videoControlsDisplay1Label' => __('Display immediately', 'simple-video-embed'), 'videoControlsDisplay2Label' => __('Display after video played', 'simple-video-embed'), 'fullscreenLabel' => __('Full screen', 'simple-video-embed'), 'thumb_titleLabel' => __('Show thumb video title', 'simple-video-embed'), 'noThumbLabel' => __('No thumbnails', 'simple-video-embed'), 'slider' => __('Video Slider', 'simple-video-embed'), 'thumbSlider' => __('Thumbnails slider', 'simple-video-embed'), 'thumbInColumns' => __('Thumbnails in columns', 'simple-video-embed'), 'alertRequired' => __('Please fill popup required fields.', 'simple-video-embed'), 'alertKeyInvalid' => __('Google Public API Key is invalid!', 'simple-video-embed'), 'alertRequiredSend' => __('Bad Request, missing required parameter!', 'simple-video-embed'), 'alertUnknownPart' => __('Bad Request, unknown parameter!', 'simple-video-embed'), 'alertUrlNotFound' => __('Cannot contact ', 'simple-video-embed'), 'alertNotFound' => __('not found!', 'simple-video-embed'), 'alertConfig' => __('You have to configure Simple Video Embed!', 'simple-video-embed')); $locale = _WP_Editors::$mce_locale; $translated = 'tinyMCE.addI18n("' . $locale . '.wpsve_mce_button", ' . json_encode($strings) . ");\n"; return $translated; }
/** * Initialize the class and set its id. * * @since 1.0.0 * @param string $id * The id of the video or playlist. */ public static function withId($id) { $yt = new Sve_Youtube(); $yt->id = $id; $yt->playerapiid = $id; $option = new Simple_Video_Embed_Option(); $yt->template_params = $option->getMain(); $yt->youtube_options = $option->getYoutube(); return $yt; }
<a href="?page=simple-video-embed&tab=general" class="nav-tab <?php echo $active_tab == 'general' ? 'nav-tab-active' : ''; ?> ">General</a> <a href="?page=simple-video-embed&tab=youtube" class="nav-tab <?php echo $active_tab == 'youtube' ? 'nav-tab-active' : ''; ?> ">Youtube</a> </h2> <form action="options.php" method="POST"> <?php $option = new Simple_Video_Embed_Option($this->plugin_name, $this->version); switch ($active_tab) { case "youtube": settings_fields('wpsve-youtube'); do_settings_sections('wpsve-youtube'); ?> <table class="form-table"> <tbody> <tr> <th scope="row"><label for="wpsve-google-public-key-v3"><?php _e('Google Public Api Key (V3)', $this->plugin_name); ?> </label> </th> <td><input name="wpsve-youtube[google-public-key-v3]" type="text" id="wpsve-google-public-key-v3"