Changeset 1555602
- Timestamp:
- 12/15/2016 05:38:02 PM (8 years ago)
- Location:
- featured-video-plus
- Files:
-
- 54 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
featured-video-plus/trunk/CHANGELOG.md
r1457131 r1555602 1 1 # Changelog # 2 3 4 5 6 7 8 2 9 3 10 ## 2.2.3: 2016-07-19 ## -
featured-video-plus/trunk/FAQ.md
r1172119 r1555602 2 2 3 3 ## Why do I just get text back after adding an URL to the Featured Video input? ## 4 If the plugin just displays the URL back as text it probably does not recognize that it comes from a video provider. Try inserting the raw embed code instead and[check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.4 If the plugin just [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported. 5 5 6 6 ## How do I use my local videos? ## 7 7 Click the small media icon in the Featured Video input box on the post edit screen and upload your video or choose it from the media library. WordPress does not support all formats tho, [check this table](http://www.mediaelementjs.com/#devices) for details. 8 8 9 ## Why do I not see a featu erd video or image on the frontend at all? ##10 For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available. If your theme does not support featured images the plugin also has no chance of working out of the box.9 ## Why do I not see a featud video or image on the frontend at all? ## 10 For the videos to be automatically displayed you need to define a Featured Image. . If your theme does not support featured images the plugin also has no chance of working out of the box. 11 11 12 12 ## Why does the frontend still display the featured image although I added a featured video to the post? ## … … 16 16 Take a look at your media settings and try using a fixed width instead of responsive sizing. 17 17 18 19 20 18 21 ## Can I help translating the plugin? ## 19 Yes, please! Check out the public [Featured Video Plus Translation Project](https://poeditor.com/join/project?hash=WlyLh0cFO3).22 Yes, please! Check out the ). -
featured-video-plus/trunk/README.md
r1202444 r1555602 16 16 3. manually make use of the __PHP-functions__ in your theme's source files. 17 17 18 19 18 20 > <strong>Theme compatibility</strong><br> 19 21 > Sadly many themes do not follow the WordPress standards and implement their own fancy functions for displaying featured images - those very likely break this plugin. Check out the [FAQ](https://wordpress.org/plugins/featured-video-plus/faq/). Another common problem are sliders: Videos, in general, do not like sliders at all. … … 26 28 27 29 > <strong>Support</strong><br> 28 > I do read all support questions in the [forums](http s://wordpress.org/support/plugin/featured-video-plus) but cannot reply to all of them. The plugin is an unpaid side project and full support would require more time than I can invest for free for over 10k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.30 > I do read all support questions in the [forums](http0k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements. 29 31 30 32 -
featured-video-plus/trunk/featured-video-plus.php
r1457131 r1555602 4 4 Plugin URI: http://yrnxt.com/wordpress/featured-video-plus/ 5 5 Description: Add Featured Videos to your posts and pages. 6 Version: 2. 2.36 Version: 2. 7 7 Author: Alexander Höreth 8 8 Author URI: http://yrnxt.com … … 33 33 // CONSTANTS 34 34 if ( ! defined( 'FVP_VERSION' ) ) { 35 define( 'FVP_VERSION', '2. 2.3' );35 define( 'FVP_VERSION', '2.' ); 36 36 } 37 37 -
featured-video-plus/trunk/js/post.js
r1202444 r1555602 9 9 var mediaicon; 10 10 var loadingicon = 'url(' + context.loading_gif + ')'; 11 11 12 12 13 … … 100 101 $media.css({ backgroundImage: mediaicon }); 101 102 102 // removed video 103 if('remove' === data.task) { 104 $container 105 .css({height: $container.height() }) 106 .html('') 107 .animate({height: 0}); 108 109 // new video data 103 if (data.valid !== false) { 104 $invalidNotice.hide(); 105 } else { 106 $invalidNotice.css({ display: 'block' }); 107 } 108 109 $input.val(data.full); 110 currentUrl = data.full; // Remember new url. 111 if(!data.full) { 112 var height = $container.height(); 113 if (height) { 114 $container.css({ height: height }).animate({ height: 0 }); 115 } 116 $container.html('') 110 117 } else { 111 118 // Suppress autoplay in admin interface. Cannot do this on the server 112 119 // side because ajax requests from frontend and backend look the same. 113 120 data.video = data.video.replace(/autoplay(?:=.?)?&?/i, ''); 114 115 $container 116 .css({height: ''}) 117 .html(data.video); 121 $container.css({ height: '' }).html(data.video); 118 122 } 119 123 … … 127 131 $input = $('.fvp-video'); 128 132 $media = $input.siblings('.fvp-video-choose').children('.fvp-media-icon'); 133 129 134 currentUrl = $input.val(); 130 135 mediaicon = $media.css('backgroundImage'); … … 133 138 // Update video and featured image with the returned data. 134 139 $input.blur(submitVideo); 140 141 142 143 144 145 135 146 136 147 // Initialize autosizing the url input field, disable enter key and -
featured-video-plus/trunk/js/post.min.js
r1202444 r1555602 1 !function(e){"use strict";function t(t){var i=e("#postimagediv .inside");t=t||i.html(),i.html(t),0<i.find(".fvp-remove-image").length&&(i.find("#remove-post-thumbnail").parent("p").hide(),i.find(".fvp-remove-image").parent("p").show())}function i(e){n(e,!0)}function a(i){i.preventDefault(), r.css({backgroundImage:f}),e.post(ajaxurl,{action:"fvp_remove_img",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val()},function(e){e.success&&(t(e.data),r.css({backgroundImage:c}))},"json")}function n(i,a){if(i.preventDefault(),a=a||!1,o.val(e.trim(o.val())).trigger("autosize"),s!==o.val()||a){r.css({backgroundImage:f}),s=o.val();var n={action:"fvp_save",id:e("#post_ID").val(),fvp_nonce:e("#fvp_nonce").val(),fvp_video:o.val(),fvp_set_featimg:a};e.post(ajaxurl,n,function(i){if(!i.success)return!1;var a=i.data,n=e(".fvp-current-video");r.css({backgroundImage:c}),"remove"===a.task?n.css({height:n.height()}).html("").animate({height:0}):(a.video=a.video.replace(/autoplay(?:=.?)?&?/i,""),n.css({height:""}).html(a.video)),t(a.img)},"json")}}var o,r,s,c,v=fvpPost,f="url("+v.loading_gif+")";e(document).ready(function(){o=e(".fvp-video"),r=o.siblings(".fvp-video-choose").children(".fvp-media-icon"),s=o.val(),c=r.css("backgroundImage"),o.blur(n),o.autosize().trigger("blur").keypress(function(t){13===t.keyCode&&(t.preventDefault(),e(this).trigger("blur"))}).click(function(){e(this).select()}),e("#postimagediv").on("click",".fvp-set-image",i).on("click",".fvp-remove-image",a),t();var v,f={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:v.data("title"),library:{type:"video"},button:{text:v.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var t=this.get("selection"),i="url",a=v.data("target");e(a).val(t.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){e("#wpbody").on("click",".fvp-video-choose",function(t){t.preventDefault(),v=e(this).closest(".fvp-input-wrapper"),f.frame().open()})}};f.init()})}(jQuery);1 !function(e){"use strict";function t(t){var i=e("#postimagediv .inside");t=t||i.html(),i.html(t),0<i.find(".fvp-remove-image").length&&(i.find("#remove-post-thumbnail").parent("p").hide(),i.find(".fvp-remove-image").parent("p").show())}function i(e){n(e,!0)}function a(i){i.preventDefault(),),o.autosize().trigger("blur").keypress(function(t){13===t.keyCode&&(t.preventDefault(),e(this).trigger("blur"))}).click(function(){e(this).select()}),e("#postimagediv").on("click",".fvp-set-image",i).on("click",".fvp-remove-image",a),t();var v,f={frame:function(){return this._frame?this._frame:(this._frame=wp.media({title:v.data("title"),library:{type:"video"},button:{text:v.data("button")},multiple:!1}),this._frame.on("open",this.updateFrame).state("library").on("select",this.select),this._frame)},select:function(){var t=this.get("selection"),i="url",a=v.data("target");e(a).val(t.pluck(i)).change().trigger("blur")},updateFrame:function(){},init:function(){e("#wpbody").on("click",".fvp-video-choose",function(t){t.preventDefault(),v=e(this).closest(".fvp-input-wrapper"),f.frame().open()})}};f.init()})}(jQuery); -
featured-video-plus/trunk/lng/featured-video-plus-de_DE.po
r1179150 r1555602 1 2 1 3 msgid "" 2 4 msgstr "" 5 3 6 "MIME-Version: 1.0\n" 4 7 "Content-Type: text/plain; charset=UTF-8\n" 5 8 "Content-Transfer-Encoding: 8bit\n" 6 " X-Generator: POEditor.com\n"7 " Project-Id-Version: Featured Video Plus\n"8 " Language: de\n"9 10 #: build/php/class-backend.php:122php/class-backend.php:1229 "\n" 10 "\n" 11 "\n" 12 13 #: php/class-backend.php:122 11 14 msgid "Featured Video" 12 15 msgstr "Beitragsvideo" 13 16 14 #: build/php/class-backend.php:164php/class-backend.php:16417 #: php/class-backend.php:164 15 18 msgid "Set Featured Video" 16 19 msgstr "Beitragsvideo festlegen" 17 20 18 #: build/php/class-backend.php:170php/class-backend.php:17021 #: php/class-backend.php:170 19 22 msgid "Video URL" 20 23 msgstr "Video URL" 21 24 22 #: build/php/class-backend.php:198php/class-backend.php:19825 #: php/class-backend.php:198 23 26 msgid "The current theme does not support Featured Images" 24 27 msgstr "Das aktuelle Theme nutzt keine Beitragsbilder." 25 28 26 #: build/php/class-backend.php:205php/class-backend.php:20529 #: php/class-backend.php:205 27 30 msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s. To hide this notice deactivate %3$sReplace Featured Images%4$s in the %5$sMedia Settings%6$s." 28 31 msgstr "Um Beitragsvideos darzustellen musst du den %1$sShortcode%2§s oder %1$sPHP-Funktionen%2$s nutzen. Um diese Warnung zu deaktivieren stell %3$sBeitragsbilder ersetzen%4$s in den %5$sMedieneinstellungen%6$s aus." 29 32 30 #. #-#-#-#-# featured-video-plus.pot (Featured Video Plus 1.9.2) #-#-#-#-# 33 #: php/class-backend.php:628 php/class-settings.php:39 34 msgid "Featured Videos" 35 msgstr "Beitragsvideos" 36 37 #: php/class-backend.php:630 38 msgid "Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s." 39 msgstr "Kopier einfach eine URL in das Eingabefeld um deinen Videos ein wenig extra Leben einzuhauchen. %sProbier ein Beispiel%s." 40 41 #: php/class-backend.php:637 42 msgid "To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s." 43 msgstr "Wirf einen Blick in die %sMedien-Einstellungen%s um anzupassen wie Beitragsvideos dargestellt werden." 44 45 #: php/class-backend.php:693 46 msgid "Remove featured image" 47 msgstr "Beitragsbild entfernen" 48 49 #: php/class-backend.php:700 50 msgid "Featured Videos require a Featured Image for automatic replacement." 51 msgstr "Beitragsvideos benötigen ein Beitragsbild um automatisch dargestellt werden zu können." 52 53 #: php/class-backend.php:704 54 msgid "Auto set" 55 msgstr "Automatisch erstellen" 56 57 #. #-#-#-#-# tmp-featured-video-plus.pot (Featured Video Plus 2.2.3) 58 #. #-#-#-#-# 31 59 #. Plugin Name of the plugin/theme 32 #: build/php/class-help.php:23php/class-help.php:2360 #: php/class-help.php:23 33 61 msgid "Featured Video Plus" 34 62 msgstr "Featured Video Plus" 35 63 36 #: build/php/class-help.php:31php/class-help.php:3164 #: php/class-help.php:31 37 65 msgid "Take a video url from one of the %ssupported oembed providers%s and paste it into the Featured Video input field." 38 66 msgstr "Kopiere einen Video-Link von einem der %sunterstützten Anbieter%s in das Beitragsvideo-Eingabefeld." 39 67 40 #: php/class-backend.php:580 41 msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input vield. The plugin makes use of %sWordPress' native functionality%s - no gurantee for compatibility with all formats." 42 msgstr "Alternativ kannst du ein Video aus deiner Mediengallerie auswählen. Das Plugin nutzt die %soriginale WordPress Funktionsweise%s - keine Garantie für Kombatibilität mit allen Formaten & Geräten." 43 44 #: php/class-backend.php:588 45 msgid "Converting your videos" 46 msgstr "Videos konvertieren" 47 48 #: php/class-backend.php:592 49 msgid "Take a look at the %sMiro Video Converter%s. It is open source, lightweight and compatible with Windows, Mac and Linux." 50 msgstr "Schau dir den %sMiro Video Converter%s an. Er is Open Source, klein, einfach zu verwenden und mit Windows, Mac und Linux kompatibel." 51 52 #: build/php/class-help.php:52 php/class-help.php:52 68 #: php/class-help.php:41 69 msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input field. The plugin makes use of %sWordPress' native HTML5 video functionality%s - no gurantee for compatibility with all formats." 70 msgstr "Alternativ kannst du eines deiner eigenen Videos aus der Medienbibliothek auswählen indem du das kleine Icon rechts im URL Eingabefeld anklickst. Das Plugin nutzt die %WordPress eigene HTML5 Video-Funktionalität%s - keine Garantie dafür, dass alle Formate funktionieren." 71 72 #: php/class-help.php:52 53 73 msgid "Fixing upload errors" 54 74 msgstr "Videoupload Fehler beheben" 55 75 56 #: build/php/class-help.php:58php/class-help.php:5876 #: php/class-help.php:58 57 77 msgid "Read %sthis%s on how to increase the maximum file upload size." 58 78 msgstr "Schau dir %sdiesen Link%s an um zu erfahren wie man die maximale Upload größe erhöht." 59 79 60 #: build/php/class-backend.php:603 build/php/class-settings.php:39 61 #: php/class-backend.php:603 php/class-settings.php:39 62 msgid "Featured Videos" 63 msgstr "Beitragsvideos" 64 65 #: build/php/class-backend.php:605 php/class-backend.php:605 66 msgid "Simply paste a URL into this input to add a bit extra life to your posts. %sTry an example%s." 67 msgstr "Kopier einfach eine URL in das Eingabefeld um deinen Videos ein wenig extra Leben einzuhauchen. %sProbier ein Beispiel%s." 68 69 #: build/php/class-backend.php:612 php/class-backend.php:612 70 msgid "To adjust how featured videos are displayed on the frontend checkout the %smedia settings%s." 71 msgstr "Wirf einen Blick in die %sMedien-Einstellungen%s um anzupassen wie Beitragsvideos dargestellt werden." 72 73 #: build/php/class-backend.php:669 php/class-backend.php:669 74 msgid "Featured Videos require a Featured Image for automatic replacement." 75 msgstr "Beitragsvideos benötigen ein Beitragsbild um automatisch dargestellt werden zu können." 76 77 #: build/php/class-backend.php:673 php/class-backend.php:673 78 msgid "Auto set" 79 msgstr "Automatisch erstellen" 80 81 #: build/php/class-settings.php:50 php/class-settings.php:50 82 msgid "Display mode" 83 msgstr "Modus" 84 85 #: build/php/class-settings.php:58 php/class-settings.php:58 86 msgid "Display Conditions" 87 msgstr "Konditionen" 88 89 #: build/php/class-settings.php:68 php/class-settings.php:68 90 msgid "Video Sizing" 91 msgstr "Videogröße" 92 93 #: build/php/class-settings.php:77 php/class-settings.php:77 94 msgid "Video Align" 95 msgstr "Positionierung" 96 97 #: build/php/class-settings.php:86 php/class-settings.php:86 98 msgid "Default Arguments" 99 msgstr "Parameter" 100 101 #: build/php/class-settings.php:95 php/class-settings.php:95 102 msgid "Support" 103 msgstr "Support" 104 105 #: build/php/class-settings.php:116 php/class-settings.php:116 106 msgid "To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme's source files to make use of the plugins PHP-functions." 107 msgstr "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-Funktionen in deine Theme Dateien integrieren." 108 109 #: build/php/class-settings.php:117 php/class-settings.php:117 110 msgid "For more information about Shortcode and PHP functions see the %sContextual Help%s." 111 msgstr "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in die %sHilfe%s." 112 113 #: build/php/class-settings.php:125 php/class-settings.php:125 114 msgid "The current theme does not support featured images." 115 msgstr "Das aktuelle Theme unterstützt keine Beitragsbilder." 116 117 #: build/php/class-settings.php:128 php/class-settings.php:128 118 msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s." 119 msgstr "Um Beitragsvideos darzustellen musst du leider den %1$sShortcode%2$s oder die %1$sPHP-Funktionen%2$s nutzen." 120 121 #: build/php/class-settings.php:151 php/class-settings.php:151 122 msgid "Replace featured image automatically." 123 msgstr "Beitragsbild automatisch ersetzen." 124 125 #: build/php/class-settings.php:152 php/class-settings.php:152 126 msgid "Replace featured image on click." 127 msgstr "Beitragsbild bei anklicken ersetzen." 128 129 #: build/php/class-settings.php:153 php/class-settings.php:153 130 msgid "Open video overlay when featured image is clicked." 131 msgstr "Video in Overlay darstellen." 132 133 #: build/php/class-settings.php:154 php/class-settings.php:154 134 msgid "Manual: PHP-functions or shortcodes." 135 msgstr "Manuell: PHP-Funktionen oder Shortcode." 136 137 #: build/php/class-settings.php:160 php/class-settings.php:160 138 msgid "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality." 139 msgstr "Automatische Integration (Optionen 1 bis 3) benötigen ein Theme das die nativen WordPress %sBeitragsbild%s Funktionen nutzt." 140 141 #: build/php/class-settings.php:203 php/class-settings.php:203 142 msgid "View options are not available in manual mode." 143 msgstr "Darstellungsoptionen sind im manuellen Modus nicht verfügbar." 144 145 #: build/php/class-settings.php:274 php/class-settings.php:274 146 msgid "Responsive" 147 msgstr "Dynamisch" 148 149 #: build/php/class-settings.php:281 php/class-settings.php:281 150 msgid "Width in pixels:" 151 msgstr "Breite in Pixeln:" 152 153 #: build/php/class-settings.php:298 php/class-settings.php:298 154 msgid "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead." 155 msgstr "Die %1$dynamisch%2$s Einstellung funktioniert nicht in allen Themes und speziell auch nicht im %1$sOverlay%2$s-Modus. In dem Fall muss eine absolute Breite angegeben werden." 156 157 #: build/php/class-settings.php:319 php/class-settings.php:319 158 msgid "left" 159 msgstr "links" 160 161 #: build/php/class-settings.php:320 php/class-settings.php:320 162 msgid "center" 163 msgstr "zentriert" 164 165 #: build/php/class-settings.php:321 php/class-settings.php:321 166 msgid "right" 167 msgstr "rechts" 168 169 #: build/php/class-settings.php:344 php/class-settings.php:344 170 msgid "Not all of the following options might be supported by all providers." 171 msgstr "Nicht alle der folgenden Einstellungen werden von allen Providern unterstützt." 172 173 #: build/php/class-settings.php:352 php/class-settings.php:352 174 msgid "Autoplay" 175 msgstr "Automatisch Abspielen" 176 177 #: build/php/class-settings.php:353 php/class-settings.php:353 178 msgid "Loop" 179 msgstr "Dauerschleife" 180 181 #: build/php/class-settings.php:361 php/class-settings.php:361 182 msgid "If the owner of a video is a Plus member, some of these settings may be overridden by their preferences." 183 msgstr "Wenn der Videoeigentümer Vimeo-Plus Mitglied ist, kann er die folgenden Einstellungen für sein Video überschreiben." 184 185 #: build/php/class-settings.php:376 php/class-settings.php:376 186 msgid "Hide user's portrait" 187 msgstr "Nutzerbild verbergen." 188 189 #: build/php/class-settings.php:380 php/class-settings.php:380 190 msgid "Hide video title" 191 msgstr "Videotitel verbergen." 192 193 #: build/php/class-settings.php:384 php/class-settings.php:384 194 msgid "Hide video byline" 195 msgstr "Erstellerzeile verbergen." 196 197 #: build/php/class-settings.php:397 php/class-settings.php:397 198 msgid "Light theme" 199 msgstr "Helles Theme." 200 201 #: build/php/class-settings.php:401 php/class-settings.php:401 202 msgid "White highlight color" 203 msgstr "Weiße Betonungsfarbe." 204 205 #: build/php/class-settings.php:403 php/class-settings.php:403 206 msgid "Hide YouTube logo" 207 msgstr "YouTube Logo verbergen." 208 209 #: build/php/class-settings.php:406 build/php/class-settings.php:456 210 #: php/class-settings.php:406 php/class-settings.php:456 211 msgid "Hide related videos" 212 msgstr "Verwandte Videos verbergen." 213 214 #: build/php/class-settings.php:410 php/class-settings.php:410 215 msgid "Disallow fullscreen" 216 msgstr "Vollbildmodus unterdrücken." 217 218 #: build/php/class-settings.php:414 build/php/class-settings.php:452 219 #: php/class-settings.php:414 php/class-settings.php:452 220 msgid "Hide video info" 221 msgstr "Videoinfo verbergen." 222 223 #: build/php/class-settings.php:416 php/class-settings.php:416 224 msgid "Enable JavaScript API" 225 msgstr "JavaScript API aktivieren." 226 227 #: build/php/class-settings.php:448 php/class-settings.php:448 228 msgid "Hide DailyMotion logo" 229 msgstr "DailyMotion Logo verbergen." 230 231 #: build/php/class-settings.php:460 php/class-settings.php:460 232 msgid "Turn HD on by default" 233 msgstr "HD automatisch einschalten." 234 235 #: build/php/class-settings.php:479 php/class-settings.php:479 236 msgid "If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!" 237 msgstr "Wenn du einen Fehler gefunden hast oder eine bestimmte Funktion vermisst, %ssag im Support-Forum Bescheid%s. Dir gefällt das Plugin? %sHinterlasse eine Bewertung%s oder %sspende für die Entwicklung%s!" 238 239 #: build/php/class-help.php:82 php/class-help.php:82 80 #: php/class-help.php:82 240 81 msgid "PHP-Functions" 241 82 msgstr "PHP-Funktionen" 242 83 243 #: php/class-settings.php:583 244 msgid "All parameters are optional. If %s the current post's id will be used. %s is either a string keyword (thumbnail, medium, large or full) or a 2-item array representing width and height in pixels, e.g. array(32,32)." 245 msgstr "Alle Parameter sind optional. Wenn %s gilt, wird die ID des aktuellen Beitrags genutzt. %s ist entweder ein String (thumbnail, medium, large oder full) oder ein Array mit zwei Stellen (Breite und Höhe); Zum Beispiel array(32,32)." 246 247 #: build/php/class-help.php:115 php/class-help.php:115 248 msgid "The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:" 249 msgstr "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie sollten genauso genutzt werden können und sich genauso verhalten. Schau dir für mehr Informationen den WordPress Codex an:" 250 251 #: build/php/class-help.php:119 php/class-help.php:119 252 msgid "Featured Image" 253 msgstr "Beitragsbild" 254 255 #: build/php/class-help.php:156 php/class-help.php:156 256 msgid "Displays the video in its default size." 257 msgstr "Stellt das Video in seiner Standardgröße dar." 258 259 #: php/class-settings.php:620 260 msgid "Displays the video with an width of 300 pixel. Height will be fitted to the aspect ratio." 261 msgstr "Stellt das Video mit einer Breite von 300 Pixeln dar. Die Höhe wird automatisch angepasst, so dass das Seitenverhältniss erhalten bleibt." 262 263 #: php/class-settings.php:624 264 msgid "Displays the video with an fixed width and height." 265 msgstr "Stellt das Video mit fester Breite und Höhe dar." 266 267 #. Plugin URI of the plugin/theme 268 #: 269 msgid "http://yrnxt.com/wordpress/featured-video-plus/" 270 msgstr "http://yrnxt.com/wordpress/featured-video-plus/" 271 272 #. Description of the plugin/theme 273 #: 274 msgid "Add Featured Videos to your posts and pages." 275 msgstr "Füge deinen Beiträgen und Seiten Beitragsvideos hinzu." 276 277 #. Author of the plugin/theme 278 #: 279 msgid "Alexander Höreth" 280 msgstr "Alexander Höreth" 281 282 #. Author URI of the plugin/theme 283 #: 284 msgid "http://yrnxt.com" 285 msgstr "http://yrnxt.com" 286 287 #: build/php/class-help.php:41 php/class-help.php:41 288 msgid "Alternatively you can select one of the videos from your media library using the small media icon to the right in the URL input field. The plugin makes use of %sWordPress' native HTML5 video functionality%s - no gurantee for compatibility with all formats." 289 msgstr "Alternativ kannst du eines deiner eigenen Videos aus der Medienbibliothek auswählen indem du das kleine Icon rechts im URL Eingabefeld anklickst. Das Plugin nutzt die %WordPress eigene HTML5 Video-Funktionalität%s - keine Garantie dafür, dass alle Formate funktionieren." 290 291 #: build/php/class-help.php:104 php/class-help.php:104 84 #: php/class-help.php:104 292 85 msgctxt "%1$s is a boolean condition, \\\"post_id == null\\\", %2$s is a PHP variable, %2$s is a list of strings in paranthesis." 293 86 msgid "All parameters are optional. If %1$s the current post's id will be used. %2$s is either a string %2$s or a 2-item array representing width and height in pixels, e.g. array(32,32)." 294 87 msgstr "Alle Parameter sind optional. Wenn %1$s, wird die ID des aktuellen Posts genutzt. %2$s kann entweder ein String %2$s oder ein Array mit 2 Elementen sein die die Breite und Höhe in Pixeln festlegen, z.B. array(32, 32)." 295 88 296 #: build/php/class-help.php:111 build/php/class-settings.php:198297 89 #: php/class-help.php:111 php/class-settings.php:198 298 90 msgid "or" 299 91 msgstr "oder" 300 92 301 #: build/php/class-help.php:143 php/class-help.php:143 93 #: php/class-help.php:115 94 msgid "The functions are implemented corresponding to the original %sfunctions%s: They are intended to be used and to act the same way. Take a look into the WordPress Codex for further guidance:" 95 msgstr "Die Funktionen sind nach den original %sFunktionen%s implementiert. Sie sollten genauso genutzt werden können und sich genauso verhalten. Schau dir für mehr Informationen den WordPress Codex an:" 96 97 #: php/class-help.php:119 98 msgid "Featured Image" 99 msgstr "Beitragsbild" 100 101 #: php/class-help.php:143 302 102 msgid "Featured Video Plus: Shortcode" 303 103 msgstr "Featured Video Plus: Shortcode" 304 104 305 #: build/php/class-help.php:160 php/class-help.php:160 105 #: php/class-help.php:156 106 msgid "Displays the video in its default size." 107 msgstr "Stellt das Video in seiner Standardgröße dar." 108 109 #: php/class-help.php:160 306 110 msgid "Displays the video with a width of 300 pixel. Height will be fitted such that the aspect ratio is preserved." 307 111 msgstr "Stellt das Video mit einer Breite von 300 Pixeln dar. Die Höhe wird automatisch so angepasst, dass das Seitenverhältnis erhalten bleibt." 308 112 309 #: build/php/class-help.php:164php/class-help.php:164113 #: php/class-help.php:164 310 114 msgid "Displays the video with a fixed width and height." 311 115 msgstr "Stellt das Video mit einer absoluten Höhe und Breite dar." 312 116 313 #: build/php/class-settings.php:169 php/class-settings.php:169 117 #: php/class-settings.php:50 118 msgid "Display mode" 119 msgstr "Modus" 120 121 #: php/class-settings.php:58 122 msgid "Display Conditions" 123 msgstr "Konditionen" 124 125 #: php/class-settings.php:68 126 msgid "Video Sizing" 127 msgstr "Videogröße" 128 129 #: php/class-settings.php:77 130 msgid "Video Align" 131 msgstr "Positionierung" 132 133 #: php/class-settings.php:86 134 msgid "Default Arguments" 135 msgstr "Parameter" 136 137 #: php/class-settings.php:95 138 msgid "Support" 139 msgstr "Support" 140 141 #: php/class-settings.php:116 142 msgid "To display your featured videos you can either make use of the automatic replacement, use the %s or manually edit your theme's source files to make use of the plugins PHP-functions." 143 msgstr "Um die Artikelvideos anzuzeigen kannst du entweder das automatische Ersetzen der Artikelbilder nutzen, auf den %s zurückgreifen oder manuel die PHP-Funktionen in deine Theme Dateien integrieren." 144 145 #: php/class-settings.php:117 146 msgid "For more information about Shortcode and PHP functions see the %sContextual Help%s." 147 msgstr "Für mehr Informationen über den Shortcode und die PHP-Funktionen schaue in die %sHilfe%s." 148 149 #: php/class-settings.php:125 150 msgid "The current theme does not support featured images." 151 msgstr "Das aktuelle Theme unterstützt keine Beitragsbilder." 152 153 #: php/class-settings.php:128 154 msgid "To display Featured Videos you need to use the %1$sShortcode%2$s or %1$sPHP functions%2$s." 155 msgstr "Um Beitragsvideos darzustellen musst du leider den %1$sShortcode%2$s oder die %1$sPHP-Funktionen%2$s nutzen." 156 157 #: php/class-settings.php:151 158 msgid "Replace featured image automatically." 159 msgstr "Beitragsbild automatisch ersetzen." 160 161 #: php/class-settings.php:152 162 msgid "Replace featured image on click." 163 msgstr "Beitragsbild bei anklicken ersetzen." 164 165 #: php/class-settings.php:153 166 msgid "Open video overlay when featured image is clicked." 167 msgstr "Video in Overlay darstellen." 168 169 #: php/class-settings.php:154 170 msgid "Manual: PHP-functions or shortcodes." 171 msgstr "Manuell: PHP-Funktionen oder Shortcode." 172 173 #: php/class-settings.php:160 174 msgid "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality." 175 msgstr "Automatische Integration (Optionen 1 bis 3) benötigen ein Theme das die nativen WordPress %sBeitragsbild%s Funktionen nutzt." 176 177 #: php/class-settings.php:169 314 178 msgid "Always use replace mode when viewing %ssingle%s posts and pages." 315 179 msgstr "Auf %seinzelnen%s Seiten immer \"automatisch ersetzen\" nutzen." 316 180 317 #: build/php/class-settings.php:225 php/class-settings.php:225 181 #: php/class-settings.php:203 182 msgid "View options are not available in manual mode." 183 msgstr "Darstellungsoptionen sind im manuellen Modus nicht verfügbar." 184 185 #: php/class-settings.php:213 186 msgid "Apply display mode..." 187 msgstr "Darstellungsmodus anwenden..." 188 189 #: php/class-settings.php:219 190 msgid "when viewing %ssingle%s posts and pages %s" 191 msgstr "wenn %seinzelne%s Beiträge oder Seiten angeschaut werden %s" 192 193 #: php/class-settings.php:225 318 194 msgid "when on the %spost index page%s %s" 319 195 msgstr "wenn auf der %sIndex-Seite%s %s" 320 196 321 #: build/php/class-settings.php:231php/class-settings.php:231197 #: php/class-settings.php:231 322 198 msgid "when inside the %smain query%s of each page %s" 323 199 msgstr "wenn innerhalb des %Main-Queries%s einer jeden Seite %s" 324 200 325 #: build/php/class-settings.php:237php/class-settings.php:237201 #: php/class-settings.php:237 326 202 msgid "when displaying %ssticky%s posts." 327 203 msgstr "wenn ein %ssticky%s Post dargestellt wird." 328 204 329 #: build/php/class-settings.php:249 php/class-settings.php:249 205 #: php/class-settings.php:242 206 msgid "when displaying not %ssticky%s posts." 207 msgstr "wenn nicht %sangeheftete%s Beiträge angezeigt werden." 208 209 #: php/class-settings.php:249 330 210 msgid "If none of the above options is selected the display mode will be applied whenever possible." 331 211 msgstr "Wenn keine der obenstehenden Optionen gewählt ist, wird der festgelegte Darstellungsmodus immer wenn möglich angewendet." 332 212 333 #: build/php/class-settings.php:213 php/class-settings.php:213 334 msgid "Apply display mode..." 335 msgstr "Darstellungsmodus anwenden..." 336 337 #: build/php/class-settings.php:219 php/class-settings.php:219 338 msgid "when viewing %ssingle%s posts and pages %s" 339 msgstr "wenn %seinzelne%s Beiträge oder Seiten angeschaut werden %s" 340 341 #: build/php/class-backend.php:662 php/class-backend.php:662 342 msgid "Remove featured image" 343 msgstr "Beitragsbild entfernen" 344 345 #: build/php/class-settings.php:242 php/class-settings.php:242 346 msgid "when displaying not %ssticky%s posts." 347 msgstr "wenn nicht %sangeheftete%s Beiträge angezeigt werden." 348 213 #: php/class-settings.php:274 214 msgid "Responsive" 215 msgstr "Dynamisch" 216 217 #: php/class-settings.php:281 218 msgid "Width in pixels:" 219 msgstr "Breite in Pixeln:" 220 221 #: php/class-settings.php:298 222 msgid "The %1$sresponsive%2$s setting does not work when using the %1$soverlay%2$s display mode and might break completly in some themes - in such cases you should use a fixed width instead." 223 msgstr "Die %1$dynamisch%2$s Einstellung funktioniert nicht in allen Themes und speziell auch nicht im %1$sOverlay%2$s-Modus. In dem Fall muss eine absolute Breite angegeben werden." 224 225 #: php/class-settings.php:319 226 msgid "left" 227 msgstr "links" 228 229 #: php/class-settings.php:320 230 msgid "center" 231 msgstr "zentriert" 232 233 #: php/class-settings.php:321 234 msgid "right" 235 msgstr "rechts" 236 237 #: php/class-settings.php:345 238 msgid "Not all of the following options might be supported by all providers." 239 msgstr "Nicht alle der folgenden Einstellungen werden von allen Providern unterstützt." 240 241 #: php/class-settings.php:353 242 msgid "Loop" 243 msgstr "Dauerschleife" 244 245 #: php/class-settings.php:360 246 msgid "Always autoplay." 247 msgstr "Immer automatisch abspielen." 248 249 #: php/class-settings.php:361 250 msgid "Autoplay when..." 251 msgstr "Automatisch abspielen, wenn..." 252 253 #: php/class-settings.php:368 254 msgid "... lazy loading videos." 255 msgstr "... Videos nachträglich geladen werden." 256 257 #: php/class-settings.php:370 258 msgid "... viewing %ssingle%s posts and pages." 259 msgstr "... %seinzelne%s Posts oder Seiten angezeigt werden." 260 261 #: php/class-settings.php:380 262 msgid "If the owner of a video is a Plus member, some of these settings may be overridden by their preferences." 263 msgstr "Wenn der Videoeigentümer Vimeo-Plus Mitglied ist, kann er die folgenden Einstellungen für sein Video überschreiben." 264 265 #: php/class-settings.php:395 266 msgid "Hide user's portrait" 267 msgstr "Nutzerbild verbergen." 268 269 #: php/class-settings.php:399 270 msgid "Hide video title" 271 msgstr "Videotitel verbergen." 272 273 #: php/class-settings.php:403 274 msgid "Hide video byline" 275 msgstr "Erstellerzeile verbergen." 276 277 #: php/class-settings.php:416 278 msgid "Light theme" 279 msgstr "Helles Theme." 280 281 #: php/class-settings.php:420 282 msgid "White highlight color" 283 msgstr "Weiße Betonungsfarbe." 284 285 #: php/class-settings.php:422 286 msgid "Hide YouTube logo" 287 msgstr "YouTube Logo verbergen." 288 289 #: php/class-settings.php:425 290 msgid "Hide annotations" 291 msgstr "Anmerkungen verbergen." 292 293 #: php/class-settings.php:429 php/class-settings.php:479 294 msgid "Hide related videos" 295 msgstr "Verwandte Videos verbergen." 296 297 #: php/class-settings.php:433 298 msgid "Disallow fullscreen" 299 msgstr "Vollbildmodus unterdrücken." 300 301 #: php/class-settings.php:437 php/class-settings.php:475 302 msgid "Hide video info" 303 msgstr "Videoinfo verbergen." 304 305 #: php/class-settings.php:439 306 msgid "Enable JavaScript API" 307 msgstr "JavaScript API aktivieren." 308 309 #: php/class-settings.php:471 310 msgid "Hide DailyMotion logo" 311 msgstr "DailyMotion Logo verbergen." 312 313 #: php/class-settings.php:483 314 msgid "Turn HD on by default" 315 msgstr "HD automatisch einschalten." 316 317 #: php/class-settings.php:502 318 msgid "If you have found a bug or think a specific feature is missing, %slet me know%s in the support forum. Like this plugin? %sRate it%s or %sbuy me a cookie%s!" 319 msgstr "Wenn du einen Fehler gefunden hast oder eine bestimmte Funktion vermisst, %ssag im Support-Forum Bescheid%s. Dir gefällt das Plugin? %sHinterlasse eine Bewertung%s oder %sspende für die Entwicklung%s!" 320 321 #. Plugin URI of the plugin/theme 322 msgid "http://yrnxt.com/wordpress/featured-video-plus/" 323 msgstr "http://yrnxt.com/wordpress/featured-video-plus/" 324 325 #. Description of the plugin/theme 326 msgid "Add Featured Videos to your posts and pages." 327 msgstr "Füge deinen Beiträgen und Seiten Beitragsvideos hinzu." 328 329 #. Author of the plugin/theme 330 msgid "Alexander Höreth" 331 msgstr "Alexander Höreth" 332 333 #. Author URI of the plugin/theme 334 msgid "http://yrnxt.com" 335 msgstr "http://yrnxt.com" -
featured-video-plus/trunk/php/class-backend.php
r1457131 r1555602 136 136 */ 137 137 public function metabox_content() { 138 wp_nonce_field( FVP_NAME . FVP_VERSION, 'fvp_nonce' );139 140 // Get current post's id.141 138 $post_id = isset( $_GET['post'] ) ? $_GET['post'] : $GLOBALS['post']->ID; 142 143 139 $options = get_option( 'fvp-settings' ); 144 140 $meta = get_post_meta( $post_id, '_fvp_video', true ); 141 145 142 $has_post_video = has_post_video( $post_id ); 146 143 … … 188 185 $content .= '</div>'; 189 186 187 188 189 190 191 192 193 194 195 196 197 198 190 199 // 'Current theme does not support Featured Images' warning. 191 200 if ( … … 193 202 'manual' !== $options['mode'] 194 203 ) { 195 $content .= '< p class="fvp-warning description">';204 $content .= '<>'; 196 205 $content .= sprintf( 197 206 '<span style="font-weight: bold;">%s</span> ', … … 212 221 '</a>' 213 222 ); 214 '</p> ';223 '</p>'; 215 224 } 216 225 217 226 echo "\n\n\n<!-- Featured Video Plus Metabox -->\n"; 227 218 228 echo $content; 219 echo " <!-- Featured Video Plus Metabox End-->\n\n\n";229 echo "<!-- Featured Video Plus Metabox End-->\n\n\n"; 220 230 } 221 231 … … 229 239 * @param {int} $post_id 230 240 */ 231 public function metabox_save( $post_id ){ 232 if ( ! self::has_valid_nonce( $_POST ) ) { 233 return false; 234 } 241 public function metabox_save( $post_id ) { 242 self::verify_nonce( $post_id ); 235 243 236 244 if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || … … 260 268 */ 261 269 public function metabox_save_ajax() { 262 if ( ! self::has_valid_nonce( $_POST ) || empty( $_POST['id'] ) ) { 270 $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1; 271 if ( 272 $post_id === -1 || 273 ! self::verify_nonce( $post_id, true ) || 274 ! current_user_can( 'edit_post', $post_id ) 275 ) { 263 276 wp_send_json_error(); 264 277 } 265 278 266 279 $post = array( 267 'id' => (int) $_POST['id'],280 'id' => , 268 281 'fvp_video' => ! empty( $_POST['fvp_video'] ) ? $_POST['fvp_video'] : '', 269 282 'fvp_set_featimg' => … … 271 284 ); 272 285 273 // this also verifies the nonce274 286 $meta = $this->save( $post ); 275 287 … … 279 291 ); 280 292 281 if ( has_post_video( $post['id'] ) ) { 282 $video = get_the_post_video( $post['id'], array( 256, 144 ) ); 283 $response = array( 284 'type' => 'update', 285 'valid' => isset( $meta['valid'] ) ? $meta['valid'] : null, 286 'video' => $video, 287 'img' => $img, 288 'provider' => isset( $meta['provider'] ) ? $meta['provider'] : null 289 ); 290 } else { 291 $response = array( 292 'task' => 'remove', 293 'valid' => isset( $meta['valid'] ) ? $meta['valid'] : null, 294 'img' => $img, 295 ); 296 } 293 $response = array( 294 'valid' => isset( $meta['valid'] ) ? $meta['valid'] : null, 295 'video' => get_the_post_video( $post['id'], array( 256, 144 ) ), 296 'img' => $img, 297 'full' => $meta['full'], 298 'provider' => isset( $meta['provider'] ) ? $meta['provider'] : null 299 ); 297 300 298 301 wp_send_json_success( $response ); … … 313 316 314 317 // parse video url 315 $ url= ! empty( $post['fvp_video'] ) ? trim( $post['fvp_video'] ) : '';318 $ = ! empty( $post['fvp_video'] ) ? trim( $post['fvp_video'] ) : ''; 316 319 317 320 // Was this a force-auto-set featimg action? … … 321 324 // URL is empty AND did not change. 322 325 if ( ! $setimg && ( 323 ( ! empty( $meta['full'] ) && $ url== $meta['full'] ) ||324 ( empty( $meta ['full'] ) && empty( $url) )326 ( ! empty( $meta['full'] ) && $ == $meta['full'] ) || 327 ( empty( $meta ) ) 325 328 ) ) { 326 329 return false; … … 328 331 329 332 // there was a video and we want to delete it 330 if ( ! empty( $meta['full'] ) && empty( $url) ) {333 if ( ) ) { 331 334 delete_post_meta( $post['id'], '_fvp_video' ); 332 335 if ( get_post_thumbnail_id( $post['id'] ) == $meta['img'] ) { … … 336 339 } 337 340 338 $data = $this->get_video_data( $ url);341 $data = $this->get_video_data( $ ); 339 342 340 343 // Do we have a screen capture to pull? … … 356 359 $meta = array_merge( 357 360 array( 358 'full' => $url, 359 'img' => ! empty( $img ) ? $img : null, 360 'valid' => 1, // can be overwritten by $data 361 'provider' => 'raw', // " 361 'valid' => true, // can be overwritten by $data 362 'img' => ! empty( $img ) ? $img : null, 362 363 ), 363 364 $data … … 374 375 * @since 1.5.0 375 376 * 376 * @param {string} $ urlThe video URL377 * @param {string} $ The video URL 377 378 * @return {assoc} Associative array containing the video information data 378 379 */ 379 private function get_video_data( $url ) { 380 private function get_video_data( $video ) { 381 $video = trim( self::kses_video( stripslashes( $video ) ) ); 382 $provider = null; 380 383 $data = array(); 381 384 382 385 $local = wp_upload_dir(); 383 $islocal = strpos( $url, $local['baseurl'] ); 384 385 // handle local videos 386 $islocal = strpos( $video, $local['baseurl'] ); 386 387 if ( false !== $islocal ) { 387 388 $provider = 'local'; 388 389 // handle external videos389 } elseif ( $video !== strip_tags( $video ) ) { 390 390 391 } else { 391 $raw = $this->oembed->request( $url ); 392 393 // If no provider is returned the URL is invalid 394 if ( empty( $raw ) || empty( $raw->provider_name ) ) { 395 return array( 'valid' => false ); 392 $v = $this->oembed->request( $video ); 393 if ( ! empty( $raw ) && ! empty( $raw->provider_name ) ) { 394 $provider = strtolower( $v->provider_name ); 395 396 $data = array( 397 'id' => null, 398 'provider' => $provider, 399 'title' => ! empty( $v->title ) ? $v->title : null, 400 'author' => ! empty( $v->author_name ) ? $v->author_name : null, 401 'description' => ! empty( $v->description ) ? $v->description : null, 402 'img_url' => ! empty( $v->thumbnail_url ) ? $v->thumbnail_url : null, 403 'filename' => ! empty( $v->title ) ? $v->title : null, 404 'full' => $video, 405 'parameters' => $this->oembed->get_args( $video, $provider ), 406 ); 396 407 } 397 398 $provider = strtolower( $raw->provider_name ); 399 400 $data = array( 401 'id' => null, 402 'provider' => $provider, 403 'title' => ! empty( $raw->title ) ? $raw->title : null, 404 'author' => ! empty( $raw->author_name ) ? $raw->author_name : null, 405 'description' => ! empty( $raw->description ) ? $raw->description : null, 406 'img_url' => ! empty( $raw->thumbnail_url ) ? $raw->thumbnail_url : null, 407 'filename' => ! empty( $raw->title ) ? $raw->title : null, 408 ); 409 410 switch ( $provider ) { 411 case 'dailymotion': 412 $data['id'] = $this->oembed->get_video_id( $url ); 413 $img_url = $this->oembed->get_thumbnail_url( $provider, $data['id'] ); 414 if ( false !== $img_url ) { 415 $data['img_url'] = $img_url; 416 } 417 break; 418 } 419 } 420 421 $data['parameters'] = $this->oembed->get_args( $url, $provider ); 422 423 // provider specific handling 408 } 409 424 410 switch ( $provider ) { 425 426 // local video 411 case 'dailymotion': 412 $id = $this->oembed->get_video_id( $video ); 413 $img = $this->oembed->get_thumbnail_url( $provider, $id ); 414 return array_merge( $data, array( 415 'id' => $id, 416 'img_url' => $img !== false ? $img : null, 417 ) ); 418 427 419 case 'local': 420 428 421 $ext_legal = array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' ); 429 $ext = pathinfo( $url, PATHINFO_EXTENSION ); 430 431 // check if extension is legal 422 $ext = pathinfo( $video, PATHINFO_EXTENSION ); 432 423 if ( empty( $ext ) || ! in_array( $ext, $ext_legal ) ) { 433 return array( 'valid' => false ); 424 return array( 425 'full' => $video, 426 ); 434 427 } 435 428 436 $data =array(437 'provider' => 'local',438 'id' => self::get_post_by_url( $url),439 ' url' => $url,429 array( 430 'provider' => , 431 'id' ), 432 ', 440 433 ); 441 break; 442 } 443 444 return ! empty( $data ) ? $data : false; 434 435 case 'raw': 436 return array( 437 'provider' => $provider, 438 'full' => $video, 439 ); 440 441 default: 442 if ( ! empty( $data ) ) { 443 return $data; 444 } else { 445 return array( 446 'valid' => false, 447 'full' => $video, 448 ); 449 } 450 } 445 451 } 446 452 … … 548 554 */ 549 555 public function ajax_get_embed() { 550 if ( ! self::has_valid_nonce( $_POST ) || empty( $_POST['id'] ) ) { 556 $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1; 557 if ( 558 $post_id === -1 || 559 ! self::verify_nonce( $post_id, true ) 560 ) { 551 561 wp_send_json_error(); 552 562 } 553 563 554 // Parse post id. 555 $id = (int) $_POST['id']; 556 557 if ( has_post_video( $id ) ) { 564 if ( has_post_video( $post_id ) ) { 558 565 // Return featured video html as requested. 559 $video = $this->get_the_post_video( $ id, null, true );566 $video = $this->get_the_post_video( $id, null, true ); 560 567 wp_send_json_success( $video ); 561 568 } else { 562 569 // Post has no video, return featured image html. 563 $image = get_the_post_thumbnail( $ id );570 $image = get_the_post_thumbnail( $id ); 564 571 wp_send_json_success( $image ); 565 572 } … … 577 584 */ 578 585 public function ajax_remove_img() { 579 if ( ! self::has_valid_nonce( $_POST ) || empty( $_POST['id'] ) ) { 586 $post_id = ! empty( $_POST['id'] ) ? (int) $_POST['id'] : -1; 587 if ( 588 $post_id === -1 || 589 ! self::verify_nonce( $post_id ) || 590 ! current_user_can( 'edit_post', $post_id ) 591 ) { 580 592 wp_send_json_error(); 581 593 } 582 594 583 // Retrieve post id and check user capabilities.584 $id = (int) $_POST['id'];585 if ( ! current_user_can( 'edit_post', $id ) ) {586 wp_send_json_error();587 }588 595 589 596 // Retrieve featured video metadata. 590 $meta = get_post_meta( $ id, '_fvp_video', true );597 $meta = get_post_meta( $id, '_fvp_video', true ); 591 598 592 599 // Delete the image from database if feasible. This also again tries to 593 600 // remove the link of the featured image to the post although it will 594 601 // probably already be unlinked by WordPress internal functionality. 595 $this->delete_featured_image( $ id, $meta );602 $this->delete_featured_image( $id, $meta ); 596 603 597 604 // Remember that we do not want to set a featured image automatically for … … 603 610 604 611 // Save meta. 605 update_post_meta( $ id, '_fvp_video', $meta );612 update_post_meta( $id, '_fvp_video', $meta ); 606 613 607 614 // Respond to the client. 608 $html = _wp_post_thumbnail_html( get_post_thumbnail_id( $id ), $id ); 609 wp_send_json_success( $html ); 615 wp_send_json_success( 616 _wp_post_thumbnail_html( get_post_thumbnail_id( $post_id ), $post_id ) 617 ); 610 618 } 611 619 … … 632 640 'featured-video-plus' 633 641 ), 634 '<a href="#" onclick="jQuery(\'.fvp-video\').val(\'http ://youtu.be/CfNHleTEpTI\').trigger(\'blur\'); return false;">',642 '<a href="#" onclick="jQuery(\'.fvp-video\').val(\'http://youtu.be/CfNHleTEpTI\').trigger(\'blur\'); return false;">', 635 643 '</a>' 636 644 ) . '</p><p>' . sprintf( … … 728 736 * Gets post id by it's url / guid. 729 737 * 730 * @see http ://codex.wordpress.org/Class_Reference/wpdb738 * @see http://codex.wordpress.org/Class_Reference/wpdb 731 739 * @since 1.0 732 740 * … … 747 755 748 756 /** 749 * Check the given assoc array for a 'fvp_nonce' field and check if this 750 * field contains a valid nonce. 751 * 752 * @param {assoc} $post_data 753 * @return boolean 754 */ 755 private static function has_valid_nonce( $post_data ) { 757 * Verify the current request's nonce. Nonce is expected in the REQUEST 758 * object's `fvp_nonce` field. 759 * 760 * @param int/string $identifier nonce identifier 761 * @param bool $bool whether to return a boolean or strictly exit 762 * @return bool/none Return bool if $bool is set to true 763 */ 764 private static function verify_nonce( $identifier, $bool = false ) { 765 $action = self::get_nonce_action( $identifier ); 766 756 767 if ( 757 ! isset( $ post_data['fvp_nonce'] ) ||758 ! wp_verify_nonce( $ post_data['fvp_nonce'], FVP_NAME . FVP_VERSION)768 ! isset( $] ) || 769 ! wp_verify_nonce( $ ) 759 770 ) { 771 772 773 774 775 760 776 return false; 761 777 } … … 764 780 } 765 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 766 830 767 831 /** -
featured-video-plus/trunk/php/class-frontend.php
r1245652 r1555602 88 88 wp_localize_script( 'fvp-frontend', 'fvpdata', array( 89 89 'ajaxurl' => admin_url( 'admin-ajax.php' ), 90 'nonce' => wp_create_nonce( FVP_NAME . FVP_VERSION),90 'nonce' => wp_create_nonce( ), 91 91 'fitvids' => ! empty( $options['sizing']['responsive'] ) && 92 92 $options['sizing']['responsive'], -
featured-video-plus/trunk/php/class-help.php
r1172119 r1555602 33 33 'featured-video-plus' 34 34 ), 35 '<a href="https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F" target="_blank" >',35 '<a href="https://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F" target="_blank">', 36 36 '</a>' 37 37 ) ); … … 60 60 'featured-video-plus' 61 61 ), 62 '<a href="http ://goo.gl/yxov27" target="_blank">',62 '<a href="http">', 63 63 '</a>' 64 64 ) … … 117 117 'featured-video-plus' 118 118 ), 119 '<a href="http ://codex.wordpress.org/Post_Thumbnails#Function_Reference" target="_blank">' . esc_html__( 'Featured Image' ) . ' ',119 '<a href="http">' . esc_html__( 'Featured Image' ) . ' ', 120 120 '</a>' 121 121 ) ); … … 123 123 // WordPress Featured Image functions 124 124 $content[] = FVP_HTML::unordered_list( array( 125 '<code><a href="https://developer.wordpress.org/reference/functions/the_post_thumbnail/" target="_blank" >get_the_post_thumbnail</a></code>',126 '<code><a href="https://developer.wordpress.org/reference/functions/wp_get_attachment_image/" target="_blank" >wp_get_attachment_image</a></code>',125 '<code><a href="https://developer.wordpress.org/reference/functions/the_post_thumbnail/" target="_blank">get_the_post_thumbnail</a></code>', 126 '<code><a href="https://developer.wordpress.org/reference/functions/wp_get_attachment_image/" target="_blank">wp_get_attachment_image</a></code>', 127 127 ) ); 128 128 -
featured-video-plus/trunk/php/class-main.php
r1245652 r1555602 175 175 $attr 176 176 ) { 177 $size = self::get_size();178 179 177 $options = get_option( 'fvp-settings' ); 180 178 $mode = ! empty( $options['mode'] ) ? $options['mode'] : null; 181 179 $conditions = ! empty( $options['conditions'] ) ? 182 180 $options['conditions'] : null; 183 $single_replace = is_sing le() &&181 $single_replace = is_sing() && 184 182 ! empty( $options['single_replace'] ) && $options['single_replace']; 185 183 … … 281 279 $options = get_option( 'fvp-settings' ); 282 280 283 // fixed size requested as array( width => #, height => # ) or array( #, # )284 281 if ( is_array( $size ) ) { 282 285 283 $width = isset( $size['width'] ) && is_numeric( $size['width'] ) ? 286 284 $size['width'] : … … 290 288 ( isset( $size[1] ) && is_numeric( $size[1] ) ? $size[1] : null ); 291 289 292 // size requested using a string pointing to a WordPress preset293 290 } elseif ( is_string( $size ) ) { 291 294 292 global $_wp_additional_image_sizes; 295 293 $presets = get_intermediate_image_sizes(); … … 306 304 } 307 305 308 // single number provided - use it for the width309 306 } elseif ( is_numeric( $size ) ) { 307 310 308 $width = $size; 311 309 } … … 317 315 318 316 if ( empty( $height ) ) { 319 // calculate height relative to width317 // 320 318 $height = ! empty( $original ) ? 321 319 round( $original['height'] * ($width / $original['width']) ) : … … 364 362 365 363 /** 364 365 366 367 368 369 370 371 372 373 374 366 375 * Check a given set of display conditions if one or more of them hold. If 367 376 * an empty set is given, return true. … … 429 438 ! empty( $options['autoplay']['single'] ) && 430 439 $options['autoplay']['single'] && 431 is_sing le()440 is_sing() 432 441 ) { 433 442 return true; -
featured-video-plus/trunk/php/class-oembed.php
r1457131 r1555602 348 348 private function filter_legal_args( $provider, $args ) { 349 349 $legals = array( 350 351 352 353 350 354 351 355 // YouTube.com … … 428 432 429 433 if ( ! empty( $legals[ $provider ] ) ) { 430 foreach ( $legals[ $provider ] AS $key => $value ) { 431 if ( array_key_exists( $value, $args ) && 432 ! is_null( $args[ $value ] ) 433 ) { 434 $key = is_numeric( $key ) ? $value : $key; 435 $result[ $key ] = urlencode( $args[ $value ] ); 434 $combinedlegals = array_merge( $legals['default'], $legals[ $provider ] ); 435 foreach ( $combinedlegals AS $key => $val ) { 436 if ( array_key_exists( $val, $args ) && ! is_null( $args[ $val ] ) ) { 437 $key = is_numeric( $key ) ? $val : $key; 438 $result[ $key ] = urlencode( $args[ $val ] ); 436 439 } 437 440 } -
featured-video-plus/trunk/php/class-settings.php
r1202444 r1555602 27 27 * Initializes the plugin settings section, the settings fields and registers the options field and save function. 28 28 * 29 * @see http ://codex.wordpress.org/Settings_API29 * @see http://codex.wordpress.org/Settings_API 30 30 * @since 1.0 31 31 */ … … 77 77 esc_html__( 'Video Align', 'featured-video-plus' ), 78 78 array( $this, 'alignment' ), 79 80 81 82 83 84 85 86 87 79 88 self::$page, 80 89 self::$section … … 158 167 159 168 echo FVP_HTML::description( 160 sprintf( esc_html__( "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality.", 'featured-video-plus' ), '<a href="http ://codex.wordpress.org/Post_Thumbnails" target="_blank">', '</a>' )161 ); 162 163 // Always replace on is_sing le() ?169 sprintf( esc_html__( "Automatic integration (options 1-3) requires your theme to make use of WordPress' native %sfeatured image%s functionality.", 'featured-video-plus' ), '<a href="http">', '</a>' ) 170 ); 171 172 // Always replace on is_sing() ? 164 173 echo FVP_HTML::conditional( 165 174 '<br />' . … … 171 180 'featured-video-plus' 172 181 ), 173 '<a href="http ://codex.wordpress.org/Function_Reference/is_single" target="_blank">',182 '<a href="http">', 174 183 '</a>' 175 184 ), … … 186 195 187 196 /** 188 * Video replace condition option like is_sing leor is_home.197 * Video replace condition option like is_sing or is_home. 189 198 * 190 199 * @since 2.0.0 … �� 218 227 'single' => sprintf( 219 228 esc_html__( 'when viewing %ssingle%s posts and pages %s', 'featured-video-plus' ), 220 '<a href="http ://codex.wordpress.org/Function_Reference/is_single" target="_blank">',229 '<a href="http">', 221 230 '</a>', 222 231 $or … … 224 233 'home' => sprintf( 225 234 esc_html__( 'when on the %spost index page%s %s', 'featured-video-plus' ), 226 '<a href="http ://codex.wordpress.org/Function_Reference/is_home" target="_blank">',235 '<a href="http">', 227 236 '</a>', 228 237 $or … … 230 239 'main_query' => sprintf( 231 240 esc_html__( 'when inside the %smain query%s of each page %s', 'featured-video-plus' ), 232 '<a href="https://developer.wordpress.org/reference/functions/is_main_query/" target="_blank" >',241 '<a href="https://developer.wordpress.org/reference/functions/is_main_query/" target="_blank">', 233 242 '</a>', 234 243 $or … … 236 245 'sticky' => sprintf( 237 246 esc_html__( 'when displaying %ssticky%s posts.', 'featured-video-plus' ), 238 '<a href="http ://codex.wordpress.org/Function_Reference/is_sticky" target="_blank">',247 '<a href="http">', 239 248 '</a>' 240 249 ), 241 250 '!sticky' => sprintf( 242 251 esc_html__( 'when displaying not %ssticky%s posts.', 'featured-video-plus' ), 243 '<a href="http ://codex.wordpress.org/Function_Reference/is_sticky" target="_blank">',252 '<a href="http">', 244 253 '</a>' 245 254 ) … … 301 310 array( 'fvp_warning' ) 302 311 ); 303 304 312 } 305 313 … … 322 330 ), 323 331 ! empty( $options['alignment'] ) ? $options['alignment'] : 'center' 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 324 362 ); 325 363 } … … 369 407 'single' => sprintf( 370 408 esc_html__( '... viewing %ssingle%s posts and pages.', 'featured-video-plus' ), 371 '<a href="http ://codex.wordpress.org/Function_Reference/is_single" target="_blank">', '</a>'409 '<a href="http">', '</a>' 372 410 ), 373 411 ), … … 504 542 'featured-video-plus' 505 543 ), 506 '<a href="https://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">',544 '<a href="https://wordpress.org/support/plugin/featured-video-plus#plugin-title" title="Featured Video Plus Support Forum on WordPress.org" target="_blank" style="font-weight: bold;">', 507 545 '</a>', 508 '<a href="https://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">',546 '<a href="https://wordpress.org/support/view/plugin-reviews/featured-video-plus#plugin-title" title="Rate Featured Video Plus on WordPress.org" target="_blank" style="font-weight: bold;">', 509 547 '</a>', 510 '<a href="https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6" title="Gift to the developer!" target="_blank" style="font-weight: bold;">',548 '<a href="https://paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6" title="Gift to the developer!" target="_blank" style="font-weight: bold;">', 511 549 '</a>' 512 550 ) … … 545 583 '!sticky' => 'BOOLEAN', 546 584 ), 547 'alignment' => '(left|center|right)',548 585 'sizing' => array( 549 586 'responsive' => 'BOOLEAN', 550 587 'width' => $patterns['number'], 588 589 590 591 592 593 551 594 ), 552 595 'autoplay' => array( -
featured-video-plus/trunk/php/inc-upgrade.php
r1202444 r1555602 221 221 unset( $options['default_args']['general']['autoplay'] ); 222 222 223 224 225 226 227 228 229 223 230 224 231 default: -
featured-video-plus/trunk/readme.txt
r1457131 r1555602 6 6 Author: Alexander Höreth 7 7 Author URI: http://yrnxt.com/ 8 Donate link: https://www.paypal. com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM68 Donate link: https://www.paypal. 9 9 License: GPL-2.0 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 Requires at least: 3.7 12 Tested up to: 4. 513 Stable tag: 2. 2.312 Tested up to: 4. 13 Stable tag: 2. 14 14 15 15 Add Featured Videos to your posts and pages. Works like magic with most themes which use Featured Images. Local Media, YouTube, Vimeo and many more. … … 28 28 3. manually make use of the __PHP-functions__ in your theme's source files. 29 29 30 31 30 32 > <strong>Theme compatibility</strong><br> 31 33 > Sadly many themes do not follow the WordPress standards and implement their own fancy functions for displaying featured images - those very likely break this plugin. Check out the [FAQ](https://wordpress.org/plugins/featured-video-plus/faq/). Another common problem are sliders: Videos, in general, do not like sliders at all. … … 38 40 39 41 > <strong>Support</strong><br> 40 > I do read all support questions in the [forums](http s://wordpress.org/support/plugin/featured-video-plus) but cannot reply to all of them. The plugin is an unpaid side project and full support would require more time than I can invest for free for over 10k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements.42 > I do read all support questions in the [forums](http0k active installs. If you really need help, consider [buying me a cookie](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=AD8UKMQW2DMM6) - best way to attract my attention and to support future enhancements. 41 43 42 44 … … 87 89 88 90 = Why do I just get text back after adding an URL to the Featured Video input? = 89 If the plugin just displays the URL back as text it probably does not recognize that it comes from a video provider. Try inserting the raw embed code instead and[check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported.91 If the plugin just [check the docs](http://codex.wordpress.org/Embeds#Okay.2C_So_What_Sites_Can_I_Embed_From.3F) to see which providers are supported. 90 92 91 93 = How do I use my local videos? = 92 94 Click the small media icon in the Featured Video input box on the post edit screen and upload your video or choose it from the media library. WordPress does not support all formats tho, [check this table](http://www.mediaelementjs.com/#devices) for details. 93 95 94 = Why do I not see a featu erd video or image on the frontend at all? =95 For the videos to be automatically displayed you need to define a Featured Image. This image will never be shown if a video is available. If your theme does not support featured images the plugin also has no chance of working out of the box.96 = Why do I not see a featud video or image on the frontend at all? = 97 For the videos to be automatically displayed you need to define a Featured Image. . If your theme does not support featured images the plugin also has no chance of working out of the box. 96 98 97 99 = Why does the frontend still display the featured image although I added a featured video to the post? = … … 101 103 Take a look at your media settings and try using a fixed width instead of responsive sizing. 102 104 105 106 107 103 108 = Can I help translating the plugin? = 104 Yes, please! Check out the public [Featured Video Plus Translation Project](https://poeditor.com/join/project?hash=WlyLh0cFO3).109 Yes, please! Check out the ). 105 110 106 111 107 112 108 113 == Changelog == 114 115 116 117 118 119 120 109 121 110 122 = 2.2.3: 2016-07-19 = -
featured-video-plus/trunk/styles/backend.css
r1181216 r1555602 20 20 border: 1px solid #808080; 21 21 background-color: #fff; 22 23 24 25 26 22 27 } 23 28 #featured-video-plus-box .fvp-warning { -
featured-video-plus/trunk/styles/backend.less
r1457131 r1555602 24 24 border: 1px solid #808080; 25 25 background-color: #fff; 26 27 28 29 30 26 31 } 27 32
Note: See TracChangeset
for help on using the changeset viewer.