Skip to content

Commit

Permalink
Merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Miika Arponen committed Feb 8, 2018
2 parents 0173fde + ea78893 commit c9135b8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.3.2] - 2018-02-07

### Changed
- Fixed a bug in a function `add_field_location()` which is used by the functions `add_field_before()` and `add_field_after()`.

## [1.3.1] - 2018-02-07

### Changed
Expand Down
2 changes: 1 addition & 1 deletion plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: ACF Codifier
Plugin URI: https://github.com/devgeniem/acf-codifier
Description: A helper class to make defining ACF field groups and fields easier in the code.
Version: 1.3.1
Version: 1.3.2
Author: Miika Arponen / Geniem Oy
Author URI: https://geniem.fi
License: GPL-3.0
Expand Down
5 changes: 3 additions & 2 deletions src/Field/Groupable.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,18 @@ private function add_field_location( \Geniem\ACF\Field $field, $action, $target

// Loop through the fields and populate the new array.
foreach ( $this->{ $this->fields_var } as $key => $item ) {

// If this's the spot, do the right thing.
if ( $action === 'before' && $key === $target ) {
$fields[ $target ] = $field;
$fields[ $field->get_name() ] = $field;
}

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

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

Expand Down

0 comments on commit c9135b8

Please sign in to comment.