Skip to content

Commit

Permalink
Fix "Invalid argument supplied for foreach"
Browse files Browse the repository at this point in the history
  • Loading branch information
grappler committed Mar 2, 2015
1 parent 303c744 commit fee31a7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/class-flowplayer5-frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,13 @@ public function has_flowplayer_shortcode() {
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 ( 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

0 comments on commit fee31a7

Please sign in to comment.