MetaSlider - Version 3.5

Version Description

[13/03/17] =

  • New slides will now be added as a new post type (ml-slide) (existing slideshows and slides will be unaffected)
  • Workaround/Fix: Don't use WP_Image_Editor to load slide images that are missing metadata (invalid images)
  • Fix: Load admin JavaScript in footer
  • New: Add "metaslider_after_resize_image" action
Download this release

Release Info

Developer matchalabs
Plugin Icon 128x128 MetaSlider
Version 3.5
Comparing to
See all releases

Code changes from version 3.4.3 to 3.5

inc/metaslider.imagehelper.class.php CHANGED
@@ -16,6 +16,7 @@ class MetaSliderImageHelper {
16
  private $url;
17
  private $path; // path to attachment on server
18
  private $use_image_editor;
 
19
 
20
  /**
21
  * Constructor
@@ -31,8 +32,10 @@ class MetaSliderImageHelper {
31
 
32
  if ( get_post_type( $slide_id ) === 'attachment' ) {
33
  $this->id = $slide_id;
 
34
  } else {
35
  $this->id = get_post_thumbnail_id( $slide_id );
 
36
  }
37
 
38
  $this->url = apply_filters("metaslider_attachment_url", $upload_dir['baseurl'] . "/" . get_post_meta( $this->id, '_wp_attached_file', true ), $this->id);
@@ -344,6 +347,8 @@ class MetaSliderImageHelper {
344
  $backup_sizes["resized-{$dest_size['width']}x{$dest_size['height']}"] = $saved;
345
  update_post_meta( $this->id, '_wp_attachment_backup_sizes', $backup_sizes );
346
 
 
 
347
  $url = str_replace( basename( $this->url ), basename( $saved['path'] ), $this->url );
348
 
349
  return $url;
@@ -356,11 +361,9 @@ class MetaSliderImageHelper {
356
  * @return array
357
  */
358
  private function get_crop_position() {
359
-
360
- $crop_position = get_post_meta( $this->id, 'ml-slider_crop_position', true );
361
 
362
  if ( $crop_position ) {
363
-
364
  $parts = explode( "-", $crop_position );
365
 
366
  if ( isset( $parts[0], $parts[1] ) ) {
@@ -368,8 +371,6 @@ class MetaSliderImageHelper {
368
  }
369
  }
370
 
371
- // default
372
  return array('center', 'center');
373
-
374
  }
375
  }
16
  private $url;
17
  private $path; // path to attachment on server
18
  private $use_image_editor;
19
+ private $slide_id;
20
 
21
  /**
22
  * Constructor
32
 
33
  if ( get_post_type( $slide_id ) === 'attachment' ) {
34
  $this->id = $slide_id;
35
+ $this->slide_id = $slide_id;
36
  } else {
37
  $this->id = get_post_thumbnail_id( $slide_id );
38
+ $this->slide_id = $slide_id;
39
  }
40
 
41
  $this->url = apply_filters("metaslider_attachment_url", $upload_dir['baseurl'] . "/" . get_post_meta( $this->id, '_wp_attached_file', true ), $this->id);
347
  $backup_sizes["resized-{$dest_size['width']}x{$dest_size['height']}"] = $saved;
348
  update_post_meta( $this->id, '_wp_attachment_backup_sizes', $backup_sizes );
349
 
350
+ do_action( "metaslider_after_resize_image", $this->id, $dest_size['width'], $dest_size['height'], $saved );
351
+
352
  $url = str_replace( basename( $this->url ), basename( $saved['path'] ), $this->url );
353
 
354
  return $url;
361
  * @return array
362
  */
363
  private function get_crop_position() {
364
+ $crop_position = get_post_meta( $this->slide_id, 'ml-slider_crop_position', true );
 
365
 
366
  if ( $crop_position ) {
 
367
  $parts = explode( "-", $crop_position );
368
 
369
  if ( isset( $parts[0], $parts[1] ) ) {
371
  }
372
  }
373
 
 
374
  return array('center', 'center');
 
375
  }
376
  }
ml-slider.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: Meta Slider
6
  * Plugin URI: https://www.metaslider.com
7
  * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
8
- * Version: 3.4.3
9
  * Author: Matcha Labs
10
  * Author URI: https://www.metaslider.com
11
  * License: GPL-2.0+
@@ -31,7 +31,7 @@ class MetaSliderPlugin {
31
  /**
32
  * @var string
33
  */
34
- public $version = '3.4.3';
35
 
36
 
37
  /**
@@ -252,7 +252,7 @@ class MetaSliderPlugin {
252
  'publicly_queryable' => false,
253
  'show_in_nav_menus' => false,
254
  'show_ui' => $show_ui,
255
- 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments'),
256
  'labels' => array(
257
  'name' => 'Meta Slides'
258
  )
5
  * Plugin Name: Meta Slider
6
  * Plugin URI: https://www.metaslider.com
7
  * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
8
+ * Version: 3.5
9
  * Author: Matcha Labs
10
  * Author URI: https://www.metaslider.com
11
  * License: GPL-2.0+
31
  /**
32
  * @var string
33
  */
34
+ public $version = '3.5';
35
 
36
 
37
  /**
252
  'publicly_queryable' => false,
253
  'show_in_nav_menus' => false,
254
  'show_ui' => $show_ui,
255
+ 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt'),
256
  'labels' => array(
257
  'name' => 'Meta Slides'
258
  )
readme.txt CHANGED
@@ -128,15 +128,12 @@ See https://www.metaslider.com/documentation/image-cropping/
128
 
129
  == Changelog ==
130
 
131
- = 3.4.3 [01/03/17] =
132
 
133
- * Fix: New slides will now be added as a new post type (ml-slide). For newly added slides, this will fix:
134
- -- Adding the same image to a slideshow multiple times
135
- -- Using unique captions for the same image across multiple slideshows
136
- -- Using unique ordering for the same image across multiple slideshows
137
- Existing slides/slideshows will be unaffected.
138
  * Workaround/Fix: Don't use WP_Image_Editor to load slide images that are missing metadata (invalid images)
139
  * Fix: Load admin JavaScript in footer
 
140
 
141
  = 3.4.2 [16/01/17] =
142
 
128
 
129
  == Changelog ==
130
 
131
+ = 3.5 [13/03/17] =
132
 
133
+ * New slides will now be added as a new post type (ml-slide) (existing slideshows and slides will be unaffected)
 
 
 
 
134
  * Workaround/Fix: Don't use WP_Image_Editor to load slide images that are missing metadata (invalid images)
135
  * Fix: Load admin JavaScript in footer
136
+ * New: Add "metaslider_after_resize_image" action
137
 
138
  = 3.4.2 [16/01/17] =
139