Advanced Custom Fields - Version 3.3.0

Version Description

  • [Fixed] Gallery not returning correct order
Download this release

Release Info

Developer elliotcondon
Plugin Icon 128x128 Advanced Custom Fields
Version 3.3.0
Comparing to
See all releases

Code changes from version 3.2.9 to 3.3.0

Files changed (4) hide show
  1. acf.php +2 -2
  2. core/fields/gallery.php +9 -2
  3. js/input-actions.js +11 -20
  4. readme.txt +3 -0
acf.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://www.advancedcustomfields.com/
5
  Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
6
- Version: 3.2.9
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
@@ -47,7 +47,7 @@ class Acf
47
  // vars
48
  $this->path = plugin_dir_path(__FILE__);
49
  $this->dir = plugins_url('',__FILE__);
50
- $this->version = '3.2.9';
51
  $this->upgrade_version = '3.2.5'; // this is the latest version which requires an upgrade
52
  $this->cache = array(); // basic array cache to hold data throughout the page load
53
 
3
  Plugin Name: Advanced Custom Fields
4
  Plugin URI: http://www.advancedcustomfields.com/
5
  Description: Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress.Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker and more!
6
+ Version: 3.3.0
7
  Author: Elliot Condon
8
  Author URI: http://www.elliotcondon.com/
9
  License: GPL
47
  // vars
48
  $this->path = plugin_dir_path(__FILE__);
49
  $this->dir = plugins_url('',__FILE__);
50
+ $this->version = '3.3.0';
51
  $this->upgrade_version = '3.2.5'; // this is the latest version which requires an upgrade
52
  $this->cache = array(); // basic array cache to hold data throughout the page load
53
 
core/fields/gallery.php CHANGED
@@ -344,11 +344,11 @@ class acf_Gallery extends acf_Field
344
  'post__in' => $value,
345
  ));
346
 
347
- $value = array();
348
  foreach( $attachments as $attachment)
349
  {
350
  // create array to hold value data
351
- $value[] = array(
352
  'id' => $attachment->ID,
353
  'alt' => get_post_meta($attachment->ID, '_wp_attachment_image_alt', true),
354
  'title' => $attachment->post_title,
@@ -358,6 +358,13 @@ class acf_Gallery extends acf_Field
358
  }
359
 
360
 
 
 
 
 
 
 
 
361
  /*
362
  // format attachments
363
  $ordered_attachments = array();
344
  'post__in' => $value,
345
  ));
346
 
347
+ $ordered_attachments = array();
348
  foreach( $attachments as $attachment)
349
  {
350
  // create array to hold value data
351
+ $ordered_attachments[ $attachment->ID ] = array(
352
  'id' => $attachment->ID,
353
  'alt' => get_post_meta($attachment->ID, '_wp_attachment_image_alt', true),
354
  'title' => $attachment->post_title,
358
  }
359
 
360
 
361
+ // override value array with attachments
362
+ foreach( $value as $k => $v)
363
+ {
364
+ $value[ $k ] = $ordered_attachments[ $v ];
365
+ }
366
+
367
+
368
  /*
369
  // format attachments
370
  $ordered_attachments = array();
js/input-actions.js CHANGED
@@ -632,7 +632,18 @@ var acf = {
632
  $(postbox).acf_activate_wysiwyg();
633
 
634
  });
 
 
635
 
 
 
 
 
 
 
 
 
 
636
  $(window).load(function(){
637
 
638
  setTimeout(function(){
@@ -643,26 +654,6 @@ var acf = {
643
  $(document).trigger('acf/setup_fields', $('#poststuff'));
644
  }, 10);
645
 
646
-
647
- if(typeof(tinyMCE) != "object")
648
- {
649
- return false;
650
- }
651
-
652
-
653
- // store variables
654
- if(tinyMCE != undefined && tinyMCE.settings != undefined)
655
- {
656
- acf_wysiwyg_buttons.theme_advanced_buttons1 = tinyMCE.settings.theme_advanced_buttons1;
657
- acf_wysiwyg_buttons.theme_advanced_buttons2 = tinyMCE.settings.theme_advanced_buttons2;
658
- }
659
-
660
-
661
- // click html tab after the wysiwyg has been initialed to prevent dual editor buttons
662
- //setTimeout(function(){
663
- // $('#acf_settings-html').trigger('click');
664
- //}, 502);
665
-
666
  });
667
 
668
  // Sortable: Start
632
  $(postbox).acf_activate_wysiwyg();
633
 
634
  });
635
+
636
+ $(document).ready( function(){
637
 
638
+ // store variables
639
+ if(tinyMCE != undefined && tinyMCE.settings != undefined)
640
+ {
641
+ acf_wysiwyg_buttons.theme_advanced_buttons1 = tinyMCE.settings.theme_advanced_buttons1;
642
+ acf_wysiwyg_buttons.theme_advanced_buttons2 = tinyMCE.settings.theme_advanced_buttons2;
643
+ }
644
+
645
+ });
646
+
647
  $(window).load(function(){
648
 
649
  setTimeout(function(){
654
  $(document).trigger('acf/setup_fields', $('#poststuff'));
655
  }, 10);
656
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
657
  });
658
 
659
  // Sortable: Start
readme.txt CHANGED
@@ -85,6 +85,9 @@ http://www.advancedcustomfields.com/support/
85
 
86
  == Changelog ==
87
 
 
 
 
88
  = 3.2.9 =
89
  * [Added] Add new Gallery Field
90
  * [Fixed] Test / Fix update_field on repeater / flexible content
85
 
86
  == Changelog ==
87
 
88
+ = 3.3.0 =
89
+ * [Fixed] Gallery not returning correct order
90
+
91
  = 3.2.9 =
92
  * [Added] Add new Gallery Field
93
  * [Fixed] Test / Fix update_field on repeater / flexible content