Skip to content

Commit c9135b8

Browse files
author
Miika Arponen
committed
Merged
2 parents 0173fde + ea78893 commit c9135b8

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.3.2] - 2018-02-07
8+
9+
### Changed
10+
- Fixed a bug in a function `add_field_location()` which is used by the functions `add_field_before()` and `add_field_after()`.
11+
712
## [1.3.1] - 2018-02-07
813

914
### Changed

plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: ACF Codifier
44
Plugin URI: https://github.com/devgeniem/acf-codifier
55
Description: A helper class to make defining ACF field groups and fields easier in the code.
6-
Version: 1.3.1
6+
Version: 1.3.2
77
Author: Miika Arponen / Geniem Oy
88
Author URI: https://geniem.fi
99
License: GPL-3.0

src/Field/Groupable.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,18 @@ private function add_field_location( \Geniem\ACF\Field $field, $action, $target
187187

188188
// Loop through the fields and populate the new array.
189189
foreach ( $this->{ $this->fields_var } as $key => $item ) {
190+
190191
// If this's the spot, do the right thing.
191192
if ( $action === 'before' && $key === $target ) {
192-
$fields[ $target ] = $field;
193+
$fields[ $field->get_name() ] = $field;
193194
}
194195

195196
// Insert the original inhabitant.
196197
$fields[ $key ] = $item;
197198

198199
// And if this's the spot, do the right thing here.
199200
if ( $action === 'after' && $key === $target ) {
200-
$fields[ $target ] = $field;
201+
$fields[ $field->get_name() ] = $field;
201202
}
202203
}
203204

0 commit comments

Comments
 (0)