Skip to content

Commit

Permalink
Merge pull request #86 from flowplayer/develop
Browse files Browse the repository at this point in the history
Version 1.10.6
  • Loading branch information
grappler committed Mar 6, 2015
2 parents a78fb10 + d21e041 commit 53fd66f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion flowplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: Flowplayer HTML5 for WordPress
* Plugin URI: http://wordpress.org/plugins/flowplayer5/
* 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.
* Version: 1.10.5
* Version: 1.10.6
* Author: Flowplayer ltd.
* Author URI: http://flowplayer.org/
* Text Domain: flowplayer5
Expand Down
26 changes: 14 additions & 12 deletions frontend/class-flowplayer5-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
class Flowplayer5_Frontend {

public $has_flowplayer_video = '';
public $has_flowplayer_shortcode = '';

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

if ( $embed_library || $embed_script || $embed_skin || $embed_swf ) {
if ( ( $embed_library || $embed_script || $embed_skin || $embed_swf ) && $this->has_flowplayer_video ) {

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

public function has_flowplayer_shortcode() {
if ( is_404() || ! empty( $this->has_flowplayer_shortcode ) ) {
if ( is_404() || isset( $this->has_flowplayer_shortcode ) ) {
return;
}

$post = get_queried_object();
$has_shortcode = array();
$shortcode_args = array();

if ( null !== $post && is_single() ) {
$post_content = isset( $post->post_content ) ? $post->post_content : '';
$shortcode_args = fp5_has_shortcode_arg( $post_content, 'flowplayer' );
foreach ( $shortcode_args as $key => $value ) {
if ( isset( $value['id'] ) ) {
$has_shortcode[ 'id' . $value['id'] ] = $value['id'];
} elseif ( isset( $value['playlist'] ) ) {
$has_shortcode[ 'playlist' . $value['playlist'] ] = $value['playlist'];
if ( isset( $post->post_content ) ) {
$shortcode_args = fp5_has_shortcode_arg( $post->post_content, 'flowplayer' );
if ( is_array( $shortcode_args ) ) {
foreach ( $shortcode_args as $key => $value ) {
if ( isset( $value['id'] ) ) {
$has_shortcode[ 'id' . $value['id'] ] = $value['id'];
} elseif ( isset( $value['playlist'] ) ) {
$has_shortcode[ 'playlist' . $value['playlist'] ] = $value['playlist'];
}
}
}
} else {
Expand Down Expand Up @@ -237,12 +237,14 @@ public function has_flowplayer_video() {
}

$has_video = 'flowplayer5' == get_post_type() || is_active_widget( false, false, 'flowplayer5-video-widget', true );
$has_video = apply_filters( 'fp5_filter_has_shortcode', $has_video );

if ( ! $has_video ) {
$this->has_flowplayer_shortcode();
$has_video = ! empty ( $this->has_flowplayer_shortcode );
}

$this->has_flowplayer_video = apply_filters( 'fp5_filter_has_shortcode', $has_video );
$this->has_flowplayer_video = $has_video;
}

public function is_multiresolution() {
Expand Down
2 changes: 1 addition & 1 deletion includes/class-flowplayer5.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Flowplayer5 {
*
* @var string
*/
protected $plugin_version = '1.10.5';
protected $plugin_version = '1.10.6';

/**
* Player version, used for cache-busting of style and script file references.
Expand Down
2 changes: 1 addition & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function fp5_has_shortcode_arg( $content, $tag ) {
if ( $tag === $shortcode[2] ) {
$shortcode_arg[] = shortcode_parse_atts( $shortcode[3] );
} elseif ( ! empty( $shortcode[5] ) && has_shortcode( $shortcode[5], $tag ) ) {
$shortcode_arg[] = fp5_has_shortcode_arg( $shortcode[5], $tag );
$shortcode_arg = fp5_has_shortcode_arg( $shortcode[5], $tag );
}
}
return $shortcode_arg;
Expand Down
7 changes: 7 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ add_filter( 'fp5_post_meta_defaults', 'fp5_post_meta_defaults' );`

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)

= 1.10.6 - 7 March 2015 =
* fix bug: checking video id with nested shortcodes
* fix bug: Invalid argument supplied for foreach()

= 1.10.5 - 1 March 2015 =
* fix bug: playing videos on different pages
* fix bug: fix issue with videos from Flowplayer Drive
Expand Down Expand Up @@ -394,6 +398,9 @@ We have a lot of plans for this plugin. You can see some of the up and coming fe

== Upgrade Notice ==

= 1.10.6 =
* fix bugs with playing videos

= 1.10.5 =
* fix bugs with Flowplayer Drive and playing videos

Expand Down

0 comments on commit 53fd66f

Please sign in to comment.