Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

Commit f6a0ad1

Browse files
authored
ACF 6 compatibility, fix #29 (#30)
* ACF 6 compatibility, fix #29 * Fix pull request number in readme
1 parent 04944dd commit f6a0ad1

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Add the svg icons you want to be available in your theme to an acf folder inside
1515
## Compatibility
1616

1717
This ACF field type is compatible with:
18+
19+
[x] ACF 6
1820
[x] ACF 5
1921

2022
## Screenshots
@@ -87,6 +89,7 @@ add_filter('acf_icon_url',
8789

8890
## Changelog
8991

92+
* 1.9.1 - ACF 6 compatibility fix. Thanks to [idflood](https://github.com/houke/acf-icon-picker/pull/30)
9093
* 1.9.0 - Fix issue with Gutenberg preview not updating when removing. Thanks to [cherbst](https://github.com/houke/acf-icon-picker/pull/23)
9194
* 1.8.0 - Fix issue with Gutenberg not saving icon. Thanks to [tlewap](https://github.com/houke/acf-icon-picker/pull/17)
9295
* 1.7.0 - 2 new filters for more control over icon path. Thanks to [benjibee](https://github.com/houke/acf-icon-picker/pull/11)

acf-icon-picker.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: Advanced Custom Fields: Icon Picker
44
Plugin URI: https://github.com/houke/acf-icon-picker
55
Description: Allows you to pick an icon from a predefined list
6-
Version: 1.9.0
6+
Version: 1.9.1
77
Author: Houke de Kwant
88
Author URI: ttps://github.com/houke/
99
License: GPLv2 or later
@@ -21,7 +21,7 @@ class acf_plugin_icon_picker {
2121
function __construct() {
2222

2323
$this->settings = array(
24-
'version' => '1.9.0',
24+
'version' => '1.9.1',
2525
'url' => plugin_dir_url( __FILE__ ),
2626
'path' => plugin_dir_path( __FILE__ )
2727
);

assets/js/input.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
jQuery('.acf-icon-picker__popup-holder').trigger('close');
1818
jQuery('.acf-icon-picker__popup-holder').remove();
1919
jQuery('.acf-icon-picker__img input').trigger('change');
20-
20+
2121
active_item
2222
.parents('.acf-icon-picker')
2323
.find('.acf-icon-picker__remove')
@@ -175,7 +175,8 @@
175175
});
176176

177177
// show the remove button if there is an icon selected
178-
if ($el.find('input').val().length != 0) {
178+
const $input = $el.find('input')
179+
if ($input.length && $input.val().length != 0) {
179180
$el
180181
.find('.acf-icon-picker__remove')
181182
.addClass('acf-icon-picker__remove--active');

0 commit comments

Comments
 (0)