Advanced Custom Fields: Font Awesome Field - Version 2.0.1

Version Description

  • Fixed bug causing incompatibilities with ACF Clone fields (ACF v5)
  • Fixed bug where default icons could not be unselected when creating FontAwesome fields (ACF v5)
Download this release

Release Info

Developer mattkeys
Plugin Icon 128x128 Advanced Custom Fields: Font Awesome Field
Version 2.0.1
Comparing to
See all releases

Code changes from version 2.0.0 to 2.0.1

acf-font-awesome.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Advanced Custom Fields: Font Awesome
5
  Plugin URI: https://wordpress.org/plugins/advanced-custom-fields-font-awesome/
6
  Description: Adds a new 'Font Awesome Icon' field to the popular Advanced Custom Fields plugin.
7
- Version: 2.0.0
8
  Author: mattkeys
9
  Author URI: http://mattkeys.me/
10
  License: GPLv2 or later
4
  Plugin Name: Advanced Custom Fields: Font Awesome
5
  Plugin URI: https://wordpress.org/plugins/advanced-custom-fields-font-awesome/
6
  Description: Adds a new 'Font Awesome Icon' field to the popular Advanced Custom Fields plugin.
7
+ Version: 2.0.1
8
  Author: mattkeys
9
  Author URI: http://mattkeys.me/
10
  License: GPLv2 or later
assets/js/input-v5.js CHANGED
@@ -36,14 +36,15 @@
36
 
37
  acf.add_action( 'append', function( $el ) {
38
 
39
- // Display Field Groups
40
- var $fa_fields = $el;
41
 
42
- $fa_fields.each( function( index, fa_field ) {
43
- update_preview( $( 'select', fa_field ).val(), fa_field );
44
 
45
- acf.select2.init( $( 'select', fa_field ), select2_init_args( fa_field ), $( fa_field ) );
46
- });
 
47
  });
48
 
49
  acf.add_filter( 'select2_args', function( args, $select, settings, $field ) {
36
 
37
  acf.add_action( 'append', function( $el ) {
38
 
39
+ if ( $( 'select.fontawesome-edit', $el ).length ) {
40
+ var $fa_fields = $el;
41
 
42
+ $fa_fields.each( function( index, fa_field ) {
43
+ update_preview( $( 'select', fa_field ).val(), fa_field );
44
 
45
+ acf.select2.init( $( 'select', fa_field ), select2_init_args( fa_field ), $( fa_field ) );
46
+ });
47
+ }
48
  });
49
 
50
  acf.add_filter( 'select2_args', function( args, $select, settings, $field ) {
fields/acf-font-awesome-v5.php CHANGED
@@ -66,6 +66,7 @@ if ( ! class_exists( 'acf_field_font_awesome' ) ) :
66
  'choices' => $field['choices'],
67
  'placeholder' => 'Choose a default icon (optional)',
68
  'ui' => 1,
 
69
  'ajax' => 1,
70
  'ajax_action' => 'acf/fields/font-awesome/query'
71
  ));
66
  'choices' => $field['choices'],
67
  'placeholder' => 'Choose a default icon (optional)',
68
  'ui' => 1,
69
+ 'allow_null' => 1,
70
  'ajax' => 1,
71
  'ajax_action' => 'acf/fields/font-awesome/query'
72
  ));
readme.txt CHANGED
@@ -46,6 +46,10 @@ This ACF field type is compatible with:
46
 
47
  == Changelog ==
48
 
 
 
 
 
49
  = 2.0.0 =
50
  * Total rewrite of plugin to simplify codebase and better adhere to WordPress and Advanced Custom Fields coding standards and best practices
51
  * Added option to disable the larger icon preview displayed with the FontAwesome select fields
@@ -120,6 +124,10 @@ This ACF field type is compatible with:
120
 
121
  == Upgrade Notice ==
122
 
 
 
 
 
123
  = 2.0.0 =
124
  * Total rewrite of plugin to simplify codebase and better adhere to WordPress and Advanced Custom Fields coding standards and best practices
125
  * Added option to disable the larger icon preview displayed with the FontAwesome select fields
46
 
47
  == Changelog ==
48
 
49
+ = 2.0.1 =
50
+ * Fixed bug causing incompatibilities with ACF Clone fields (ACF v5)
51
+ * Fixed bug where default icons could not be unselected when creating FontAwesome fields (ACF v5)
52
+
53
  = 2.0.0 =
54
  * Total rewrite of plugin to simplify codebase and better adhere to WordPress and Advanced Custom Fields coding standards and best practices
55
  * Added option to disable the larger icon preview displayed with the FontAwesome select fields
124
 
125
  == Upgrade Notice ==
126
 
127
+ = 2.0.1 =
128
+ * Fixed bug causing incompatibilities with ACF Clone fields (ACF v5)
129
+ * Fixed bug where default icons could not be unselected when creating FontAwesome fields (ACF v5)
130
+
131
  = 2.0.0 =
132
  * Total rewrite of plugin to simplify codebase and better adhere to WordPress and Advanced Custom Fields coding standards and best practices
133
  * Added option to disable the larger icon preview displayed with the FontAwesome select fields