Skip to content

Commit 53fd66f

Browse files
committed
Merge pull request #86 from flowplayer/develop
Version 1.10.6
2 parents a78fb10 + d21e041 commit 53fd66f

5 files changed

Lines changed: 24 additions & 15 deletions

File tree

flowplayer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Plugin Name: Flowplayer HTML5 for WordPress
1212
* Plugin URI: http://wordpress.org/plugins/flowplayer5/
1313
* Description: A HTML5 responsive video player plugin. From the makers of Flowplayer. Includes player skins, tracking with Google Analytics, splash images and support for subtitles and multi-resolution videos. You can use your own watermark logo if you own a Commercial Flowplayer license.
14-
* Version: 1.10.5
14+
* Version: 1.10.6
1515
* Author: Flowplayer ltd.
1616
* Author URI: http://flowplayer.org/
1717
* Text Domain: flowplayer5

frontend/class-flowplayer5-frontend.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
class Flowplayer5_Frontend {
2626

2727
public $has_flowplayer_video = '';
28-
public $has_flowplayer_shortcode = '';
2928

3029
/**
3130
* Initialize the plugin by setting localization, filters, and administration functions.
@@ -163,7 +162,7 @@ public function global_config_script() {
163162
$embed_swf = ( ! empty ( $options['swf'] ) ? $options['swf'] : '' );
164163
$asf_js = ( ! empty ( $options['asf_js'] ) ? $options['asf_js'] : '' );
165164

166-
if ( $embed_library || $embed_script || $embed_skin || $embed_swf ) {
165+
if ( ( $embed_library || $embed_script || $embed_skin || $embed_swf ) && $this->has_flowplayer_video ) {
167166

168167
$return = '<!-- flowplayer global options -->';
169168
$return .= '<script>';
@@ -192,22 +191,23 @@ public function global_config_script() {
192191
}
193192

194193
public function has_flowplayer_shortcode() {
195-
if ( is_404() || ! empty( $this->has_flowplayer_shortcode ) ) {
194+
if ( is_404() || isset( $this->has_flowplayer_shortcode ) ) {
196195
return;
197196
}
198197

199198
$post = get_queried_object();
200199
$has_shortcode = array();
201200
$shortcode_args = array();
202201

203-
if ( null !== $post && is_single() ) {
204-
$post_content = isset( $post->post_content ) ? $post->post_content : '';
205-
$shortcode_args = fp5_has_shortcode_arg( $post_content, 'flowplayer' );
206-
foreach ( $shortcode_args as $key => $value ) {
207-
if ( isset( $value['id'] ) ) {
208-
$has_shortcode[ 'id' . $value['id'] ] = $value['id'];
209-
} elseif ( isset( $value['playlist'] ) ) {
210-
$has_shortcode[ 'playlist' . $value['playlist'] ] = $value['playlist'];
202+
if ( isset( $post->post_content ) ) {
203+
$shortcode_args = fp5_has_shortcode_arg( $post->post_content, 'flowplayer' );
204+
if ( is_array( $shortcode_args ) ) {
205+
foreach ( $shortcode_args as $key => $value ) {
206+
if ( isset( $value['id'] ) ) {
207+
$has_shortcode[ 'id' . $value['id'] ] = $value['id'];
208+
} elseif ( isset( $value['playlist'] ) ) {
209+
$has_shortcode[ 'playlist' . $value['playlist'] ] = $value['playlist'];
210+
}
211211
}
212212
}
213213
} else {
@@ -237,12 +237,14 @@ public function has_flowplayer_video() {
237237
}
238238

239239
$has_video = 'flowplayer5' == get_post_type() || is_active_widget( false, false, 'flowplayer5-video-widget', true );
240+
$has_video = apply_filters( 'fp5_filter_has_shortcode', $has_video );
241+
240242
if ( ! $has_video ) {
241243
$this->has_flowplayer_shortcode();
242244
$has_video = ! empty ( $this->has_flowplayer_shortcode );
243245
}
244246

245-
$this->has_flowplayer_video = apply_filters( 'fp5_filter_has_shortcode', $has_video );
247+
$this->has_flowplayer_video = $has_video;
246248
}
247249

248250
public function is_multiresolution() {

includes/class-flowplayer5.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Flowplayer5 {
3131
*
3232
* @var string
3333
*/
34-
protected $plugin_version = '1.10.5';
34+
protected $plugin_version = '1.10.6';
3535

3636
/**
3737
* Player version, used for cache-busting of style and script file references.

includes/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function fp5_has_shortcode_arg( $content, $tag ) {
8383
if ( $tag === $shortcode[2] ) {
8484
$shortcode_arg[] = shortcode_parse_atts( $shortcode[3] );
8585
} elseif ( ! empty( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) {
86-
$shortcode_arg[] = fp5_has_shortcode_arg( $shortcode[5], $tag );
86+
$shortcode_arg = fp5_has_shortcode_arg( $shortcode[5], $tag );
8787
}
8888
}
8989
return $shortcode_arg;

readme.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ add_filter( 'fp5_post_meta_defaults', 'fp5_post_meta_defaults' );`
252252

253253
We have a lot of plans for this plugin. You can see some of the up and coming features in the [roadmap](https://github.com/flowplayer/wordpress-flowplayer/issues?labels=enhancement&page=1&state=open)
254254

255+
= 1.10.6 - 7 March 2015 =
256+
* fix bug: checking video id with nested shortcodes
257+
* fix bug: Invalid argument supplied for foreach()
258+
255259
= 1.10.5 - 1 March 2015 =
256260
* fix bug: playing videos on different pages
257261
* fix bug: fix issue with videos from Flowplayer Drive
@@ -394,6 +398,9 @@ We have a lot of plans for this plugin. You can see some of the up and coming fe
394398

395399
== Upgrade Notice ==
396400

401+
= 1.10.6 =
402+
* fix bugs with playing videos
403+
397404
= 1.10.5 =
398405
* fix bugs with Flowplayer Drive and playing videos
399406

0 commit comments

Comments
 (0)