Skip to content

Commit

Permalink
fix bug with cloned fc
Browse files Browse the repository at this point in the history
  • Loading branch information
edirpedro committed Oct 22, 2018
1 parent f510320 commit e0d0e4e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion acf-flexible-content-modal.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Plugin Name: ACF Flexible Content Modal
* Description: Make ACF Flexible Content editing the content of each layout using a Modal window.
* Plugin URI: http://wordpress.org/plugins/acf-flexible-content-modal/
* Version: 1.2.1
* Version: 1.2.2
* Author: Edir Pedro
* Author URI: http://edirpedro.com.br
* License: GPL2
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: edir
Tags: acf, advanced-custom-field, flexible-content
Requires at least: 4.5.2
Tested up to: 4.9.7
Stable tag: 1.2.1
Stable tag: 1.2.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -33,6 +33,9 @@ If you want to name each of the flexible content layout, you can use the ACF hoo

== Changelog ==

= 1.2.2 =
* Fixed bug with cloned FC's.

= 1.2.1 =
* All Flexible Content fields can open in a modal, even nested fields.
* Fixed action to refresh layout_title hook.
Expand Down
5 changes: 2 additions & 3 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,9 @@
var $layout = ACFFCM.modals.pop();

// Refresh layout title

var fc = $layout.parents('.acf-field-flexible-content:first');
fc = acf.getInstance(fc);
var field = fc.getField(fc.data.key);
var field = acf.getInstance(fc);
field.closeLayout(field.$layout($layout.index()));

// Close
Expand Down

0 comments on commit e0d0e4e

Please sign in to comment.