Music Player for WooCommerce - Version 1.0.126

Version Description

  • Modifies the playlist shortcode to allow inserting the player in products' pages.
Download this release

Release Info

Developer codepeople
Plugin Icon 128x128 Music Player for WooCommerce
Version 1.0.126
Comparing to
See all releases

Code changes from version 1.0.125 to 1.0.126

Files changed (2) hide show
  1. readme.txt +5 -1
  2. wcmp.php +15 -3
readme.txt CHANGED
@@ -200,6 +200,10 @@ Each time save the data of a product, the files for demo are deleted and generat
200
 
201
  == Changelog ==
202
 
 
 
 
 
203
  = 1.0.125 =
204
 
205
  * Includes a new option in the plugin's settings to allow multiple players to play simultaneously.
@@ -733,6 +737,6 @@ Each time save the data of a product, the files for demo are deleted and generat
733
 
734
  == Upgrade Notice ==
735
 
736
- = 1.0.124 =
737
 
738
  Important note: If you are using the Professional version don't update via the WP dashboard but using your personal update link. Contact us if you need further information: http://wordpress.dwbooster.com/support
200
 
201
  == Changelog ==
202
 
203
+ = 1.0.126 =
204
+
205
+ * Modifies the playlist shortcode to allow inserting the player in products' pages.
206
+
207
  = 1.0.125 =
208
 
209
  * Includes a new option in the plugin's settings to allow multiple players to play simultaneously.
737
 
738
  == Upgrade Notice ==
739
 
740
+ = 1.0.126 =
741
 
742
  Important note: If you are using the Professional version don't update via the WP dashboard but using your personal update link. Contact us if you need further information: http://wordpress.dwbooster.com/support
wcmp.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
- Version: 1.0.125
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
@@ -417,7 +417,7 @@ if ( !class_exists( 'WooCommerceMusicPlayer' ) ) {
417
  wp_enqueue_style( 'wcmp-style', plugin_dir_url(__FILE__).'css/style.css' );
418
  wp_enqueue_script('jquery');
419
  wp_enqueue_script('wp-mediaelement');
420
- wp_enqueue_script('wcmp-script', plugin_dir_url(__FILE__).'js/public.js', array('jquery', 'wp-mediaelement'), '1.0.125');
421
 
422
  $play_all = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr(
423
  '_wcmp_play_all',
@@ -471,7 +471,19 @@ if ( !class_exists( 'WooCommerceMusicPlayer' ) ) {
471
  if(!is_array($atts)) $atts = array();
472
  $post_types = $this->_get_post_types();
473
  if(empty($atts['products_ids']) && !empty($post) && in_array($post->post_type, $post_types))
474
- $atts['products_ids'] = $post->ID;
 
 
 
 
 
 
 
 
 
 
 
 
475
 
476
  extract(
477
  shortcode_atts(
2
  /*
3
  Plugin Name: Music Player for WooCommerce
4
  Plugin URI: https://wcmp.dwbooster.com
5
+ Version: 1.0.126
6
  Text Domain: music-player-for-woocommerce
7
  Author: CodePeople
8
  Author URI: https://wcmp.dwbooster.com
417
  wp_enqueue_style( 'wcmp-style', plugin_dir_url(__FILE__).'css/style.css' );
418
  wp_enqueue_script('jquery');
419
  wp_enqueue_script('wp-mediaelement');
420
+ wp_enqueue_script('wcmp-script', plugin_dir_url(__FILE__).'js/public.js', array('jquery', 'wp-mediaelement'), '1.0.126');
421
 
422
  $play_all = $GLOBALS[ 'WooCommerceMusicPlayer' ]->get_global_attr(
423
  '_wcmp_play_all',
471
  if(!is_array($atts)) $atts = array();
472
  $post_types = $this->_get_post_types();
473
  if(empty($atts['products_ids']) && !empty($post) && in_array($post->post_type, $post_types))
474
+ {
475
+ try{
476
+ ob_start();
477
+ $this->include_all_players($post->ID);
478
+ $output = ob_get_contents();
479
+ ob_end_clean();
480
+ return $output;
481
+ }
482
+ catch(Exception $err)
483
+ {
484
+ $atts['products_ids'] = $post->ID;
485
+ }
486
+ }
487
 
488
  extract(
489
  shortcode_atts(